mirror of
https://github.com/torvalds/linux.git
synced 2026-10-23 15:32:04 +02:00
security: keys: trusted: always clear the hmac_sha1_ctx before returning
Clear the hmac_sha1_ctx structure via __cleanup(hmac_sha1_zeroize_ctx) to make sure that the function does not leak sensitive data on the stack when returning without calling hmac_sha1_final(). Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Thomas Huth <thuth@redhat.com> Link: https://patch.msgid.link/20260916095022.604354-10-thuth@redhat.com Signed-off-by: Eric Biggers <ebiggers@kernel.org>
This commit is contained in:
parent
e09cbc96ff
commit
6df7613758
|
|
@ -101,7 +101,7 @@ static inline void dump_tpm_buf(unsigned char *buf)
|
|||
static int TSS_rawhmac(unsigned char *digest, const unsigned char *key,
|
||||
unsigned int keylen, ...)
|
||||
{
|
||||
struct hmac_sha1_ctx hmac_ctx;
|
||||
struct hmac_sha1_ctx hmac_ctx __cleanup(hmac_sha1_zeroize_ctx);
|
||||
va_list argp;
|
||||
unsigned int dlen;
|
||||
unsigned char *data;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user