Skip to content

Commit 1403789

Browse files
atenartambarus
authored andcommitted
crypto: atmel-aes - fix the keys zeroing on errors
The Atmel AES driver uses memzero_explicit on the keys on error, but the variable zeroed isn't the right one because of a typo. Fix this by using the right variable. Fixes: 89a82ef ("crypto: atmel-authenc - add support to authenc(hmac(shaX), Y(aes)) modes") Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit 5d804a5)
1 parent b19cb70 commit 1403789

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/crypto/atmel-aes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,7 @@ static int atmel_aes_authenc_setkey(struct crypto_aead *tfm, const u8 *key,
21552155

21562156
badkey:
21572157
crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
2158-
memzero_explicit(&key, sizeof(keys));
2158+
memzero_explicit(&keys, sizeof(keys));
21592159
return -EINVAL;
21602160
}
21612161

0 commit comments

Comments
 (0)