]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
crypto: atmel-aes - fix the keys zeroing on errors
authorAntoine Tenart <antoine.tenart@bootlin.com>
Fri, 23 Feb 2018 09:01:40 +0000 (10:01 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 2 Mar 2018 16:03:40 +0000 (00:03 +0800)
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: 89a82ef87e01 ("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>
drivers/crypto/atmel-aes.c

index 6fb24fc94b1f7e7dd5bd2ed4a30597958da64f55..801aeab5ab1e6898c8eb172a3a95a1daf989584b 100644 (file)
@@ -2155,7 +2155,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;
 }