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
commit16b15f4fa4a15b71c7c926fe8125fcd0b253aa22 (patch)
tree60965b58fec2f21385c42f48441318b9f67ab593 /src
parent5110d9a926df971b8571a962d563e7d569b505d7 (diff)
downloadopenbsd-16b15f4fa4a15b71c7c926fe8125fcd0b253aa22.tar.gz
openbsd-16b15f4fa4a15b71c7c926fe8125fcd0b253aa22.tar.bz2
openbsd-16b15f4fa4a15b71c7c926fe8125fcd0b253aa22.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 {