From a65b5b53b0d40c639b89a47b4a9ac713405d85c9 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Tue, 14 Nov 2017 16:00:39 +0100 Subject: Perform explicit locking only when openssl version < 1.1. --- tls.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tls.c') diff --git a/tls.c b/tls.c index 73dd6b5..111964c 100644 --- a/tls.c +++ b/tls.c @@ -188,6 +188,7 @@ init_openssl_rand_ (void) } #if defined HAVE_PTHREADS +#if OPENSSL_VERSION_NUMBER < 0x10100000 /** Array of pthread_mutex_t for OpenSSL. Allocated and initialised in \a init_locking_ and never freed. */ static pthread_mutex_t *s_openssl_mutexes = NULL; @@ -224,6 +225,7 @@ init_locking_ () return 0; } +#endif /* OPENSSL_VERSION_NUMBER < 0x10100000 */ #endif /* HAVE_PTHREADS */ /** Initialise the TLS library. Return 0 on success, -1 on failure. */ @@ -232,6 +234,7 @@ tls_init () { SSL_load_error_strings (); #if defined HAVE_PTHREADS +#if OPENSSL_VERSION_NUMBER < 0x10100000 if (CRYPTO_get_locking_callback () == NULL) { assert (s_openssl_mutexes_count == 0); @@ -242,6 +245,7 @@ tls_init () return -1; CRYPTO_set_locking_callback (openssl_locking_cb_); } +#endif /* OPENSSL_VERSION_NUMBER < 0x10100000 */ #endif /* HAVE_PTHREADS */ SSL_library_init (); return init_openssl_rand_ (); -- cgit v1.1