From 733b5d5ae2c5d625211e2985ac25728ac3f54883 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 21 Mar 2016 15:45:20 +0900 Subject: Imported Upstream version 1.58.0 Change-Id: If0072143aa26874812e0db6872e1efb10a3e5e94 Signed-off-by: DongHun Kwak --- boost/asio/ssl/basic_context.hpp | 2 +- boost/asio/ssl/context.hpp | 2 +- boost/asio/ssl/context_base.hpp | 18 ++++++++++++- boost/asio/ssl/context_service.hpp | 2 +- boost/asio/ssl/detail/buffered_handshake_op.hpp | 2 +- boost/asio/ssl/detail/engine.hpp | 2 +- boost/asio/ssl/detail/handshake_op.hpp | 2 +- boost/asio/ssl/detail/impl/engine.ipp | 5 ++-- boost/asio/ssl/detail/impl/openssl_init.ipp | 6 ++++- boost/asio/ssl/detail/io.hpp | 6 +++-- boost/asio/ssl/detail/openssl_init.hpp | 2 +- boost/asio/ssl/detail/openssl_types.hpp | 2 +- boost/asio/ssl/detail/password_callback.hpp | 2 +- boost/asio/ssl/detail/read_op.hpp | 2 +- boost/asio/ssl/detail/shutdown_op.hpp | 2 +- boost/asio/ssl/detail/stream_core.hpp | 2 +- boost/asio/ssl/detail/verify_callback.hpp | 2 +- boost/asio/ssl/detail/write_op.hpp | 2 +- boost/asio/ssl/error.hpp | 2 +- boost/asio/ssl/impl/context.hpp | 2 +- boost/asio/ssl/impl/context.ipp | 30 +++++++++++++++++++--- boost/asio/ssl/impl/error.ipp | 2 +- boost/asio/ssl/impl/rfc2818_verification.ipp | 2 +- boost/asio/ssl/impl/src.hpp | 2 +- boost/asio/ssl/old/basic_context.hpp | 2 +- boost/asio/ssl/old/context_service.hpp | 2 +- .../ssl/old/detail/openssl_context_service.hpp | 2 +- .../asio/ssl/old/detail/openssl_stream_service.hpp | 2 +- boost/asio/ssl/old/stream.hpp | 2 +- boost/asio/ssl/old/stream_service.hpp | 2 +- boost/asio/ssl/rfc2818_verification.hpp | 2 +- boost/asio/ssl/stream.hpp | 2 +- boost/asio/ssl/stream_base.hpp | 2 +- boost/asio/ssl/stream_service.hpp | 2 +- boost/asio/ssl/verify_context.hpp | 2 +- boost/asio/ssl/verify_mode.hpp | 2 +- 36 files changed, 87 insertions(+), 40 deletions(-) (limited to 'boost/asio/ssl') diff --git a/boost/asio/ssl/basic_context.hpp b/boost/asio/ssl/basic_context.hpp index e51d39bc85..6b6b1b353c 100644 --- a/boost/asio/ssl/basic_context.hpp +++ b/boost/asio/ssl/basic_context.hpp @@ -2,7 +2,7 @@ // ssl/basic_context.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/context.hpp b/boost/asio/ssl/context.hpp index e9d4db65d7..2e5b282724 100644 --- a/boost/asio/ssl/context.hpp +++ b/boost/asio/ssl/context.hpp @@ -2,7 +2,7 @@ // ssl/context.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/context_base.hpp b/boost/asio/ssl/context_base.hpp index 692372d4ba..8bf128db66 100644 --- a/boost/asio/ssl/context_base.hpp +++ b/boost/asio/ssl/context_base.hpp @@ -2,7 +2,7 @@ // ssl/context_base.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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) @@ -106,6 +106,12 @@ public: /// Disable TLS v1. static const long no_tlsv1 = implementation_defined; + /// Disable TLS v1.1. + static const long no_tlsv1_1 = implementation_defined; + + /// Disable TLS v1.2. + static const long no_tlsv1_2 = implementation_defined; + /// Disable compression. Compression is disabled by default. static const long no_compression = implementation_defined; #else @@ -114,6 +120,16 @@ public: BOOST_ASIO_STATIC_CONSTANT(long, no_sslv2 = SSL_OP_NO_SSLv2); BOOST_ASIO_STATIC_CONSTANT(long, no_sslv3 = SSL_OP_NO_SSLv3); BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1 = SSL_OP_NO_TLSv1); +# if defined(SSL_OP_NO_TLSv1_1) + BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1_1 = SSL_OP_NO_TLSv1_1); +# else // defined(SSL_OP_NO_TLSv1_1) + BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1_1 = 0x10000000L); +# endif // defined(SSL_OP_NO_TLSv1_1) +# if defined(SSL_OP_NO_TLSv1_2) + BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1_2 = SSL_OP_NO_TLSv1_2); +# else // defined(SSL_OP_NO_TLSv1_2) + BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1_2 = 0x08000000L); +# endif // defined(SSL_OP_NO_TLSv1_2) # if defined(SSL_OP_NO_COMPRESSION) BOOST_ASIO_STATIC_CONSTANT(long, no_compression = SSL_OP_NO_COMPRESSION); # else // defined(SSL_OP_NO_COMPRESSION) diff --git a/boost/asio/ssl/context_service.hpp b/boost/asio/ssl/context_service.hpp index 3222dc52c7..1a1b1797ed 100644 --- a/boost/asio/ssl/context_service.hpp +++ b/boost/asio/ssl/context_service.hpp @@ -2,7 +2,7 @@ // ssl/context_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/detail/buffered_handshake_op.hpp b/boost/asio/ssl/detail/buffered_handshake_op.hpp index 10608b0eb9..74f12f41a8 100644 --- a/boost/asio/ssl/detail/buffered_handshake_op.hpp +++ b/boost/asio/ssl/detail/buffered_handshake_op.hpp @@ -2,7 +2,7 @@ // ssl/detail/buffered_handshake_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/detail/engine.hpp b/boost/asio/ssl/detail/engine.hpp index 8b24a96f01..b84c22c2fd 100644 --- a/boost/asio/ssl/detail/engine.hpp +++ b/boost/asio/ssl/detail/engine.hpp @@ -2,7 +2,7 @@ // ssl/detail/engine.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/detail/handshake_op.hpp b/boost/asio/ssl/detail/handshake_op.hpp index b886bb52f6..d8be283a0d 100644 --- a/boost/asio/ssl/detail/handshake_op.hpp +++ b/boost/asio/ssl/detail/handshake_op.hpp @@ -2,7 +2,7 @@ // ssl/detail/handshake_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/detail/impl/engine.ipp b/boost/asio/ssl/detail/impl/engine.ipp index 5aa9b5a68a..3fcfd70d8e 100644 --- a/boost/asio/ssl/detail/impl/engine.ipp +++ b/boost/asio/ssl/detail/impl/engine.ipp @@ -2,7 +2,7 @@ // ssl/detail/impl/engine.ipp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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) @@ -211,7 +211,7 @@ const boost::system::error_code& engine::map_error_code( // SSL v2 doesn't provide a protocol-level shutdown, so an eof on the // underlying transport is passed through. - if (ssl_ && ssl_->version == SSL2_VERSION) + if (ssl_->version == SSL2_VERSION) return ec; // Otherwise, the peer should have negotiated a proper shutdown. @@ -236,6 +236,7 @@ engine::want engine::perform(int (engine::* op)(void*, std::size_t), std::size_t* bytes_transferred) { std::size_t pending_output_before = ::BIO_ctrl_pending(ext_bio_); + ::ERR_clear_error(); int result = (this->*op)(data, length); int ssl_error = ::SSL_get_error(ssl_, result); int sys_error = static_cast(::ERR_get_error()); diff --git a/boost/asio/ssl/detail/impl/openssl_init.ipp b/boost/asio/ssl/detail/impl/openssl_init.ipp index d732fef309..8326c84144 100644 --- a/boost/asio/ssl/detail/impl/openssl_init.ipp +++ b/boost/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-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2015 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) @@ -64,7 +64,11 @@ public: ::CRYPTO_set_id_callback(0); ::CRYPTO_set_locking_callback(0); ::ERR_free_strings(); +#if (OPENSSL_VERSION_NUMBER >= 0x10000000L) + ::ERR_remove_thread_state(NULL); +#else // (OPENSSL_VERSION_NUMBER >= 0x10000000L) ::ERR_remove_state(0); +#endif // (OPENSSL_VERSION_NUMBER >= 0x10000000L) ::EVP_cleanup(); ::CRYPTO_cleanup_all_ex_data(); ::CONF_modules_unload(1); diff --git a/boost/asio/ssl/detail/io.hpp b/boost/asio/ssl/detail/io.hpp index ef821000ba..2e889ec8b0 100644 --- a/boost/asio/ssl/detail/io.hpp +++ b/boost/asio/ssl/detail/io.hpp @@ -2,7 +2,7 @@ // ssl/detail/io.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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) @@ -225,7 +225,9 @@ public: } default: - if (bytes_transferred != ~std::size_t(0) && !ec_) + if (bytes_transferred == ~std::size_t(0)) + bytes_transferred = 0; // Timer cancellation, no data transferred. + else if (!ec_) ec_ = ec; switch (want_) diff --git a/boost/asio/ssl/detail/openssl_init.hpp b/boost/asio/ssl/detail/openssl_init.hpp index 985c14d9c5..221709aa03 100644 --- a/boost/asio/ssl/detail/openssl_init.hpp +++ b/boost/asio/ssl/detail/openssl_init.hpp @@ -2,7 +2,7 @@ // ssl/detail/openssl_init.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/detail/openssl_types.hpp b/boost/asio/ssl/detail/openssl_types.hpp index 58b4733db6..c83d110b2a 100644 --- a/boost/asio/ssl/detail/openssl_types.hpp +++ b/boost/asio/ssl/detail/openssl_types.hpp @@ -2,7 +2,7 @@ // ssl/detail/openssl_types.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/detail/password_callback.hpp b/boost/asio/ssl/detail/password_callback.hpp index d64bf3a5be..1ba89900bd 100644 --- a/boost/asio/ssl/detail/password_callback.hpp +++ b/boost/asio/ssl/detail/password_callback.hpp @@ -2,7 +2,7 @@ // ssl/detail/password_callback.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/detail/read_op.hpp b/boost/asio/ssl/detail/read_op.hpp index e0a0ad0ee8..df50540e63 100644 --- a/boost/asio/ssl/detail/read_op.hpp +++ b/boost/asio/ssl/detail/read_op.hpp @@ -2,7 +2,7 @@ // ssl/detail/read_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/detail/shutdown_op.hpp b/boost/asio/ssl/detail/shutdown_op.hpp index 6a716f7090..1a206c1643 100644 --- a/boost/asio/ssl/detail/shutdown_op.hpp +++ b/boost/asio/ssl/detail/shutdown_op.hpp @@ -2,7 +2,7 @@ // ssl/detail/shutdown_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/detail/stream_core.hpp b/boost/asio/ssl/detail/stream_core.hpp index 663e258c03..2ef4110fc7 100644 --- a/boost/asio/ssl/detail/stream_core.hpp +++ b/boost/asio/ssl/detail/stream_core.hpp @@ -2,7 +2,7 @@ // ssl/detail/stream_core.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/detail/verify_callback.hpp b/boost/asio/ssl/detail/verify_callback.hpp index eb40f488f4..5ddc89a9e1 100644 --- a/boost/asio/ssl/detail/verify_callback.hpp +++ b/boost/asio/ssl/detail/verify_callback.hpp @@ -2,7 +2,7 @@ // ssl/detail/verify_callback.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/detail/write_op.hpp b/boost/asio/ssl/detail/write_op.hpp index 24020983df..d7b49c936b 100644 --- a/boost/asio/ssl/detail/write_op.hpp +++ b/boost/asio/ssl/detail/write_op.hpp @@ -2,7 +2,7 @@ // ssl/detail/write_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/error.hpp b/boost/asio/ssl/error.hpp index a308fd2626..eb95e8c140 100644 --- a/boost/asio/ssl/error.hpp +++ b/boost/asio/ssl/error.hpp @@ -2,7 +2,7 @@ // ssl/error.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/impl/context.hpp b/boost/asio/ssl/impl/context.hpp index 345bc5b2ca..c4a751e8ff 100644 --- a/boost/asio/ssl/impl/context.hpp +++ b/boost/asio/ssl/impl/context.hpp @@ -3,7 +3,7 @@ // ~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2015 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/boost/asio/ssl/impl/context.ipp b/boost/asio/ssl/impl/context.ipp index 06c2743fdb..67191ade20 100644 --- a/boost/asio/ssl/impl/context.ipp +++ b/boost/asio/ssl/impl/context.ipp @@ -3,7 +3,7 @@ // ~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2015 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) @@ -67,6 +67,8 @@ struct context::dh_cleanup context::context(context::method m) : handle_(0) { + ::ERR_clear_error(); + switch (m) { #if defined(OPENSSL_NO_SSL2) @@ -329,6 +331,8 @@ void context::load_verify_file(const std::string& filename) boost::system::error_code context::load_verify_file( const std::string& filename, boost::system::error_code& ec) { + ::ERR_clear_error(); + if (::SSL_CTX_load_verify_locations(handle_, filename.c_str(), 0) != 1) { ec = boost::system::error_code( @@ -386,6 +390,8 @@ void context::set_default_verify_paths() boost::system::error_code context::set_default_verify_paths( boost::system::error_code& ec) { + ::ERR_clear_error(); + if (::SSL_CTX_set_default_verify_paths(handle_) != 1) { ec = boost::system::error_code( @@ -408,6 +414,8 @@ void context::add_verify_path(const std::string& path) boost::system::error_code context::add_verify_path( const std::string& path, boost::system::error_code& ec) { + ::ERR_clear_error(); + if (::SSL_CTX_load_verify_locations(handle_, 0, path.c_str()) != 1) { ec = boost::system::error_code( @@ -500,6 +508,8 @@ boost::system::error_code context::use_certificate_file( } } + ::ERR_clear_error(); + if (::SSL_CTX_use_certificate_file(handle_, filename.c_str(), file_type) != 1) { ec = boost::system::error_code( @@ -592,6 +602,8 @@ void context::use_certificate_chain_file(const std::string& filename) boost::system::error_code context::use_certificate_chain_file( const std::string& filename, boost::system::error_code& ec) { + ::ERR_clear_error(); + if (::SSL_CTX_use_certificate_chain_file(handle_, filename.c_str()) != 1) { ec = boost::system::error_code( @@ -628,7 +640,9 @@ boost::system::error_code context::use_private_key( evp_private_key.p = ::d2i_PrivateKey_bio(bio.p, 0); break; case context_base::pem: - evp_private_key.p = ::PEM_read_bio_PrivateKey(bio.p, 0, 0, 0); + evp_private_key.p = ::PEM_read_bio_PrivateKey( + bio.p, 0, handle_->default_passwd_callback, + handle_->default_passwd_callback_userdata); break; default: { @@ -685,7 +699,9 @@ boost::system::error_code context::use_rsa_private_key( rsa_private_key.p = ::d2i_RSAPrivateKey_bio(bio.p, 0); break; case context_base::pem: - rsa_private_key.p = ::PEM_read_bio_RSAPrivateKey(bio.p, 0, 0, 0); + rsa_private_key.p = ::PEM_read_bio_RSAPrivateKey( + bio.p, 0, handle_->default_passwd_callback, + handle_->default_passwd_callback_userdata); break; default: { @@ -730,6 +746,8 @@ boost::system::error_code context::use_private_key_file( } } + ::ERR_clear_error(); + if (::SSL_CTX_use_PrivateKey_file(handle_, filename.c_str(), file_type) != 1) { ec = boost::system::error_code( @@ -770,6 +788,8 @@ boost::system::error_code context::use_rsa_private_key_file( } } + ::ERR_clear_error(); + if (::SSL_CTX_use_RSAPrivateKey_file( handle_, filename.c_str(), file_type) != 1) { @@ -793,6 +813,8 @@ void context::use_tmp_dh(const const_buffer& dh) boost::system::error_code context::use_tmp_dh( const const_buffer& dh, boost::system::error_code& ec) { + ::ERR_clear_error(); + bio_cleanup bio = { make_buffer_bio(dh) }; if (bio.p) { @@ -815,6 +837,8 @@ void context::use_tmp_dh_file(const std::string& filename) boost::system::error_code context::use_tmp_dh_file( const std::string& filename, boost::system::error_code& ec) { + ::ERR_clear_error(); + bio_cleanup bio = { ::BIO_new_file(filename.c_str(), "r") }; if (bio.p) { diff --git a/boost/asio/ssl/impl/error.ipp b/boost/asio/ssl/impl/error.ipp index bacfc7bbf1..503b7481ff 100644 --- a/boost/asio/ssl/impl/error.ipp +++ b/boost/asio/ssl/impl/error.ipp @@ -2,7 +2,7 @@ // ssl/impl/error.ipp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/impl/rfc2818_verification.ipp b/boost/asio/ssl/impl/rfc2818_verification.ipp index e4f28ef946..b6784435be 100644 --- a/boost/asio/ssl/impl/rfc2818_verification.ipp +++ b/boost/asio/ssl/impl/rfc2818_verification.ipp @@ -2,7 +2,7 @@ // ssl/impl/rfc2818_verification.ipp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/impl/src.hpp b/boost/asio/ssl/impl/src.hpp index bc15b4e238..172fb1a93b 100644 --- a/boost/asio/ssl/impl/src.hpp +++ b/boost/asio/ssl/impl/src.hpp @@ -2,7 +2,7 @@ // impl/ssl/src.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/old/basic_context.hpp b/boost/asio/ssl/old/basic_context.hpp index b0b4b135d9..6d2353933b 100644 --- a/boost/asio/ssl/old/basic_context.hpp +++ b/boost/asio/ssl/old/basic_context.hpp @@ -3,7 +3,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2015 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/boost/asio/ssl/old/context_service.hpp b/boost/asio/ssl/old/context_service.hpp index 0912b55f2e..9c3e9c7e2c 100644 --- a/boost/asio/ssl/old/context_service.hpp +++ b/boost/asio/ssl/old/context_service.hpp @@ -3,7 +3,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2015 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/boost/asio/ssl/old/detail/openssl_context_service.hpp b/boost/asio/ssl/old/detail/openssl_context_service.hpp index a6e25c9d96..9b45e3585f 100644 --- a/boost/asio/ssl/old/detail/openssl_context_service.hpp +++ b/boost/asio/ssl/old/detail/openssl_context_service.hpp @@ -3,7 +3,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2015 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/boost/asio/ssl/old/detail/openssl_stream_service.hpp b/boost/asio/ssl/old/detail/openssl_stream_service.hpp index ab8f8cf439..2206ca010d 100644 --- a/boost/asio/ssl/old/detail/openssl_stream_service.hpp +++ b/boost/asio/ssl/old/detail/openssl_stream_service.hpp @@ -3,7 +3,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2015 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/boost/asio/ssl/old/stream.hpp b/boost/asio/ssl/old/stream.hpp index 3bfe56df4a..ddf4d17468 100644 --- a/boost/asio/ssl/old/stream.hpp +++ b/boost/asio/ssl/old/stream.hpp @@ -3,7 +3,7 @@ // ~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2015 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/boost/asio/ssl/old/stream_service.hpp b/boost/asio/ssl/old/stream_service.hpp index 3acecc5d5a..e046f7c43d 100644 --- a/boost/asio/ssl/old/stream_service.hpp +++ b/boost/asio/ssl/old/stream_service.hpp @@ -3,7 +3,7 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com -// Copyright (c) 2005-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2015 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/boost/asio/ssl/rfc2818_verification.hpp b/boost/asio/ssl/rfc2818_verification.hpp index f2687b9461..502a41ee68 100644 --- a/boost/asio/ssl/rfc2818_verification.hpp +++ b/boost/asio/ssl/rfc2818_verification.hpp @@ -2,7 +2,7 @@ // ssl/rfc2818_verification.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/stream.hpp b/boost/asio/ssl/stream.hpp index 3eafd16e9c..17f6e15bbb 100644 --- a/boost/asio/ssl/stream.hpp +++ b/boost/asio/ssl/stream.hpp @@ -2,7 +2,7 @@ // ssl/stream.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/stream_base.hpp b/boost/asio/ssl/stream_base.hpp index 06d7849530..264fba9bae 100644 --- a/boost/asio/ssl/stream_base.hpp +++ b/boost/asio/ssl/stream_base.hpp @@ -2,7 +2,7 @@ // ssl/stream_base.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/stream_service.hpp b/boost/asio/ssl/stream_service.hpp index 9fcb48e82c..4a295eb268 100644 --- a/boost/asio/ssl/stream_service.hpp +++ b/boost/asio/ssl/stream_service.hpp @@ -2,7 +2,7 @@ // ssl/stream_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/verify_context.hpp b/boost/asio/ssl/verify_context.hpp index ddd3fec5da..26b712cd50 100644 --- a/boost/asio/ssl/verify_context.hpp +++ b/boost/asio/ssl/verify_context.hpp @@ -2,7 +2,7 @@ // ssl/verify_context.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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/boost/asio/ssl/verify_mode.hpp b/boost/asio/ssl/verify_mode.hpp index 4d4a1ed9bf..a99553b3bf 100644 --- a/boost/asio/ssl/verify_mode.hpp +++ b/boost/asio/ssl/verify_mode.hpp @@ -2,7 +2,7 @@ // ssl/verify_mode.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2015 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) -- cgit v1.2.3