From: Herbert Xu Date: Thu, 15 May 2025 05:54:44 +0000 (+0800) Subject: crypto: shash - Set reqsize in shash_alg X-Git-Tag: v6.16-rc1~206^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32a9fd8f498bffd99c5d5441015136206e351ae4;p=thirdparty%2Fkernel%2Flinux.git crypto: shash - Set reqsize in shash_alg Make reqsize static for shash algorithms. Signed-off-by: Herbert Xu --- diff --git a/crypto/ahash.c b/crypto/ahash.c index cf8bbe7e54c02..bf8375bb32c98 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -286,7 +286,6 @@ static int crypto_init_ahash_using_shash(struct crypto_tfm *tfm) crypto_ahash_set_flags(crt, crypto_shash_get_flags(shash) & CRYPTO_TFM_NEED_KEY); - crt->reqsize = sizeof(struct shash_desc) + crypto_shash_descsize(shash); return 0; } diff --git a/crypto/shash.c b/crypto/shash.c index 5bc74a72d5ad9..37537d7995c7b 100644 --- a/crypto/shash.c +++ b/crypto/shash.c @@ -511,6 +511,8 @@ static int shash_prepare_alg(struct shash_alg *alg) if (alg->statesize > HASH_MAX_STATESIZE) return -EINVAL; + base->cra_reqsize = sizeof(struct shash_desc) + alg->descsize; + return 0; }