summaryrefslogtreecommitdiff
path: root/tls.c
diff options
context:
space:
mode:
authorSam Hartman <hartmans@debian.org>2019-01-02 06:59:30 -0500
committerSam Hartman <hartmans@debian.org>2019-01-02 06:59:30 -0500
commitbba888d55909ebeb949200e6a712cf2a093b1963 (patch)
treed83d4827f7dfbeb631e7467fe3b4ccf213bf1eee /tls.c
parent31ebe52a3f39db9f3e78e551d6122c6ace22f105 (diff)
Remove assertion
OpenSSL has removed the crypto locking primitives, so CRYPTO_get_locking_function always returns NULL. To support older and newer OpenSSL, continue to set a locking function, but don't assert if we have already initialized and the locking function returns null.
Diffstat (limited to 'tls.c')
-rw-r--r--tls.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tls.c b/tls.c
index 7b33d8e..366286f 100644
--- a/tls.c
+++ b/tls.c
@@ -232,9 +232,13 @@ tls_init ()
{
SSL_load_error_strings ();
#if defined HAVE_PTHREADS
- if (CRYPTO_get_locking_callback () == NULL)
+ /* OpenSSL 1.1 removed the locking functions and finally implemented
+ * its own thread safety. In this case the locking callback will
+ * return null even after we initialize it. So if we have already
+ * allocated mutexes, don't consider that a failure.
+ */
+ if ((CRYPTO_get_locking_callback () == NULL) || (s_openssl_mutexes_count > 0))
{
- assert (s_openssl_mutexes_count == 0);
/* Allocate and initialise mutexes. We will never free
these. FIXME: Is there a portable way of having a function
invoked when a solib is unloaded? -ln */