fix boost version condition for new asio ssl features
This commit is contained in:
parent
886364118c
commit
fdc6d3722b
|
@ -69,7 +69,7 @@ public:
|
||||||
void set_verify_callback(T const& fun, error_code& ec)
|
void set_verify_callback(T const& fun, error_code& ec)
|
||||||
{ m_sock.set_verify_callback(fun, ec); }
|
{ m_sock.set_verify_callback(fun, ec); }
|
||||||
|
|
||||||
#if BOOST_VERSION > 104600
|
#if BOOST_VERSION >= 104700
|
||||||
SSL* native_handle() { return m_sock.native_handle(); }
|
SSL* native_handle() { return m_sock.native_handle(); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -955,7 +955,7 @@ namespace libtorrent
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
boost::shared_ptr<asio::ssl::context> m_ssl_ctx;
|
boost::shared_ptr<asio::ssl::context> m_ssl_ctx;
|
||||||
|
|
||||||
#if BOOST_VERSION > 104600
|
#if BOOST_VERSION >= 104700
|
||||||
bool verify_peer_cert(bool preverified, boost::asio::ssl::verify_context& ctx);
|
bool verify_peer_cert(bool preverified, boost::asio::ssl::verify_context& ctx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/debug.hpp"
|
#include "libtorrent/debug.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION > 104600
|
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION >= 104700
|
||||||
#include <boost/asio/ssl/rfc2818_verification.hpp>
|
#include <boost/asio/ssl/rfc2818_verification.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ void http_connection::start(std::string const& hostname, std::string const& port
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION > 104600
|
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION >= 104700
|
||||||
// for SSL connections, make sure to authenticate the hostname
|
// for SSL connections, make sure to authenticate the hostname
|
||||||
// of the certificate
|
// of the certificate
|
||||||
#define CASE(t) case socket_type_int_impl<ssl_stream<t> >::value: \
|
#define CASE(t) case socket_type_int_impl<ssl_stream<t> >::value: \
|
||||||
|
|
|
@ -537,7 +537,7 @@ namespace aux {
|
||||||
int session_impl::logging_allocator::allocated_bytes = 0;
|
int session_impl::logging_allocator::allocated_bytes = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION > 104600
|
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION >= 104700
|
||||||
// when running bittorrent over SSL, the SNI (server name indication)
|
// when running bittorrent over SSL, the SNI (server name indication)
|
||||||
// extension is used to know which torrent the incoming connection is
|
// extension is used to know which torrent the incoming connection is
|
||||||
// trying to connect to. The 40 first bytes in the name is expected to
|
// trying to connect to. The 40 first bytes in the name is expected to
|
||||||
|
@ -684,7 +684,7 @@ namespace aux {
|
||||||
error_code ec;
|
error_code ec;
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
m_ssl_ctx.set_verify_mode(asio::ssl::context::verify_none, ec);
|
m_ssl_ctx.set_verify_mode(asio::ssl::context::verify_none, ec);
|
||||||
#if BOOST_VERSION > 104600
|
#if BOOST_VERSION >= 104700
|
||||||
SSL_CTX_set_tlsext_servername_callback(m_ssl_ctx.native_handle(), servername_callback);
|
SSL_CTX_set_tlsext_servername_callback(m_ssl_ctx.native_handle(), servername_callback);
|
||||||
SSL_CTX_set_tlsext_servername_arg(m_ssl_ctx.native_handle(), this);
|
SSL_CTX_set_tlsext_servername_arg(m_ssl_ctx.native_handle(), this);
|
||||||
#endif // BOOST_VERSION
|
#endif // BOOST_VERSION
|
||||||
|
|
|
@ -85,7 +85,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
#include "libtorrent/ssl_stream.hpp"
|
#include "libtorrent/ssl_stream.hpp"
|
||||||
#include <boost/asio/ssl/context.hpp>
|
#include <boost/asio/ssl/context.hpp>
|
||||||
#if BOOST_VERSION > 104600
|
#if BOOST_VERSION >= 104700
|
||||||
#include <boost/asio/ssl/rfc2818_verification.hpp>
|
#include <boost/asio/ssl/rfc2818_verification.hpp>
|
||||||
#include <boost/asio/ssl/verify_context.hpp>
|
#include <boost/asio/ssl/verify_context.hpp>
|
||||||
#endif // BOOST_VERSION
|
#endif // BOOST_VERSION
|
||||||
|
@ -1289,7 +1289,7 @@ namespace libtorrent
|
||||||
|
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
|
|
||||||
#if BOOST_VERSION > 104600
|
#if BOOST_VERSION > 104700
|
||||||
bool torrent::verify_peer_cert(bool preverified, boost::asio::ssl::verify_context& ctx)
|
bool torrent::verify_peer_cert(bool preverified, boost::asio::ssl::verify_context& ctx)
|
||||||
{
|
{
|
||||||
// if the cert wasn't signed by the correct CA, fail the verification
|
// if the cert wasn't signed by the correct CA, fail the verification
|
||||||
|
@ -1392,7 +1392,7 @@ namespace libtorrent
|
||||||
|
|
||||||
TORRENT_ASSERT(RAND_status() == 1);
|
TORRENT_ASSERT(RAND_status() == 1);
|
||||||
|
|
||||||
#if BOOST_VERSION > 104600
|
#if BOOST_VERSION >= 104700
|
||||||
// create the SSL context for this torrent. We need to
|
// create the SSL context for this torrent. We need to
|
||||||
// inject the root certificate, and no other, to
|
// inject the root certificate, and no other, to
|
||||||
// verify other peers against
|
// verify other peers against
|
||||||
|
@ -4606,7 +4606,7 @@ namespace libtorrent
|
||||||
str->set_dst_name(hostname);
|
str->set_dst_name(hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION > 104600
|
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION >= 104700
|
||||||
// for SSL connections, make sure to authenticate the hostname
|
// for SSL connections, make sure to authenticate the hostname
|
||||||
// of the certificate
|
// of the certificate
|
||||||
#define CASE(t) case socket_type_int_impl<ssl_stream<t> >::value: \
|
#define CASE(t) case socket_type_int_impl<ssl_stream<t> >::value: \
|
||||||
|
@ -5495,7 +5495,7 @@ namespace libtorrent
|
||||||
(void)ret;
|
(void)ret;
|
||||||
TORRENT_ASSERT(ret);
|
TORRENT_ASSERT(ret);
|
||||||
|
|
||||||
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION > 104600
|
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION >= 104700
|
||||||
if (is_ssl_torrent())
|
if (is_ssl_torrent())
|
||||||
{
|
{
|
||||||
// for ssl sockets, set the hostname
|
// for ssl sockets, set the hostname
|
||||||
|
@ -5646,7 +5646,7 @@ namespace libtorrent
|
||||||
// INVARIANT_CHECK;
|
// INVARIANT_CHECK;
|
||||||
|
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
#ifdef TORRENT_USE_OPENSSL
|
||||||
#if BOOST_VERSION > 104600
|
#if BOOST_VERSION >= 104700
|
||||||
if (is_ssl_torrent())
|
if (is_ssl_torrent())
|
||||||
{
|
{
|
||||||
// if this is an SSL torrent, don't allow non SSL peers on it
|
// if this is an SSL torrent, don't allow non SSL peers on it
|
||||||
|
|
Loading…
Reference in New Issue