From f5da6638ecb8ea97df53856542231df4a3befca1 Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Fri, 17 Nov 2017 14:30:45 -0800 Subject: [PATCH] ITS#8753, ITS#8774 - Fix compilation with older versions of OpenSSL --- libraries/libldap/tls_o.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/libldap/tls_o.c b/libraries/libldap/tls_o.c index d3b6ceb35f..2cf503bcf9 100644 --- a/libraries/libldap/tls_o.c +++ b/libraries/libldap/tls_o.c @@ -867,7 +867,11 @@ tlso_session_pinning( LDAP *ld, tls_session *sess, char *hashalg, struct berval goto done; } +#if OPENSSL_VERSION_NUMBER >= 0x10100000 mdctx = EVP_MD_CTX_new(); +#else + mdctx = EVP_MD_CTX_create(); +#endif if ( !mdctx ) { rc = -1; goto done; @@ -877,7 +881,11 @@ tlso_session_pinning( LDAP *ld, tls_session *sess, char *hashalg, struct berval EVP_DigestUpdate( mdctx, key.bv_val, key.bv_len ); EVP_DigestFinal_ex( mdctx, (unsigned char *)keyhash.bv_val, &len ); keyhash.bv_len = len; +#if OPENSSL_VERSION_NUMBER >= 0x10100000 EVP_MD_CTX_free( mdctx ); +#else + EVP_MD_CTX_destroy( mdctx ); +#endif } else { keyhash = key; } -- 2.39.5