]> granicus.if.org Git - icinga2/commitdiff
Build fix for OpenSSL 1.1.0
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 27 Jun 2016 06:28:22 +0000 (08:28 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 27 Jun 2016 06:28:22 +0000 (08:28 +0200)
fixes #12044

lib/base/tlsutility.cpp

index 772b889ce8cfdd1791396ba68d2d6d648a609010..37f53b919ad7cc57d98a5c5417844518b03be403 100644 (file)
@@ -32,6 +32,7 @@ namespace icinga
 static bool l_SSLInitialized = false;
 static boost::mutex *l_Mutexes;
 
+#ifdef CRYPTO_LOCK
 static void OpenSSLLockingCallback(int mode, int type, const char *, int)
 {
        if (mode & CRYPTO_LOCK)
@@ -48,6 +49,7 @@ static unsigned long OpenSSLIDCallback(void)
        return (unsigned long)pthread_self();
 #endif /* _WIN32 */
 }
+#endif /* CRYPTO_LOCK */
 
 /**
  * Initializes the OpenSSL library.
@@ -62,9 +64,11 @@ void InitializeOpenSSL(void)
 
        SSL_COMP_get_compression_methods();
 
+#ifdef CRYPTO_LOCK
        l_Mutexes = new boost::mutex[CRYPTO_num_locks()];
        CRYPTO_set_locking_callback(&OpenSSLLockingCallback);
        CRYPTO_set_id_callback(&OpenSSLIDCallback);
+#endif /* CRYPTO_LOCK */
 
        l_SSLInitialized = true;
 }