Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 223ba92a authored by Antoine Tenart's avatar Antoine Tenart Committed by Greg Kroah-Hartman
Browse files

crypto: atmel-aes - fix the keys zeroing on errors



[ Upstream commit 5d804a51 ]

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: 89a82ef8 ("crypto: atmel-authenc - add support to authenc(hmac(shaX), Y(aes)) modes")
Signed-off-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
Reviewed-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 173c5549
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2145,7 +2145,7 @@ static int atmel_aes_authenc_setkey(struct crypto_aead *tfm, const u8 *key,

badkey:
	crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
	memzero_explicit(&key, sizeof(keys));
	memzero_explicit(&keys, sizeof(keys));
	return -EINVAL;
}