summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/evp/p_legacy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/evp/p_legacy.c b/src/lib/libcrypto/evp/p_legacy.c
index a444309f1d..adb6dc9174 100644
--- a/src/lib/libcrypto/evp/p_legacy.c
+++ b/src/lib/libcrypto/evp/p_legacy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_legacy.c,v 1.4 2024/03/26 05:22:50 joshua Exp $ */ 1/* $OpenBSD: p_legacy.c,v 1.5 2024/03/28 01:42:02 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -99,7 +99,8 @@ EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
99 int i, size = 0, ret = 0; 99 int i, size = 0, ret = 0;
100 100
101 if (type) { 101 if (type) {
102 EVP_CIPHER_CTX_reset(ctx); 102 if (!EVP_CIPHER_CTX_reset(ctx))
103 return 0;
103 if (!EVP_DecryptInit_ex(ctx, type, NULL, NULL, NULL)) 104 if (!EVP_DecryptInit_ex(ctx, type, NULL, NULL, NULL))
104 return 0; 105 return 0;
105 } 106 }
@@ -154,7 +155,8 @@ EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek,
154 int i, iv_len; 155 int i, iv_len;
155 156
156 if (type) { 157 if (type) {
157 EVP_CIPHER_CTX_reset(ctx); 158 if (!EVP_CIPHER_CTX_reset(ctx))
159 return 0;
158 if (!EVP_EncryptInit_ex(ctx, type, NULL, NULL, NULL)) 160 if (!EVP_EncryptInit_ex(ctx, type, NULL, NULL, NULL))
159 return 0; 161 return 0;
160 } 162 }