boost_macosx_older_openssl.patch 1.83 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 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<int>(buffer_size(certificate)),
           buffer_cast<const unsigned char*>(certificate)) == 1)
     {
       ec = boost::system::error_code();
@@ -929,7 +938,7 @@
 {
   return ::BIO_new_mem_buf(
       const_cast<void*>(buffer_cast<const void*>(b)),
-      buffer_size(b));
+      static_cast<int>(buffer_size(b)));
 }
 
 #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)