diff options
Diffstat (limited to 'src/lib/tls/asio/asio_stream_base.h')
-rw-r--r-- | src/lib/tls/asio/asio_stream_base.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/lib/tls/asio/asio_stream_base.h b/src/lib/tls/asio/asio_stream_base.h index 169d035a3..f1c43254e 100644 --- a/src/lib/tls/asio/asio_stream_base.h +++ b/src/lib/tls/asio/asio_stream_base.h @@ -14,21 +14,16 @@ #include <boost/version.hpp> #if BOOST_VERSION >= 106600 -#include <botan/tls_client.h> #include <botan/asio_context.h> #include <botan/asio_error.h> #include <botan/internal/asio_stream_core.h> +#include <botan/tls_client.h> +#include <botan/tls_magic.h> namespace Botan { namespace TLS { -enum handshake_type - { - client, - server - }; - /** Base class for all Botan::TLS::Stream implementations. * * This template must be specialized for all the Botan::TLS::Channel to be used. @@ -59,22 +54,20 @@ class StreamBase<Botan::TLS::Client> StreamBase(const StreamBase&) = delete; StreamBase& operator=(const StreamBase&) = delete; - using handshake_type = Botan::TLS::handshake_type; - protected: - //! \brief validate the OpenSSL compatibility enum `handshake_type` - void validate_handshake_type(handshake_type type) + //! \brief validate the connection side (OpenSSL compatibility) + void validate_connection_side(Connection_Side side) { - if(type != handshake_type::client) + if(side != CLIENT) { - throw Invalid_Argument("wrong handshake_type"); + throw Invalid_Argument("wrong connection_side"); } } - //! \brief validate the OpenSSL compatibility enum `handshake_type` - bool validate_handshake_type(handshake_type type, boost::system::error_code& ec) + //! \brief validate the connection side (OpenSSL compatibility) + bool validate_connection_side(Connection_Side side, boost::system::error_code& ec) { - if(type != handshake_type::client) + if(side != CLIENT) { ec = Botan::TLS::error::invalid_argument; return false; |