diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2016-06-29 06:03:47 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-07-01 11:45:03 -0400 |
commit | 2495cf25f60e085b35beb9b215235dfe1ca4f200 (patch) | |
tree | 4289c1aa25ed0128814391bba655281741a11b84 /crypto/ahash.c | |
parent | 927ef32dccfe6e048a163138b8e714b2d944194d (diff) |
crypto: ahash - Add padding in crypto_ahash_extsize
The function crypto_ahash_extsize did not include padding when
computing the tfm context size. This patch fixes this by using
the generic crypto_alg_extsize helper.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/ahash.c')
-rw-r--r-- | crypto/ahash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/ahash.c b/crypto/ahash.c index 3887a98abcc3..2ce8bcb9049c 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c | |||
@@ -461,10 +461,10 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm) | |||
461 | 461 | ||
462 | static unsigned int crypto_ahash_extsize(struct crypto_alg *alg) | 462 | static unsigned int crypto_ahash_extsize(struct crypto_alg *alg) |
463 | { | 463 | { |
464 | if (alg->cra_type == &crypto_ahash_type) | 464 | if (alg->cra_type != &crypto_ahash_type) |
465 | return alg->cra_ctxsize; | 465 | return sizeof(struct crypto_shash *); |
466 | 466 | ||
467 | return sizeof(struct crypto_shash *); | 467 | return crypto_alg_extsize(alg); |
468 | } | 468 | } |
469 | 469 | ||
470 | #ifdef CONFIG_NET | 470 | #ifdef CONFIG_NET |