From 6d2db4783e51a170308f5644b95ccd0e300d9d4b Mon Sep 17 00:00:00 2001 From: Marco Serantoni Date: Tue, 31 Dec 2013 11:48:16 +0100 Subject: [PATCH] [MacOSX] Manage older OpenSSL API (needed for OSX 10.6) and probably older linuxes --- patches/boost_macosx_older_openssl.patch | 55 ++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 patches/boost_macosx_older_openssl.patch diff --git a/patches/boost_macosx_older_openssl.patch b/patches/boost_macosx_older_openssl.patch new file mode 100644 index 0000000000..29f2ca80d0 --- /dev/null +++ b/patches/boost_macosx_older_openssl.patch @@ -0,0 +1,55 @@ +=== modified file 'boost/asio/ssl/impl/context.ipp' +--- boost/asio/ssl/impl/context.ipp 2013-12-30 14:53:15 +0000 ++++ boost/asio/ssl/impl/context.ipp 2013-12-30 19:08:01 +0000 +@@ -236,19 +236,27 @@ + boost::system::error_code context::clear_options( + context::options o, boost::system::error_code& ec) + { +-#if !defined(SSL_OP_NO_COMPRESSION) ++#if (OPENSSL_VERSION_NUMBER >= 0x009080DFL) \ ++ && (OPENSSL_VERSION_NUMBER != 0x00909000L) ++# if !defined(SSL_OP_NO_COMPRESSION) + if ((o & context::no_compression) != 0) + { +-#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) ++# if (OPENSSL_VERSION_NUMBER >= 0x00908000L) + handle_->comp_methods = SSL_COMP_get_compression_methods(); +-#endif // (OPENSSL_VERSION_NUMBER >= 0x00908000L) ++# endif // (OPENSSL_VERSION_NUMBER >= 0x00908000L) + o ^= context::no_compression; + } +-#endif // !defined(SSL_OP_NO_COMPRESSION) ++# endif // !defined(SSL_OP_NO_COMPRESSION) + + ::SSL_CTX_clear_options(handle_, o); + + ec = boost::system::error_code(); ++#else // (OPENSSL_VERSION_NUMBER >= 0x009080DFL) ++ // && (OPENSSL_VERSION_NUMBER != 0x00909000L) ++ (void)o; ++ ec = boost::asio::error::operation_not_supported; ++#endif // (OPENSSL_VERSION_NUMBER >= 0x009080DFL) ++ // && (OPENSSL_VERSION_NUMBER != 0x00909000L) + return ec; + } + +@@ -428,7 +436,8 @@ + + if (format == context_base::asn1) + { +- if (::SSL_CTX_use_certificate_ASN1(handle_, buffer_size(certificate), ++ if (::SSL_CTX_use_certificate_ASN1(handle_, ++ static_cast(buffer_size(certificate)), + buffer_cast(certificate)) == 1) + { + ec = boost::system::error_code(); +@@ -929,7 +938,7 @@ + { + return ::BIO_new_mem_buf( + const_cast(buffer_cast(b)), +- buffer_size(b)); ++ static_cast(buffer_size(b))); + } + + #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL) +