mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
mac80211: fils_aead: Use __cleanup() instead of memzero_explicit()
By using __cleanup(aes_cmac_zeroize_key) for clearing the key data, we can save one line of code here. Signed-off-by: Thomas Huth <thuth@redhat.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Link: https://patch.msgid.link/20260807125845.1477067-7-thuth@redhat.com Signed-off-by: Eric Biggers <ebiggers@kernel.org>
This commit is contained in:
parent
053baab47d
commit
ff6ac62907
|
|
@ -24,7 +24,7 @@ static int aes_s2v(const u8 *in_key, size_t key_len,
|
|||
size_t num_elem, const u8 *addr[], size_t len[], u8 *v)
|
||||
{
|
||||
u8 d[AES_BLOCK_SIZE], tmp[AES_BLOCK_SIZE] = {};
|
||||
struct aes_cmac_key key;
|
||||
struct aes_cmac_key key __cleanup(aes_cmac_zeroize_key);
|
||||
struct aes_cmac_ctx ctx;
|
||||
size_t i;
|
||||
int res;
|
||||
|
|
@ -62,7 +62,6 @@ static int aes_s2v(const u8 *in_key, size_t key_len,
|
|||
aes_cmac_update(&ctx, d, AES_BLOCK_SIZE);
|
||||
aes_cmac_final(&ctx, v);
|
||||
|
||||
memzero_explicit(&key, sizeof(key));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user