From: Quanah Gibson-Mount Date: Fri, 17 Nov 2017 22:30:45 +0000 (-0800) Subject: ITS#8753, ITS#8774 - Fix compilation with older versions of OpenSSL X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f5da6638ecb8ea97df53856542231df4a3befca1;p=openldap ITS#8753, ITS#8774 - Fix compilation with older versions of OpenSSL --- 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; }