diff options
Diffstat (limited to 'boost/asio/ssl/impl')
-rw-r--r-- | boost/asio/ssl/impl/context.hpp | 2 | ||||
-rw-r--r-- | boost/asio/ssl/impl/context.ipp | 30 | ||||
-rw-r--r-- | boost/asio/ssl/impl/error.ipp | 2 | ||||
-rw-r--r-- | boost/asio/ssl/impl/rfc2818_verification.ipp | 2 | ||||
-rw-r--r-- | boost/asio/ssl/impl/src.hpp | 2 |
5 files changed, 31 insertions, 7 deletions
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) |