261a19d8d3a77f55f8f3d54f18d7ae5181c56189
[openwrt/svn-archive/archive.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 --- a/drivers/crypto/sunxi-ss/sun4i-ss-core.c
21 +++ b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
22 @@ -39,6 +39,7 @@ static struct sun4i_ss_alg_template ss_a
23 .import = sun4i_hash_import_md5,
24 .halg = {
25 .digestsize = MD5_DIGEST_SIZE,
26 + .statesize = sizeof(struct md5_state),
27 .base = {
28 .cra_name = "md5",
29 .cra_driver_name = "md5-sun4i-ss",
30 @@ -66,6 +67,7 @@ static struct sun4i_ss_alg_template ss_a
31 .import = sun4i_hash_import_sha1,
32 .halg = {
33 .digestsize = SHA1_DIGEST_SIZE,
34 + .statesize = sizeof(struct sha1_state),
35 .base = {
36 .cra_name = "sha1",
37 .cra_driver_name = "sha1-sun4i-ss",