summaryrefslogtreecommitdiff
path: root/boost/asio/ssl/impl/context.ipp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:33:54 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:36:09 +0900
commitd9ec475d945d3035377a0d89ed42e382d8988891 (patch)
tree34aff2cee4b209906243ab5499d61f3edee2982f /boost/asio/ssl/impl/context.ipp
parent71d216b90256936a9638f325af9bc69d720e75de (diff)
downloadboost-d9ec475d945d3035377a0d89ed42e382d8988891.tar.gz
boost-d9ec475d945d3035377a0d89ed42e382d8988891.tar.bz2
boost-d9ec475d945d3035377a0d89ed42e382d8988891.zip
Imported Upstream version 1.60.0
Change-Id: Ie709530d6d5841088ceaba025cbe175a4ef43050 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/asio/ssl/impl/context.ipp')
-rw-r--r--boost/asio/ssl/impl/context.ipp16
1 files changed, 15 insertions, 1 deletions
diff --git a/boost/asio/ssl/impl/context.ipp b/boost/asio/ssl/impl/context.ipp
index 67191ade20..acb191a706 100644
--- a/boost/asio/ssl/impl/context.ipp
+++ b/boost/asio/ssl/impl/context.ipp
@@ -89,6 +89,14 @@ context::context(context::method m)
handle_ = ::SSL_CTX_new(::SSLv2_server_method());
break;
#endif // defined(OPENSSL_NO_SSL2)
+#if defined(OPENSSL_NO_SSL3)
+ case context::sslv3:
+ case context::sslv3_client:
+ case context::sslv3_server:
+ boost::asio::detail::throw_error(
+ boost::asio::error::invalid_argument, "context");
+ break;
+#else // defined(OPENSSL_NO_SSL3)
case context::sslv3:
handle_ = ::SSL_CTX_new(::SSLv3_method());
break;
@@ -98,6 +106,7 @@ context::context(context::method m)
case context::sslv3_server:
handle_ = ::SSL_CTX_new(::SSLv3_server_method());
break;
+#endif // defined(OPENSSL_NO_SSL3)
case context::tlsv1:
handle_ = ::SSL_CTX_new(::TLSv1_method());
break;
@@ -557,11 +566,15 @@ boost::system::error_code context::use_certificate_chain(
return ec;
}
+#if (OPENSSL_VERSION_NUMBER >= 0x10002000L) && !defined(LIBRESSL_VERSION_NUMBER)
+ ::SSL_CTX_clear_chain_certs(handle_);
+#else
if (handle_->extra_certs)
{
::sk_X509_pop_free(handle_->extra_certs, X509_free);
handle_->extra_certs = 0;
}
+#endif // (OPENSSL_VERSION_NUMBER >= 0x10002000L)
while (X509* cacert = ::PEM_read_bio_X509(bio.p, 0,
handle_->default_passwd_callback,
@@ -949,7 +962,8 @@ int context::password_callback_function(
strcpy_s(buf, size, passwd.c_str());
#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
*buf = '\0';
- strncat(buf, passwd.c_str(), size);
+ if (size > 0)
+ strncat(buf, passwd.c_str(), size - 1);
#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
return static_cast<int>(strlen(buf));