From: Herbert Xu Date: Fri, 25 Apr 2025 10:58:13 +0000 (+0800) Subject: crypto: arm64/sha1 - Set finalize for short finup X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=432f98cf56cf1e0f812f79a713847b37ae86cf31;p=users%2Fdwmw2%2Flinux.git crypto: arm64/sha1 - Set finalize for short finup Always set sctx->finalize before calling finup as it may not have been set previously on a short final. Reported-by: Corentin LABBE Fixes: b97d31100e36 ("crypto: arm64/sha1 - Use API partial block handling") Signed-off-by: Herbert Xu Tested-by: Corentin LABBE Signed-off-by: Herbert Xu --- diff --git a/arch/arm64/crypto/sha1-ce-glue.c b/arch/arm64/crypto/sha1-ce-glue.c index 1f8c93fe1e649..65b6980817e5b 100644 --- a/arch/arm64/crypto/sha1-ce-glue.c +++ b/arch/arm64/crypto/sha1-ce-glue.c @@ -79,8 +79,10 @@ static int sha1_ce_finup(struct shash_desc *desc, const u8 *data, data += len - remain; len = remain; } - if (!finalized) + if (!finalized) { + sctx->finalize = 0; sha1_base_do_finup(desc, data, len, sha1_ce_transform); + } return sha1_base_finish(desc, out); }