diff options
Diffstat (limited to 'src/third_party/asio-master/asio/include/asio/ssl')
27 files changed, 200 insertions, 65 deletions
diff --git a/src/third_party/asio-master/asio/include/asio/ssl/context.hpp b/src/third_party/asio-master/asio/include/asio/ssl/context.hpp index e1b19d18f57..1af04990ea1 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/context.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/context.hpp @@ -2,7 +2,7 @@ // ssl/context.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/context_base.hpp b/src/third_party/asio-master/asio/include/asio/ssl/context_base.hpp index b3af107d513..1fea9799c2f 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/context_base.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/context_base.hpp @@ -2,7 +2,7 @@ // ssl/context_base.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -83,7 +83,16 @@ public: tlsv12_client, /// TLS version 1.2 server. - tlsv12_server + tlsv12_server, + + /// Generic TLS. + tls, + + /// TLS client. + tls_client, + + /// TLS server. + tls_server }; /// Bitmask type for SSL options. diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/buffered_handshake_op.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/buffered_handshake_op.hpp index e661bdef392..ceb22e86e87 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/buffered_handshake_op.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/buffered_handshake_op.hpp @@ -2,7 +2,7 @@ // ssl/detail/buffered_handshake_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/engine.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/engine.hpp index c9ea33b1bb9..061a50dd2ac 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/engine.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/engine.hpp @@ -2,7 +2,7 @@ // ssl/detail/engine.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/handshake_op.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/handshake_op.hpp index b6848ea62e5..23824d88ba4 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/handshake_op.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/handshake_op.hpp @@ -2,7 +2,7 @@ // ssl/detail/handshake_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/impl/engine.ipp b/src/third_party/asio-master/asio/include/asio/ssl/detail/impl/engine.ipp index 55661492952..345461b13e0 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/impl/engine.ipp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/impl/engine.ipp @@ -2,7 +2,7 @@ // ssl/detail/impl/engine.ipp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/impl/openssl_init.ipp b/src/third_party/asio-master/asio/include/asio/ssl/detail/impl/openssl_init.ipp index 5de0caa6586..75aefec02fe 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/impl/openssl_init.ipp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/impl/openssl_init.ipp @@ -3,7 +3,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/io.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/io.hpp index 5d35ba45707..553f1fff9ab 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/io.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/io.hpp @@ -2,7 +2,7 @@ // ssl/detail/io.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/openssl_init.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/openssl_init.hpp index 6144534c989..623ee49a3e2 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/openssl_init.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/openssl_init.hpp @@ -2,7 +2,7 @@ // ssl/detail/openssl_init.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/openssl_types.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/openssl_types.hpp index 981fcb19fab..a5ef5bb84d8 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/openssl_types.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/openssl_types.hpp @@ -2,7 +2,7 @@ // ssl/detail/openssl_types.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/password_callback.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/password_callback.hpp index abff36c6f33..d43d7eeaff0 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/password_callback.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/password_callback.hpp @@ -2,7 +2,7 @@ // ssl/detail/password_callback.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/read_op.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/read_op.hpp index 2195bc892eb..bbb8505260f 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/read_op.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/read_op.hpp @@ -2,7 +2,7 @@ // ssl/detail/read_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/shutdown_op.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/shutdown_op.hpp index 974eaa0a423..fa06ede14c1 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/shutdown_op.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/shutdown_op.hpp @@ -2,7 +2,7 @@ // ssl/detail/shutdown_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/stream_core.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/stream_core.hpp index 1872912c018..86cbfc06656 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/stream_core.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/stream_core.hpp @@ -2,7 +2,7 @@ // ssl/detail/stream_core.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/verify_callback.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/verify_callback.hpp index 288ff66db48..9314aae195b 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/verify_callback.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/verify_callback.hpp @@ -2,7 +2,7 @@ // ssl/detail/verify_callback.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/detail/write_op.hpp b/src/third_party/asio-master/asio/include/asio/ssl/detail/write_op.hpp index d40719e0fa5..7f6f928a9a5 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/detail/write_op.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/detail/write_op.hpp @@ -2,7 +2,7 @@ // ssl/detail/write_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/error.hpp b/src/third_party/asio-master/asio/include/asio/ssl/error.hpp index 727b5ca17ae..6a0d2213e14 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/error.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/error.hpp @@ -2,7 +2,7 @@ // ssl/error.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/impl/context.hpp b/src/third_party/asio-master/asio/include/asio/ssl/impl/context.hpp index 2b5a1616bf9..95808e0f89b 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/impl/context.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/impl/context.hpp @@ -3,7 +3,7 @@ // ~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/impl/context.ipp b/src/third_party/asio-master/asio/include/asio/ssl/impl/context.ipp index e80dc813d6a..45e203fb5d5 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/impl/context.ipp +++ b/src/third_party/asio-master/asio/include/asio/ssl/impl/context.ipp @@ -3,7 +3,7 @@ // ~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -66,16 +66,15 @@ context::context(context::method m) switch (m) { -#if defined(OPENSSL_NO_SSL2) \ - || (OPENSSL_VERSION_NUMBER >= 0x10100000L) + // SSL v2. +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) || defined(OPENSSL_NO_SSL2) case context::sslv2: case context::sslv2_client: case context::sslv2_server: asio::detail::throw_error( asio::error::invalid_argument, "context"); break; -#else // defined(OPENSSL_NO_SSL2) - // || (OPENSSL_VERSION_NUMBER >= 0x10100000L) +#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) || defined(OPENSSL_NO_SSL2) case context::sslv2: handle_ = ::SSL_CTX_new(::SSLv2_method()); break; @@ -85,9 +84,35 @@ context::context(context::method m) case context::sslv2_server: handle_ = ::SSL_CTX_new(::SSLv2_server_method()); break; -#endif // defined(OPENSSL_NO_SSL2) - // || (OPENSSL_VERSION_NUMBER >= 0x10100000L) -#if defined(OPENSSL_NO_SSL3) +#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L) || defined(OPENSSL_NO_SSL2) + + // SSL v3. +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) + case context::sslv3: + handle_ = ::SSL_CTX_new(::TLS_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, SSL3_VERSION); + SSL_CTX_set_max_proto_version(handle_, SSL3_VERSION); + } + break; + case context::sslv3_client: + handle_ = ::SSL_CTX_new(::TLS_client_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, SSL3_VERSION); + SSL_CTX_set_max_proto_version(handle_, SSL3_VERSION); + } + break; + case context::sslv3_server: + handle_ = ::SSL_CTX_new(::TLS_server_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, SSL3_VERSION); + SSL_CTX_set_max_proto_version(handle_, SSL3_VERSION); + } + break; +#elif defined(OPENSSL_NO_SSL3) case context::sslv3: case context::sslv3_client: case context::sslv3_server: @@ -105,7 +130,34 @@ context::context(context::method m) handle_ = ::SSL_CTX_new(::SSLv3_server_method()); break; #endif // defined(OPENSSL_NO_SSL3) -#if (OPENSSL_VERSION_NUMBER < 0x10100000L) + + // TLS v1.0. +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) + case context::tlsv1: + handle_ = ::SSL_CTX_new(::TLS_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, TLS1_VERSION); + SSL_CTX_set_max_proto_version(handle_, TLS1_VERSION); + } + break; + case context::tlsv1_client: + handle_ = ::SSL_CTX_new(::TLS_client_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, TLS1_VERSION); + SSL_CTX_set_max_proto_version(handle_, TLS1_VERSION); + } + break; + case context::tlsv1_server: + handle_ = ::SSL_CTX_new(::TLS_server_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, TLS1_VERSION); + SSL_CTX_set_max_proto_version(handle_, TLS1_VERSION); + } + break; +#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) case context::tlsv1: handle_ = ::SSL_CTX_new(::TLSv1_method()); break; @@ -115,18 +167,35 @@ context::context(context::method m) case context::tlsv1_server: handle_ = ::SSL_CTX_new(::TLSv1_server_method()); break; -#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L) - case context::sslv23: - handle_ = ::SSL_CTX_new(::SSLv23_method()); +#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + + // TLS v1.1. +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) + case context::tlsv11: + handle_ = ::SSL_CTX_new(::TLS_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, TLS1_1_VERSION); + SSL_CTX_set_max_proto_version(handle_, TLS1_1_VERSION); + } break; - case context::sslv23_client: - handle_ = ::SSL_CTX_new(::SSLv23_client_method()); + case context::tlsv11_client: + handle_ = ::SSL_CTX_new(::TLS_client_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, TLS1_1_VERSION); + SSL_CTX_set_max_proto_version(handle_, TLS1_1_VERSION); + } break; - case context::sslv23_server: - handle_ = ::SSL_CTX_new(::SSLv23_server_method()); + case context::tlsv11_server: + handle_ = ::SSL_CTX_new(::TLS_server_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, TLS1_1_VERSION); + SSL_CTX_set_max_proto_version(handle_, TLS1_1_VERSION); + } break; -#if (OPENSSL_VERSION_NUMBER < 0x10100000L) -#if defined(SSL_TXT_TLSV1_1) +#elif defined(SSL_TXT_TLSV1_1) case context::tlsv11: handle_ = ::SSL_CTX_new(::TLSv1_1_method()); break; @@ -144,7 +213,34 @@ context::context(context::method m) asio::error::invalid_argument, "context"); break; #endif // defined(SSL_TXT_TLSV1_1) -#if defined(SSL_TXT_TLSV1_2) + + // TLS v1.2. +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) + case context::tlsv12: + handle_ = ::SSL_CTX_new(::TLS_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, TLS1_2_VERSION); + SSL_CTX_set_max_proto_version(handle_, TLS1_2_VERSION); + } + break; + case context::tlsv12_client: + handle_ = ::SSL_CTX_new(::TLS_client_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, TLS1_2_VERSION); + SSL_CTX_set_max_proto_version(handle_, TLS1_2_VERSION); + } + break; + case context::tlsv12_server: + handle_ = ::SSL_CTX_new(::TLS_server_method()); + if (handle_) + { + SSL_CTX_set_min_proto_version(handle_, TLS1_2_VERSION); + SSL_CTX_set_max_proto_version(handle_, TLS1_2_VERSION); + } + break; +#elif defined(SSL_TXT_TLSV1_1) case context::tlsv12: handle_ = ::SSL_CTX_new(::TLSv1_2_method()); break; @@ -154,31 +250,61 @@ context::context(context::method m) case context::tlsv12_server: handle_ = ::SSL_CTX_new(::TLSv1_2_server_method()); break; -#else // defined(SSL_TXT_TLSV1_2) +#else // defined(SSL_TXT_TLSV1_1) case context::tlsv12: case context::tlsv12_client: case context::tlsv12_server: asio::detail::throw_error( asio::error::invalid_argument, "context"); break; -#endif // defined(SSL_TXT_TLSV1_2) -#else // (OPENSSL_VERSION_NUMBER < 0x10100000L) - case context::tlsv1: - case context::tlsv11: - case context::tlsv12: +#endif // defined(SSL_TXT_TLSV1_1) + + // Any supported SSL/TLS version. + case context::sslv23: + handle_ = ::SSL_CTX_new(::SSLv23_method()); + break; + case context::sslv23_client: + handle_ = ::SSL_CTX_new(::SSLv23_client_method()); + break; + case context::sslv23_server: + handle_ = ::SSL_CTX_new(::SSLv23_server_method()); + break; + + // Any supported TLS version. +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) + case context::tls: handle_ = ::SSL_CTX_new(::TLS_method()); + if (handle_) + SSL_CTX_set_min_proto_version(handle_, TLS1_VERSION); break; - case context::tlsv1_client: - case context::tlsv11_client: - case context::tlsv12_client: + case context::tls_client: handle_ = ::SSL_CTX_new(::TLS_client_method()); + if (handle_) + SSL_CTX_set_min_proto_version(handle_, TLS1_VERSION); break; - case context::tlsv1_server: - case context::tlsv11_server: - case context::tlsv12_server: + case context::tls_server: handle_ = ::SSL_CTX_new(::TLS_server_method()); + if (handle_) + SSL_CTX_set_min_proto_version(handle_, TLS1_VERSION); + break; +#else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + case context::tls: + handle_ = ::SSL_CTX_new(::SSLv23_method()); + if (handle_) + SSL_CTX_set_options(handle_, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); break; -#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L) + case context::tls_client: + handle_ = ::SSL_CTX_new(::SSLv23_client_method()); + if (handle_) + SSL_CTX_set_options(handle_, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); + break; + case context::tls_server: + handle_ = ::SSL_CTX_new(::SSLv23_server_method()); + if (handle_) + SSL_CTX_set_options(handle_, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); + break; +#endif // (OPENSSL_VERSION_NUMBER >= 0x10100000L) + default: handle_ = ::SSL_CTX_new(0); break; @@ -215,7 +341,7 @@ context::~context() { if (handle_) { -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); #else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) void* cb_userdata = handle_->default_passwd_callback_userdata; @@ -226,7 +352,7 @@ context::~context() static_cast<detail::password_callback_base*>( cb_userdata); delete callback; -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) ::SSL_CTX_set_default_passwd_cb_userdata(handle_, 0); #else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) handle_->default_passwd_callback_userdata = 0; @@ -560,7 +686,7 @@ ASIO_SYNC_OP_VOID context::use_certificate_chain( bio_cleanup bio = { make_buffer_bio(chain) }; if (bio.p) { -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_); void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); #else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) @@ -664,7 +790,7 @@ ASIO_SYNC_OP_VOID context::use_private_key( { ::ERR_clear_error(); -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_); void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); #else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) @@ -731,7 +857,7 @@ ASIO_SYNC_OP_VOID context::use_rsa_private_key( { ::ERR_clear_error(); -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) pem_password_cb* callback = ::SSL_CTX_get_default_passwd_cb(handle_); void* cb_userdata = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); #else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) @@ -970,7 +1096,7 @@ int context::verify_callback_function(int preverified, X509_STORE_CTX* ctx) ASIO_SYNC_OP_VOID context::do_set_password_callback( detail::password_callback_base* callback, asio::error_code& ec) { -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) void* old_callback = ::SSL_CTX_get_default_passwd_cb_userdata(handle_); ::SSL_CTX_set_default_passwd_cb_userdata(handle_, callback); #else // (OPENSSL_VERSION_NUMBER >= 0x10100000L) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/impl/error.ipp b/src/third_party/asio-master/asio/include/asio/ssl/impl/error.ipp index 268fc9664cf..42caeb7aa4c 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/impl/error.ipp +++ b/src/third_party/asio-master/asio/include/asio/ssl/impl/error.ipp @@ -2,7 +2,7 @@ // ssl/impl/error.ipp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/impl/rfc2818_verification.ipp b/src/third_party/asio-master/asio/include/asio/ssl/impl/rfc2818_verification.ipp index f84b02573ae..11eb36d960f 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/impl/rfc2818_verification.ipp +++ b/src/third_party/asio-master/asio/include/asio/ssl/impl/rfc2818_verification.ipp @@ -2,7 +2,7 @@ // ssl/impl/rfc2818_verification.ipp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/impl/src.hpp b/src/third_party/asio-master/asio/include/asio/ssl/impl/src.hpp index e6e269f9998..39c85e34b2b 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/impl/src.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/impl/src.hpp @@ -2,7 +2,7 @@ // impl/ssl/src.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/rfc2818_verification.hpp b/src/third_party/asio-master/asio/include/asio/ssl/rfc2818_verification.hpp index a4ab67b2aee..4489c835fc0 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/rfc2818_verification.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/rfc2818_verification.hpp @@ -2,7 +2,7 @@ // ssl/rfc2818_verification.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/stream.hpp b/src/third_party/asio-master/asio/include/asio/ssl/stream.hpp index bc259b59ca7..0dbffe2777b 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/stream.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/stream.hpp @@ -2,7 +2,7 @@ // ssl/stream.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/stream_base.hpp b/src/third_party/asio-master/asio/include/asio/ssl/stream_base.hpp index 275d3e3821e..ca95c761d47 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/stream_base.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/stream_base.hpp @@ -2,7 +2,7 @@ // ssl/stream_base.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/verify_context.hpp b/src/third_party/asio-master/asio/include/asio/ssl/verify_context.hpp index 560ffcc7ad8..34f93531f9a 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/verify_context.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/verify_context.hpp @@ -2,7 +2,7 @@ // ssl/verify_context.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/src/third_party/asio-master/asio/include/asio/ssl/verify_mode.hpp b/src/third_party/asio-master/asio/include/asio/ssl/verify_mode.hpp index 7a2bd5654c7..6c444cc89da 100644 --- a/src/third_party/asio-master/asio/include/asio/ssl/verify_mode.hpp +++ b/src/third_party/asio-master/asio/include/asio/ssl/verify_mode.hpp @@ -2,7 +2,7 @@ // ssl/verify_mode.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |