]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Don't initialize and deinitialize with OpenSSL >= 1.1 7856/head
authorRosen Penev <rosenp@gmail.com>
Tue, 28 May 2019 00:41:07 +0000 (17:41 -0700)
committerRosen Penev <rosenp@gmail.com>
Tue, 28 May 2019 17:34:29 +0000 (10:34 -0700)
Will not compile without deprecated APIs enabled.

pdns/dnsdistdist/libssl.cc

index 0114743a5fc0c851bf6b7f024e22d48b563aa8dd..684a276c314b05de11411c6dd78ddba9ae16f575 100644 (file)
@@ -54,29 +54,23 @@ static void openssl_thread_cleanup()
   OPENSSL_free(openssllocks);
 }
 
-#else
-static void openssl_thread_setup()
-{
-}
-
-static void openssl_thread_cleanup()
-{
-}
-#endif /* (OPENSSL_VERSION_NUMBER < 0x1010000fL || defined LIBRESSL_VERSION_NUMBER) */
-
 static std::atomic<uint64_t> s_users;
+#endif /* (OPENSSL_VERSION_NUMBER < 0x1010000fL || defined LIBRESSL_VERSION_NUMBER) */
 
 void registerOpenSSLUser()
 {
+#if (OPENSSL_VERSION_NUMBER < 0x1010000fL || defined LIBRESSL_VERSION_NUMBER)
   if (s_users.fetch_add(1) == 0) {
     SSL_load_error_strings();
     OpenSSL_add_ssl_algorithms();
     openssl_thread_setup();
   }
+#endif
 }
 
 void unregisterOpenSSLUser()
 {
+#if (OPENSSL_VERSION_NUMBER < 0x1010000fL || defined LIBRESSL_VERSION_NUMBER)
   if (s_users.fetch_sub(1) == 1) {
     ERR_free_strings();
 
@@ -89,6 +83,7 @@ void unregisterOpenSSLUser()
     CRYPTO_cleanup_all_ex_data();
     openssl_thread_cleanup();
   }
+#endif
 }
 
 #endif /* HAVE_LIBSSL */