summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp')
-rw-r--r--src/lib/libcrypto/evp/bio_enc.c6
-rw-r--r--src/lib/libcrypto/evp/p_legacy.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c
index d2132adb4e..dd3840074f 100644
--- a/src/lib/libcrypto/evp/bio_enc.c
+++ b/src/lib/libcrypto/evp/bio_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_enc.c,v 1.29 2023/07/07 19:37:53 beck Exp $ */ 1/* $OpenBSD: bio_enc.c,v 1.30 2024/02/18 15:44:10 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 *
@@ -115,7 +115,7 @@ enc_new(BIO *bi)
115 ctx = malloc(sizeof(BIO_ENC_CTX)); 115 ctx = malloc(sizeof(BIO_ENC_CTX));
116 if (ctx == NULL) 116 if (ctx == NULL)
117 return (0); 117 return (0);
118 EVP_CIPHER_CTX_init(&ctx->cipher); 118 EVP_CIPHER_CTX_legacy_clear(&ctx->cipher);
119 119
120 ctx->buf_len = 0; 120 ctx->buf_len = 0;
121 ctx->buf_off = 0; 121 ctx->buf_off = 0;
@@ -360,7 +360,7 @@ again:
360 case BIO_CTRL_DUP: 360 case BIO_CTRL_DUP:
361 dbio = (BIO *)ptr; 361 dbio = (BIO *)ptr;
362 dctx = (BIO_ENC_CTX *)dbio->ptr; 362 dctx = (BIO_ENC_CTX *)dbio->ptr;
363 EVP_CIPHER_CTX_init(&dctx->cipher); 363 EVP_CIPHER_CTX_legacy_clear(&dctx->cipher);
364 ret = EVP_CIPHER_CTX_copy(&dctx->cipher, &ctx->cipher); 364 ret = EVP_CIPHER_CTX_copy(&dctx->cipher, &ctx->cipher);
365 if (ret) 365 if (ret)
366 dbio->init = 1; 366 dbio->init = 1;
diff --git a/src/lib/libcrypto/evp/p_legacy.c b/src/lib/libcrypto/evp/p_legacy.c
index f73a6a9dae..2036258dc5 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.2 2023/12/20 13:52:17 tb Exp $ */ 1/* $OpenBSD: p_legacy.c,v 1.3 2024/02/18 15:44:10 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,7 @@ 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_init(ctx); 102 EVP_CIPHER_CTX_legacy_clear(ctx);
103 if (!EVP_DecryptInit_ex(ctx, type, NULL, NULL, NULL)) 103 if (!EVP_DecryptInit_ex(ctx, type, NULL, NULL, NULL))
104 return 0; 104 return 0;
105 } 105 }
@@ -154,7 +154,7 @@ EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek,
154 int i, iv_len; 154 int i, iv_len;
155 155
156 if (type) { 156 if (type) {
157 EVP_CIPHER_CTX_init(ctx); 157 EVP_CIPHER_CTX_legacy_clear(ctx);
158 if (!EVP_EncryptInit_ex(ctx, type, NULL, NULL, NULL)) 158 if (!EVP_EncryptInit_ex(ctx, type, NULL, NULL, NULL))
159 return 0; 159 return 0;
160 } 160 }