diff options
author | Antoine Tenart <antoine.tenart@bootlin.com> | 2018-02-23 04:01:40 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-03-02 11:03:40 -0500 |
commit | 5d804a5157dbaa64872a675923ae87161165c66b (patch) | |
tree | 0c30bfb0e8033260cbddcd91e36163973baa9be3 | |
parent | 699e491bac84a2069c7abeacf2f4367ecb19fa9c (diff) |
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: 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>
-rw-r--r-- | drivers/crypto/atmel-aes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 6fb24fc94b1f..801aeab5ab1e 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c | |||
@@ -2155,7 +2155,7 @@ static int atmel_aes_authenc_setkey(struct crypto_aead *tfm, const u8 *key, | |||
2155 | 2155 | ||
2156 | badkey: | 2156 | badkey: |
2157 | crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); | 2157 | crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); |
2158 | memzero_explicit(&key, sizeof(keys)); | 2158 | memzero_explicit(&keys, sizeof(keys)); |
2159 | return -EINVAL; | 2159 | return -EINVAL; |
2160 | } | 2160 | } |
2161 | 2161 | ||