From: Francis Dupont Date: Fri, 19 Feb 2021 22:31:32 +0000 (+0100) Subject: [#1661] Covered OpenSSL 1.0.2 X-Git-Tag: Kea-1.9.6~116 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90fef5c3d72e5abbf82961a14c7c4ae3713cbebd;p=thirdparty%2Fkea.git [#1661] Covered OpenSSL 1.0.2 --- diff --git a/m4macros/ax_boost_for_kea.m4 b/m4macros/ax_boost_for_kea.m4 index fceeeb50a7..15a4794d6c 100644 --- a/m4macros/ax_boost_for_kea.m4 +++ b/m4macros/ax_boost_for_kea.m4 @@ -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.)) diff --git a/src/lib/asiolink/openssl_tls.cc b/src/lib/asiolink/openssl_tls.cc index 407b3a7d36..33ad8c6ca9 100644 --- a/src/lib/asiolink/openssl_tls.cc +++ b/src/lib/asiolink/openssl_tls.cc @@ -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_); }