Skip to content

Commit

Permalink
crypto: authenc - don't leak pointers to authenc keys
Browse files Browse the repository at this point in the history
In crypto_authenc_setkey we save pointers to the authenc keys in
a local variable of type struct crypto_authenc_keys and we don't
zeroize it after use. Fix this and don't leak pointers to the
authenc keys.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Tudor-Dan Ambarus authored and Herbert Xu committed Apr 20, 2018
1 parent d28fc3d commit ad2fdcd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crypto/authenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key,
CRYPTO_TFM_RES_MASK);

out:
memzero_explicit(&keys, sizeof(keys));
return err;

badkey:
Expand Down

0 comments on commit ad2fdcd

Please sign in to comment.