sunxi: initial 4.4 support
[openwrt/openwrt.git] / target / linux / sunxi / patches-4.4 / 116-crypto-add-missing-statesize.patch
1 From 4f9ea86604e3ba64edd2817795798168fbb3c1a6 Mon Sep 17 00:00:00 2001
2 From: LABBE Corentin <clabbe.montjoie@gmail.com>
3 Date: Mon, 16 Nov 2015 09:35:54 +0100
4 Subject: [PATCH] crypto: sun4i-ss - add missing statesize
5
6 sun4i-ss implementaton of md5/sha1 is via ahash algorithms.
7 Commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero")
8 made impossible to load them without giving statesize. This patch
9 specifiy statesize for sha1 and md5.
10
11 Fixes: 6298e948215f ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator")
12 Cc: <stable@vger.kernel.org> # v4.3+
13 Tested-by: Chen-Yu Tsai <wens@csie.org>
14 Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
15 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 ---
17 drivers/crypto/sunxi-ss/sun4i-ss-core.c | 2 ++
18 1 file changed, 2 insertions(+)
19
20 diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-core.c b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
21 index eab6fe2..107cd2a 100644
22 --- a/drivers/crypto/sunxi-ss/sun4i-ss-core.c
23 +++ b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
24 @@ -39,6 +39,7 @@ static struct sun4i_ss_alg_template ss_algs[] = {
25 .import = sun4i_hash_import_md5,
26 .halg = {
27 .digestsize = MD5_DIGEST_SIZE,
28 + .statesize = sizeof(struct md5_state),
29 .base = {
30 .cra_name = "md5",
31 .cra_driver_name = "md5-sun4i-ss",
32 @@ -66,6 +67,7 @@ static struct sun4i_ss_alg_template ss_algs[] = {
33 .import = sun4i_hash_import_sha1,
34 .halg = {
35 .digestsize = SHA1_DIGEST_SIZE,
36 + .statesize = sizeof(struct sha1_state),
37 .base = {
38 .cra_name = "sha1",
39 .cra_driver_name = "sha1-sun4i-ss",