diff options
author | tb <> | 2024-02-18 15:43:21 +0000 |
---|---|---|
committer | tb <> | 2024-02-18 15:43:21 +0000 |
commit | 6098295db7aa89d96198a327d46d76586bd54ee0 (patch) | |
tree | 6328727e7cb9491a64c63f54c26ec67574168bdb | |
parent | 8649ab60e71ce1289b2311ce03e64455620cb86b (diff) | |
download | openbsd-6098295db7aa89d96198a327d46d76586bd54ee0.tar.gz openbsd-6098295db7aa89d96198a327d46d76586bd54ee0.tar.bz2 openbsd-6098295db7aa89d96198a327d46d76586bd54ee0.zip |
Add EVP_MD_CTX_legacy_clear()
This is analogous to EVP_CIPHER_CTX_legacy_clear() and will serve as an
internal replacement for EVP_MD_CTX_init() until the conversion to heap
allocated ctx is completed. This way EVP_MD_CTX_init() can be changed to
match the OpenSSL 1.1 API.
ok jsing
-rw-r--r-- | src/lib/libcrypto/evp/evp_digest.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/evp/evp_local.h | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/evp_digest.c b/src/lib/libcrypto/evp/evp_digest.c index 9d8d94afb1..33ba923e72 100644 --- a/src/lib/libcrypto/evp/evp_digest.c +++ b/src/lib/libcrypto/evp/evp_digest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp_digest.c,v 1.8 2024/01/30 17:41:01 tb Exp $ */ | 1 | /* $OpenBSD: evp_digest.c,v 1.9 2024/02/18 15:43:21 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 | * |
@@ -252,6 +252,12 @@ EVP_MD_CTX_init(EVP_MD_CTX *ctx) | |||
252 | memset(ctx, 0, sizeof(*ctx)); | 252 | memset(ctx, 0, sizeof(*ctx)); |
253 | } | 253 | } |
254 | 254 | ||
255 | void | ||
256 | EVP_MD_CTX_legacy_clear(EVP_MD_CTX *ctx) | ||
257 | { | ||
258 | memset(ctx, 0, sizeof(*ctx)); | ||
259 | } | ||
260 | |||
255 | int | 261 | int |
256 | EVP_MD_CTX_reset(EVP_MD_CTX *ctx) | 262 | EVP_MD_CTX_reset(EVP_MD_CTX *ctx) |
257 | { | 263 | { |
diff --git a/src/lib/libcrypto/evp/evp_local.h b/src/lib/libcrypto/evp/evp_local.h index 8b24be6039..65d23547bc 100644 --- a/src/lib/libcrypto/evp/evp_local.h +++ b/src/lib/libcrypto/evp/evp_local.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp_local.h,v 1.15 2024/02/18 15:41:50 tb Exp $ */ | 1 | /* $OpenBSD: evp_local.h,v 1.16 2024/02/18 15:43:21 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -378,6 +378,7 @@ int EVP_PKEY_CTX_hex2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *hex); | |||
378 | int EVP_PKEY_CTX_md(EVP_PKEY_CTX *ctx, int optype, int cmd, const char *md_name); | 378 | int EVP_PKEY_CTX_md(EVP_PKEY_CTX *ctx, int optype, int cmd, const char *md_name); |
379 | 379 | ||
380 | void EVP_CIPHER_CTX_legacy_clear(EVP_CIPHER_CTX *ctx); | 380 | void EVP_CIPHER_CTX_legacy_clear(EVP_CIPHER_CTX *ctx); |
381 | void EVP_MD_CTX_legacy_clear(EVP_MD_CTX *ctx); | ||
381 | 382 | ||
382 | __END_HIDDEN_DECLS | 383 | __END_HIDDEN_DECLS |
383 | 384 | ||