summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2019-04-14 17:26:27 +0000
committerjsing <>2019-04-14 17:26:27 +0000
commitf229dd1a7dd951f92d7533beb0d13612e3b264da (patch)
treef8c8f9236f69297d13d57236b32507a90f3beafd
parent029997cc1481f67b092bc34aaf86734a50c8ff0c (diff)
downloadopenbsd-f229dd1a7dd951f92d7533beb0d13612e3b264da.tar.gz
openbsd-f229dd1a7dd951f92d7533beb0d13612e3b264da.tar.bz2
openbsd-f229dd1a7dd951f92d7533beb0d13612e3b264da.zip
Remove two pointless chunks of code.
This reverts part of OpenSSL c2fd5d79, which added the same code to AES CCM, GCM and XTS. In the case of CCM and GCM nothing assigns {ccm,gcm}.key so there is never going to be anything to update (unlike XTS). ok tb@
-rw-r--r--src/lib/libcrypto/evp/e_aes.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c
index 6b455dc503..14875310ad 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.35 2019/03/17 18:07:41 tb Exp $ */ 1/* $OpenBSD: e_aes.c,v 1.36 2019/04/14 17:26:27 jsing 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,11 +829,6 @@ 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 if (gctx->iv == c->iv) 832 if (gctx->iv == c->iv)
838 gctx_out->iv = out->iv; 833 gctx_out->iv = out->iv;
839 else { 834 else {
@@ -1243,17 +1238,7 @@ aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
1243 return 1; 1238 return 1;
1244 1239
1245 case EVP_CTRL_COPY: 1240 case EVP_CTRL_COPY:
1246 {
1247 EVP_CIPHER_CTX *out = ptr;
1248 EVP_AES_CCM_CTX *cctx_out = out->cipher_data;
1249
1250 if (cctx->ccm.key) {
1251 if (cctx->ccm.key != &cctx->ks)
1252 return 0;
1253 cctx_out->ccm.key = &cctx_out->ks;
1254 }
1255 return 1; 1241 return 1;
1256 }
1257 1242
1258 default: 1243 default:
1259 return -1; 1244 return -1;