diff options
-rw-r--r-- | src/lib/libcrypto/evp/e_aes.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c index 25e69f9ae7..a1e94c8ff6 100644 --- a/src/lib/libcrypto/evp/e_aes.c +++ b/src/lib/libcrypto/evp/e_aes.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: e_aes.c,v 1.37 2019/04/14 17:27:42 jsing Exp $ */ | 1 | /* $OpenBSD: e_aes.c,v 1.38 2019/05/10 18:41:17 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -829,6 +829,12 @@ aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) | |||
829 | EVP_CIPHER_CTX *out = ptr; | 829 | EVP_CIPHER_CTX *out = ptr; |
830 | EVP_AES_GCM_CTX *gctx_out = out->cipher_data; | 830 | EVP_AES_GCM_CTX *gctx_out = out->cipher_data; |
831 | 831 | ||
832 | if (gctx->gcm.key) { | ||
833 | if (gctx->gcm.key != &gctx->ks) | ||
834 | return 0; | ||
835 | gctx_out->gcm.key = &gctx_out->ks; | ||
836 | } | ||
837 | |||
832 | if (gctx->iv == c->iv) { | 838 | if (gctx->iv == c->iv) { |
833 | gctx_out->iv = out->iv; | 839 | gctx_out->iv = out->iv; |
834 | } else { | 840 | } else { |