From: tb Date: Sun, 18 Feb 2024 15:43:21 +0000 (+0000) Subject: Add EVP_MD_CTX_legacy_clear() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a88dcb3defb46fedb6fc29e05d59a0c7a2e772b9;p=openbsd 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 --- diff --git a/lib/libcrypto/evp/evp_digest.c b/lib/libcrypto/evp/evp_digest.c index 9d8d94afb16..33ba923e723 100644 --- a/lib/libcrypto/evp/evp_digest.c +++ b/lib/libcrypto/evp/evp_digest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_digest.c,v 1.8 2024/01/30 17:41:01 tb Exp $ */ +/* $OpenBSD: evp_digest.c,v 1.9 2024/02/18 15:43:21 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -252,6 +252,12 @@ EVP_MD_CTX_init(EVP_MD_CTX *ctx) memset(ctx, 0, sizeof(*ctx)); } +void +EVP_MD_CTX_legacy_clear(EVP_MD_CTX *ctx) +{ + memset(ctx, 0, sizeof(*ctx)); +} + int EVP_MD_CTX_reset(EVP_MD_CTX *ctx) { diff --git a/lib/libcrypto/evp/evp_local.h b/lib/libcrypto/evp/evp_local.h index 8b24be60391..65d23547bca 100644 --- a/lib/libcrypto/evp/evp_local.h +++ b/lib/libcrypto/evp/evp_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_local.h,v 1.15 2024/02/18 15:41:50 tb Exp $ */ +/* $OpenBSD: evp_local.h,v 1.16 2024/02/18 15:43:21 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -378,6 +378,7 @@ int EVP_PKEY_CTX_hex2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *hex); int EVP_PKEY_CTX_md(EVP_PKEY_CTX *ctx, int optype, int cmd, const char *md_name); void EVP_CIPHER_CTX_legacy_clear(EVP_CIPHER_CTX *ctx); +void EVP_MD_CTX_legacy_clear(EVP_MD_CTX *ctx); __END_HIDDEN_DECLS