diff DEPENDENCIES/generic/include/boost/asio/ssl/impl/context.ipp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/asio/ssl/impl/context.ipp	Fri Sep 04 12:01:02 2015 +0100
+++ b/DEPENDENCIES/generic/include/boost/asio/ssl/impl/context.ipp	Mon Sep 07 11:12:49 2015 +0100
@@ -3,7 +3,7 @@
 // ~~~~~~~~~~~~~~~~~~~~
 //
 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2013 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 @@
 context::context(context::method m)
   : handle_(0)
 {
+  ::ERR_clear_error();
+
   switch (m)
   {
 #if defined(OPENSSL_NO_SSL2)
@@ -329,6 +331,8 @@
 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 @@
 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 @@
 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 @@
     }
   }
 
+  ::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 @@
 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 @@
       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 @@
       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 @@
     }
   }
 
+  ::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 @@
     }
   }
 
+  ::ERR_clear_error();
+
   if (::SSL_CTX_use_RSAPrivateKey_file(
         handle_, filename.c_str(), file_type) != 1)
   {
@@ -793,6 +813,8 @@
 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 @@
 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)
   {