Skip to content

Commit

Permalink
crypto: cryptd - Assign statesize properly
Browse files Browse the repository at this point in the history
cryptd_create_hash() fails by returning -EINVAL.  It is because after
8996eaf ("crypto: ahash - ensure statesize is non-zero") all ahash
drivers must have a non-zero statesize.

This patch fixes the problem by properly assigning the statesize.

Signed-off-by: Rui Wang <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ruiwang1 authored and herbertx committed Dec 4, 2015
1 parent 3a020a7 commit 1a07834
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crypto/cryptd.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ static int cryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb,
inst->alg.halg.base.cra_flags = type;

inst->alg.halg.digestsize = salg->digestsize;
inst->alg.halg.statesize = salg->statesize;
inst->alg.halg.base.cra_ctxsize = sizeof(struct cryptd_hash_ctx);

inst->alg.halg.base.cra_init = cryptd_hash_init_tfm;
Expand Down

0 comments on commit 1a07834

Please sign in to comment.