[PATCH 3/3] lib/crypto: sha1: Use hmac_sha1_zeroize_ctx() instead of memzero_explicit()
From: Thomas Huth
Date: Wed Aug 12 2026 - 12:42:22 EST
From: Thomas Huth <thuth@xxxxxxxxxx>
It's only cosmetics, but since we have the new hmac_sha1_zeroize_ctx()
function anyway, we can also use it here.
Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
---
lib/crypto/sha1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/crypto/sha1.c b/lib/crypto/sha1.c
index b687b89d97cb4..c4361ef77166e 100644
--- a/lib/crypto/sha1.c
+++ b/lib/crypto/sha1.c
@@ -275,7 +275,7 @@ void hmac_sha1_final(struct hmac_sha1_ctx *ctx, u8 out[SHA1_DIGEST_SIZE])
for (size_t i = 0; i < SHA1_DIGEST_SIZE; i += 4)
put_unaligned_be32(ctx->ostate.h[i / 4], out + i);
- memzero_explicit(ctx, sizeof(*ctx));
+ hmac_sha1_zeroize_ctx(ctx);
}
EXPORT_SYMBOL_GPL(hmac_sha1_final);
--
2.55.0