[pkg-boost-devel] Bug#621402: A real fix

Luboš Doležel lubos at dolezel.info
Mon May 9 17:57:35 UTC 2011


Hello guys,

the following patch should provide a real solution to the problem.

--- /usr/include/boost/asio/ssl/detail/openssl_context_service.hpp.bak 
2011-05-09 19:42:21.000000000 +0200
+++ /usr/include/boost/asio/ssl/detail/openssl_context_service.hpp 
2011-05-09 19:53:01.000000000 +0200
@@ -19,6 +19,7 @@
  #include <boost/asio/detail/config.hpp>
  #include <cstring>
  #include <string>
+#include <stdexcept>
  #include <boost/function.hpp>
  #include <boost/asio/error.hpp>
  #include <boost/asio/io_service.hpp>
@@ -67,6 +68,7 @@
    {
      switch (m)
      {
+#if !defined(OPENSSL_NO_SSL2)
      case context_base::sslv2:
        impl = ::SSL_CTX_new(::SSLv2_method());
        break;
@@ -76,6 +78,14 @@
      case context_base::sslv2_server:
        impl = ::SSL_CTX_new(::SSLv2_server_method());
        break;
+#else
+    case context_base::sslv2:
+    case context_base::sslv2_client:
+    case context_base::sslv2_server:
+      boost::throw_exception(std::runtime_error("SSLv2 is not supported 
in your OpenSSL"));
+      impl = ::SSL_CTX_new(0); // if exceptions are disabled
+      break;
+#endif
      case context_base::sslv3:
        impl = ::SSL_CTX_new(::SSLv3_method());
        break;

-- 
Luboš Doležel





More information about the pkg-boost-devel mailing list