Re: [PATCH v3 11/13] lib/crypto: sha2: Provide functions for zeroizing SHA2 hmac_sha* structures
From: Namjae Jeon
Date: Thu Sep 10 2026 - 21:17:38 EST
On Thu, Sep 10, 2026 at 9:52 PM Thomas Huth <thuth@xxxxxxxxxx> wrote:
>
> In certain cases crypto code functions need to zeroize their local SHA2
> hmac_sha*_key or hmac_sha*_ctx structures after use to avoid leaking
> sensitive material on the stack.
> Provide hmac_sha*_zeroize_key() and hmac_sha*_zeroize_ctx() helper
> functions that can be used with __cleanup() to automatically zeroize
> the structure when it goes out of scope.
>
> Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
Reviewed-by: Namjae Jeon <linkinjeon@xxxxxxxxxx>
Thanks.