summaryrefslogtreecommitdiff
path: root/crypto/ahash.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-06-29 18:03:47 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2016-07-01 23:45:03 +0800
commit51ad1b17a2d0dd7458948ead51cd72dfb58653b0 (patch)
treed13a6cc1d2786ca63428dbb0e779082686eedf30 /crypto/ahash.c
parente50ad8a2905bdf2e90f3c5a4515ec009f3fdb1db (diff)
downloadlinux-crypto-51ad1b17a2d0dd7458948ead51cd72dfb58653b0.tar.gz
linux-crypto-51ad1b17a2d0dd7458948ead51cd72dfb58653b0.zip
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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/ahash.c b/crypto/ahash.c
index 3887a98a..2ce8bcb9 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -461,10 +461,10 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm)
static unsigned int crypto_ahash_extsize(struct crypto_alg *alg)
{
- if (alg->cra_type == &crypto_ahash_type)
- return alg->cra_ctxsize;
+ if (alg->cra_type != &crypto_ahash_type)
+ return sizeof(struct crypto_shash *);
- return sizeof(struct crypto_shash *);
+ return crypto_alg_extsize(alg);
}
#ifdef CONFIG_NET