diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
commit | b8cf34c691623e4ec329053cbbf68522a855882d (patch) | |
tree | 34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/asio/ssl/impl/context.ipp | |
parent | 3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff) | |
download | boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2 boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip |
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/asio/ssl/impl/context.ipp')
-rw-r--r-- | boost/asio/ssl/impl/context.ipp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/boost/asio/ssl/impl/context.ipp b/boost/asio/ssl/impl/context.ipp index f50ce454ea..f35e43c2a6 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-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2005-2018 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) @@ -510,23 +510,26 @@ BOOST_ASIO_SYNC_OP_VOID context::add_certificate_authority( bio_cleanup bio = { make_buffer_bio(ca) }; if (bio.p) { - x509_cleanup cert = { ::PEM_read_bio_X509(bio.p, 0, 0, 0) }; - if (cert.p) + if (X509_STORE* store = ::SSL_CTX_get_cert_store(handle_)) { - if (X509_STORE* store = ::SSL_CTX_get_cert_store(handle_)) + for (;;) { - if (::X509_STORE_add_cert(store, cert.p) == 1) + x509_cleanup cert = { ::PEM_read_bio_X509(bio.p, 0, 0, 0) }; + if (!cert.p) + break; + + if (::X509_STORE_add_cert(store, cert.p) != 1) { - ec = boost::system::error_code(); + ec = boost::system::error_code( + static_cast<int>(::ERR_get_error()), + boost::asio::error::get_ssl_category()); BOOST_ASIO_SYNC_OP_VOID_RETURN(ec); } } } } - ec = boost::system::error_code( - static_cast<int>(::ERR_get_error()), - boost::asio::error::get_ssl_category()); + ec = boost::system::error_code(); BOOST_ASIO_SYNC_OP_VOID_RETURN(ec); } |