summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2019-05-10 18:41:17 +0000
committertb <>2019-05-10 18:41:17 +0000
commit70665059314d793e491190f527c68ffb3047b0b6 (patch)
tree60965b58fec2f21385c42f48441318b9f67ab593 /src
parentdb9d6bd84c976c2cbc8987b4f833c82c5657008e (diff)
downloadopenbsd-70665059314d793e491190f527c68ffb3047b0b6.tar.gz
openbsd-70665059314d793e491190f527c68ffb3047b0b6.tar.bz2
openbsd-70665059314d793e491190f527c68ffb3047b0b6.zip
Revert part of r1.36: in the case of GCM, gcm.key is assigned from
aesni_gcm_init_key() via CRYPTO_gcm128_init(), so it needs to be copied over... Fixes cryptofuzz issue #14352 and likely also #14374. ok beck jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/evp/e_aes.c8
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 {