fix boost version condition for new asio ssl features

This commit is contained in:
Arvid Norberg 2012-02-26 00:01:53 +00:00
parent 886364118c
commit fdc6d3722b
5 changed files with 12 additions and 12 deletions

View File

@ -69,7 +69,7 @@ public:
void set_verify_callback(T const& fun, error_code& ec)
{ m_sock.set_verify_callback(fun, ec); }
#if BOOST_VERSION > 104600
#if BOOST_VERSION >= 104700
SSL* native_handle() { return m_sock.native_handle(); }
#endif

View File

@ -955,7 +955,7 @@ namespace libtorrent
#ifdef TORRENT_USE_OPENSSL
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);
#endif

View File

@ -42,7 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/debug.hpp"
#endif
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION > 104600
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION >= 104700
#include <boost/asio/ssl/rfc2818_verification.hpp>
#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
// of the certificate
#define CASE(t) case socket_type_int_impl<ssl_stream<t> >::value: \

View File

@ -537,7 +537,7 @@ namespace aux {
int session_impl::logging_allocator::allocated_bytes = 0;
#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)
// 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
@ -684,7 +684,7 @@ namespace aux {
error_code ec;
#ifdef TORRENT_USE_OPENSSL
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_arg(m_ssl_ctx.native_handle(), this);
#endif // BOOST_VERSION

View File

@ -85,7 +85,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifdef TORRENT_USE_OPENSSL
#include "libtorrent/ssl_stream.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/verify_context.hpp>
#endif // BOOST_VERSION
@ -1289,7 +1289,7 @@ namespace libtorrent
#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)
{
// if the cert wasn't signed by the correct CA, fail the verification
@ -1392,7 +1392,7 @@ namespace libtorrent
TORRENT_ASSERT(RAND_status() == 1);
#if BOOST_VERSION > 104600
#if BOOST_VERSION >= 104700
// create the SSL context for this torrent. We need to
// inject the root certificate, and no other, to
// verify other peers against
@ -4606,7 +4606,7 @@ namespace libtorrent
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
// of the certificate
#define CASE(t) case socket_type_int_impl<ssl_stream<t> >::value: \
@ -5495,7 +5495,7 @@ namespace libtorrent
(void)ret;
TORRENT_ASSERT(ret);
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION > 104600
#if defined TORRENT_USE_OPENSSL && BOOST_VERSION >= 104700
if (is_ssl_torrent())
{
// for ssl sockets, set the hostname
@ -5646,7 +5646,7 @@ namespace libtorrent
// INVARIANT_CHECK;
#ifdef TORRENT_USE_OPENSSL
#if BOOST_VERSION > 104600
#if BOOST_VERSION >= 104700
if (is_ssl_torrent())
{
// if this is an SSL torrent, don't allow non SSL peers on it