From: Howard Chu Date: Wed, 2 Jan 2019 10:16:40 +0000 (+0000) Subject: ITS#8353 CRYPTO_set_id_callback deprecated in OpenSSL 0.9.9 X-Git-Tag: OPENLDAP_REL_ENG_2_4_48~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d34830b1cf8d413641f3e3ce96cd93cc0113dc9;p=thirdparty%2Fopenldap.git ITS#8353 CRYPTO_set_id_callback deprecated in OpenSSL 0.9.9 --- diff --git a/libraries/libldap/tls_o.c b/libraries/libldap/tls_o.c index b0277dfe9b..06a39396c8 100644 --- a/libraries/libldap/tls_o.c +++ b/libraries/libldap/tls_o.c @@ -89,6 +89,13 @@ static void tlso_locking_cb( int mode, int type, const char *file, int line ) } } +#if OPENSSL_VERSION_NUMBER >= 0x0909000 +static void tlso_thread_self( CRYPTO_THREADID *id ) +{ + CRYPTO_THREADID_set_pointer( id, (void *)ldap_pvt_thread_self() ); +} +#define CRYPTO_set_id_callback(foo) CRYPTO_THREADID_set_callback(foo) +#else static unsigned long tlso_thread_self( void ) { /* FIXME: CRYPTO_set_id_callback only works when ldap_pvt_thread_t @@ -101,6 +108,7 @@ static unsigned long tlso_thread_self( void ) return (unsigned long) ldap_pvt_thread_self(); } +#endif static void tlso_thr_init( void ) {