summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/e_aes.c
diff options
context:
space:
mode:
authortb <>2023-03-01 11:16:06 +0000
committertb <>2023-03-01 11:16:06 +0000
commitf5e0861acadab7b2625681b497a31647ae1ac5e2 (patch)
treeddd86c921e987eb4b4fd9638484ec09a25f73f4a /src/lib/libcrypto/evp/e_aes.c
parent570f472a828e4bb99852360fc02874847bbe787a (diff)
downloadopenbsd-f5e0861acadab7b2625681b497a31647ae1ac5e2.tar.gz
openbsd-f5e0861acadab7b2625681b497a31647ae1ac5e2.tar.bz2
openbsd-f5e0861acadab7b2625681b497a31647ae1ac5e2.zip
Make the cleanup() method return an int again
This partially reverts jsing's OpenBSD commit b8185953, but without adding back the error check that potentialy results in dumb leaks. No cleanup() method in the wild returns anything but 1. Since that's the signature in the EVP_CIPHER_meth_* API, we have no choice... ok jsing
Diffstat (limited to 'src/lib/libcrypto/evp/e_aes.c')
-rw-r--r--src/lib/libcrypto/evp/e_aes.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c
index 0d7daf43e3..790b26384d 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.50 2022/11/26 16:08:52 tb Exp $ */ 1/* $OpenBSD: e_aes.c,v 1.51 2023/03/01 11:16:06 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 *
@@ -1255,7 +1255,7 @@ EVP_aes_256_ctr(void)
1255#endif 1255#endif
1256} 1256}
1257 1257
1258static void 1258static int
1259aes_gcm_cleanup(EVP_CIPHER_CTX *c) 1259aes_gcm_cleanup(EVP_CIPHER_CTX *c)
1260{ 1260{
1261 EVP_AES_GCM_CTX *gctx = c->cipher_data; 1261 EVP_AES_GCM_CTX *gctx = c->cipher_data;
@@ -1264,6 +1264,8 @@ aes_gcm_cleanup(EVP_CIPHER_CTX *c)
1264 free(gctx->iv); 1264 free(gctx->iv);
1265 1265
1266 explicit_bzero(gctx, sizeof(*gctx)); 1266 explicit_bzero(gctx, sizeof(*gctx));
1267
1268 return 1;
1267} 1269}
1268 1270
1269/* increment counter (64-bit int) by 1 */ 1271/* increment counter (64-bit int) by 1 */