diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2017-01-01 14:53:33 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-02-07 09:19:16 +0000 |
commit | 166e365ed84dfabec3274baf8a9ef8aa4e677891 (patch) | |
tree | afc079ec5c92837baaf00d254425f1fb5f258d9e /crypto | |
parent | 1222d273d36277f56c3603a757240c386d55f318 (diff) |
aes_gcm_cleanup() should check that gctx != NULL before
calling OPENSSL_cleanse()
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2149)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/evp/e_aes.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c index 7c62d327a1..47fcd82077 100644 --- a/crypto/evp/e_aes.c +++ b/crypto/evp/e_aes.c @@ -1120,6 +1120,8 @@ BLOCK_CIPHER_generic_pack(NID_aes, 128, EVP_CIPH_FLAG_FIPS) static int aes_gcm_cleanup(EVP_CIPHER_CTX *c) { EVP_AES_GCM_CTX *gctx = c->cipher_data; + if (gctx == NULL) + return 0; OPENSSL_cleanse(&gctx->gcm, sizeof(gctx->gcm)); if (gctx->iv != c->iv) OPENSSL_free(gctx->iv); |