Skip to content

Commit

Permalink
crypto: atmel-aes - fix the keys zeroing on errors
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Tudor Ambarus <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
atenart authored and herbertx committed Mar 2, 2018
1 parent 699e491 commit 5d804a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/crypto/atmel-aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5d804a5

Please sign in to comment.