[Openvpn-devel,v2,11/20,OSSL,3.0] USe EVP_MD_get0_name instead EV_MD_name

Message ID 20211019182332.613155-14-arne@rfc2549.org
State Superseded
Headers show
Series
  • OpenSSL 3.0 improvements for OpenVPN
Related show

Commit Message

Arne Schwabe Oct. 19, 2021, 6:23 p.m.
Use the new name for the function as it indicates with
get0 the ownership of the returned value

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
 src/openvpn/crypto_openssl.c | 2 +-
 src/openvpn/openssl_compat.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Patch

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)
 {