]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1661] Covered OpenSSL 1.0.2
authorFrancis Dupont <fdupont@isc.org>
Fri, 19 Feb 2021 22:31:32 +0000 (23:31 +0100)
committerFrancis Dupont <fdupont@isc.org>
Wed, 24 Mar 2021 08:09:02 +0000 (09:09 +0100)
m4macros/ax_boost_for_kea.m4
src/lib/asiolink/openssl_tls.cc

index fceeeb50a75038f2169422bcf8f8197767303d9d..15a4794d6c94fadc16e0dcc52581599629e8ba2d 100644 (file)
@@ -74,7 +74,7 @@ if test "${boost_include_path}" ; then
         BOOST_INCLUDES="-isystem ${boost_include_path}"
         CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES"
 fi
-AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/foreach.hpp boost/interprocess/sync/interprocess_upgradable_mutex.hpp boost/date_time/posix_time/posix_time_types.hpp boost/asio.hpp boost/asio/ip/address.hpp boost/asio/signal_set.hpp boost/system/error_code.hpp boost/atomic.hpp boost/circular_buffer.hpp boost/functional/hash.hpp],,
+AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/foreach.hpp boost/interprocess/sync/interprocess_upgradable_mutex.hpp boost/date_time/posix_time/posix_time_types.hpp boost/asio.hpp boost/asio/ip/address.hpp boost/asio/signal_set.hpp boost/system/error_code.hpp boost/atomic.hpp boost/circular_buffer.hpp boost/functional/hash.hpp boost/asio/ssl.hpp],,
   AC_MSG_ERROR([Missing required boost header files]))
 
 AC_CHECK_HEADERS(boost/asio/coroutine.hpp,,AC_MSG_RESULT(not found, using built-in header.))
index 407b3a7d3622ee87eb4ba0112eacf215d375d45f..33ad8c6ca92862cdb457000c5df2cd0cf3353234 100644 (file)
@@ -45,7 +45,12 @@ TlsContext::TlsContext(TlsRole role)
 
 boost::asio::ssl::context&
 TlsContext::getContext() {
-    ::SSL_CTX_up_ref(context_.native_handle());
+    auto ctx = context_.native_handle();
+#if defined(LIBRESSL_VERSION_NUMBER) || (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+    ::SSL_CTX_up_ref(ctx);
+#else
+    CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX);
+#endif
     return (context_);
 }