From: Herbert Xu Date: Wed, 29 Jun 2016 10:03:47 +0000 (+0800) Subject: crypto: ahash - Add padding in crypto_ahash_extsize X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2495cf25f60e085b35beb9b215235dfe1ca4f200;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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) 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