From patchwork Tue Oct 19 18:31:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Openvpn-devel,v3,11/21,OSSL,3.0] USe EVP_MD_get0_name instead EV_MD_name X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2038 Message-Id: <20211019183127.614175-12-arne@rfc2549.org> To: openvpn-devel@lists.sourceforge.net Date: Tue, 19 Oct 2021 20:31:17 +0200 From: Arne Schwabe List-Id: Use the new name for the function as it indicates with get0 the ownership of the returned value Signed-off-by: Arne Schwabe Acked-by: Max Fillinger --- src/openvpn/crypto_openssl.c | 2 +- src/openvpn/openssl_compat.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index b10bd7cd5..407ea4a7c 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -916,7 +916,7 @@ md_kt_name(const EVP_MD *kt) { return "[null-digest]"; } - return EVP_MD_name(kt); + return EVP_MD_get0_name(kt); } unsigned char diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h index 0893bfbb2..2aa718a33 100644 --- a/src/openvpn/openssl_compat.h +++ b/src/openvpn/openssl_compat.h @@ -751,6 +751,8 @@ int EVP_PKEY_get_group_name(EVP_PKEY *pkey, char *gname, size_t gname_sz, /** Mimics SSL_CTX_new_ex for OpenSSL < 3 */ #if OPENSSL_VERSION_NUMBER < 0x30000000L +#define EVP_MD_get0_name EVP_MD_name + static inline SSL_CTX * SSL_CTX_new_ex(void *libctx, const char *propq, const SSL_METHOD *method) {