Botan  2.11.0
Crypto and TLS for C++11
Classes | Protected Member Functions | Protected Attributes | Friends | List of all members
Botan::TLS::Stream< StreamLayer, ChannelT > Class Template Reference

boost::asio compatible SSL/TLS stream More...

#include <asio_stream.h>

Classes

class  StreamCore
 Helper class that implements Botan::TLS::Callbacks. More...
 

Public Member Functions

construction
template<typename... Args>
 Stream (Context &context, Args &&... args)
 Construct a new Stream. More...
 
template<typename Arg >
 Stream (Arg &&arg, Context &context)
 Construct a new Stream. More...
 
virtual ~Stream ()=default
 
 Stream (Stream &&other)=default
 
Streamoperator= (Stream &&other)=default
 
 Stream (const Stream &other)=delete
 
Streamoperator= (const Stream &other)=delete
 
configuration and callback setters
void set_verify_callback (Context::Verify_Callback callback)
 Override the tls_verify_cert_chain callback. More...
 
void set_verify_callback (Context::Verify_Callback callback, boost::system::error_code &ec)
 Compatibility overload of set_verify_callback. More...
 
void set_verify_depth (int depth)
 
void set_verify_depth (int depth, boost::system::error_code &ec)
 
template<typename verify_mode >
void set_verify_mode (verify_mode v)
 
template<typename verify_mode >
void set_verify_mode (verify_mode v, boost::system::error_code &ec)
 
shutdown methods
void shutdown (boost::system::error_code &ec)
 Shut down SSL on the stream. More...
 
void shutdown ()
 Shut down SSL on the stream. More...
 
template<typename ShutdownHandler >
void async_shutdown (ShutdownHandler &&handler)
 Asynchronously shut down SSL on the stream. More...
 

Protected Member Functions

void consume_send_buffer (std::size_t bytesConsumed)
 Mark bytes in the send buffer as consumed, removing them from the buffer. More...
 
template<typename MutableBufferSequence >
std::size_t copy_received_data (MutableBufferSequence buffers)
 Copy decrypted data into the user-provided buffer. More...
 
bool has_data_to_send () const
 Check if encrypted data is available in the send buffer. More...
 
bool has_received_data () const
 Check if decrypted data is available in the receive buffer. More...
 
const boost::asio::mutable_buffer & input_buffer ()
 
boost::asio::const_buffer send_buffer () const
 
size_t send_pending_encrypted_data (boost::system::error_code &ec)
 
template<class T = ChannelT>
std::enable_if<!std::is_same< Channel, T >::value >::type setup_native_handle (Connection_Side, boost::system::error_code &)
 
template<class T = ChannelT>
std::enable_if< std::is_same< Channel, T >::value >::type setup_native_handle (Connection_Side side, boost::system::error_code &ec)
 Create the native handle. More...
 
template<typename ConstBufferSequence >
void tls_encrypt (const ConstBufferSequence &buffers, boost::system::error_code &ec)
 

Protected Attributes

Contextm_context
 
StreamCore m_core
 
const boost::asio::mutable_buffer m_input_buffer
 
std::vector< uint8_t > m_input_buffer_space
 
std::unique_ptr< ChannelT > m_native_handle
 
StreamLayer m_nextLayer
 
boost::beast::flat_buffer m_receive_buffer
 
boost::beast::flat_buffer m_send_buffer
 

Friends

template<class H , class S , class A >
class detail::AsyncHandshakeOperation
 
template<class H , class S , class M , class A >
class detail::AsyncReadOperation
 
template<class H , class S , class A >
class detail::AsyncWriteOperation
 

boost::asio accessor methods

using next_layer_type = typename std::remove_reference< StreamLayer >::type
 
using lowest_layer_type = typename next_layer_type::lowest_layer_type
 
using executor_type = typename next_layer_type::executor_type
 
using native_handle_type = typename std::add_pointer< ChannelT >::type
 
executor_type get_executor () noexcept
 
const next_layer_typenext_layer () const
 
next_layer_typenext_layer ()
 
lowest_layer_typelowest_layer ()
 
const lowest_layer_typelowest_layer () const
 
native_handle_type native_handle ()
 

handshake methods

HandshakeHandler && handler
 
boost::system::error_code ec
 
detail::AsyncHandshakeOperation< typename std::decay< HandshakeHandler >::type, Streamop {std::move(init.completion_handler), *this, ec}
 
const ConstBufferSequence & buffers
 
const ConstBufferSequence BufferedHandshakeHandler && handler
 
void handshake (Connection_Side side)
 Performs SSL handshaking. More...
 
void handshake (Connection_Side side, boost::system::error_code &ec)
 Performs SSL handshaking. More...
 
template<typename HandshakeHandler >
 BOOST_ASIO_INITFN_RESULT_TYPE (HandshakeHandler, void(boost::system::error_code)) async_handshake(Connection_Side side
 Starts an asynchronous SSL handshake. More...
 
 setup_native_handle (side, ec)
 
boost::asio::async_completion< HandshakeHandler, void(boost::system::error_code)> init (handler)
 
return init result get ()
 
template<typename ConstBufferSequence , typename BufferedHandshakeHandler >
 BOOST_ASIO_INITFN_RESULT_TYPE (BufferedHandshakeHandler, void(boost::system::error_code, std::size_t)) async_handshake(Connection_Side side
 
 BOOST_ASIO_HANDSHAKE_HANDLER_CHECK (BufferedHandshakeHandler, handler) type_check
 
throw Not_Implemented ("buffered async handshake is not implemented")
 

I/O methods

WriteHandler && handler
 
detail::AsyncWriteOperation< typename std::decay< WriteHandler >::type, Streamop {std::move(init.completion_handler), *this, boost::asio::buffer_size(buffers)}
 
ReadHandler && handler
 
detail::AsyncReadOperation< typename std::decay< ReadHandler >::type, Stream, MutableBufferSequence > op {std::move(init.completion_handler), *this, buffers}
 
template<typename MutableBufferSequence >
std::size_t read_some (const MutableBufferSequence &buffers, boost::system::error_code &ec)
 Read some data from the stream. More...
 
template<typename MutableBufferSequence >
std::size_t read_some (const MutableBufferSequence &buffers)
 Read some data from the stream. More...
 
template<typename ConstBufferSequence >
std::size_t write_some (const ConstBufferSequence &buffers, boost::system::error_code &ec)
 Write some data to the stream. More...
 
template<typename ConstBufferSequence >
std::size_t write_some (const ConstBufferSequence &buffers)
 Write some data to the stream. More...
 
template<typename ConstBufferSequence , typename WriteHandler >
 BOOST_ASIO_INITFN_RESULT_TYPE (WriteHandler, void(boost::system::error_code, std::size_t)) async_write_some(const ConstBufferSequence &buffers
 Start an asynchronous write. The function call always returns immediately. More...
 
boost::asio::async_completion< WriteHandler, void(boost::system::error_code, std::size_t)> init (handler)
 
 tls_encrypt (buffers, ec)
 
 if (ec)
 
return init result get ()
 
template<typename MutableBufferSequence , typename ReadHandler >
 BOOST_ASIO_INITFN_RESULT_TYPE (ReadHandler, void(boost::system::error_code, std::size_t)) async_read_some(const MutableBufferSequence &buffers
 Start an asynchronous read. The function call always returns immediately. More...
 
boost::asio::async_completion< ReadHandler, void(boost::system::error_code, std::size_t)> init (handler)
 
return init result get ()
 

Detailed Description

template<class StreamLayer, class ChannelT = Channel>
class Botan::TLS::Stream< StreamLayer, ChannelT >

boost::asio compatible SSL/TLS stream

Currently only the TLS::Client specialization is implemented.

Template Parameters
StreamLayertype of the next layer, usually a network socket
ChannelTtype of the native_handle, defaults to Botan::TLS::Channel, only needed for testing purposes

Definition at line 49 of file asio_stream.h.

Member Typedef Documentation

◆ executor_type

template<class StreamLayer , class ChannelT = Channel>
using Botan::TLS::Stream< StreamLayer, ChannelT >::executor_type = typename next_layer_type::executor_type

Definition at line 105 of file asio_stream.h.

◆ lowest_layer_type

template<class StreamLayer , class ChannelT = Channel>
using Botan::TLS::Stream< StreamLayer, ChannelT >::lowest_layer_type = typename next_layer_type::lowest_layer_type

Definition at line 104 of file asio_stream.h.

◆ native_handle_type

template<class StreamLayer , class ChannelT = Channel>
using Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle_type = typename std::add_pointer<ChannelT>::type

Definition at line 106 of file asio_stream.h.

◆ next_layer_type

template<class StreamLayer , class ChannelT = Channel>
using Botan::TLS::Stream< StreamLayer, ChannelT >::next_layer_type = typename std::remove_reference<StreamLayer>::type

Definition at line 103 of file asio_stream.h.

Constructor & Destructor Documentation

◆ Stream() [1/4]

template<class StreamLayer , class ChannelT = Channel>
template<typename... Args>
Botan::TLS::Stream< StreamLayer, ChannelT >::Stream ( Context context,
Args &&...  args 
)
inlineexplicit

Construct a new Stream.

Parameters
contextThe context parameter is used to set up the underlying native handle. Using code is responsible for lifetime management of the context and must ensure that it is available for the lifetime of the stream.
argsArguments to be forwarded to the construction of the next layer.

Definition at line 64 of file asio_stream.h.

65  : m_context(context)
66  , m_nextLayer(std::forward<Args>(args)...)
70  {}
const boost::asio::mutable_buffer m_input_buffer
Definition: asio_stream.h:707
StreamLayer m_nextLayer
Definition: asio_stream.h:697
StreamCore m_core
Definition: asio_stream.h:702
Context & m_context
Definition: asio_stream.h:696
boost::beast::flat_buffer m_send_buffer
Definition: asio_stream.h:700
std::vector< uint8_t > m_input_buffer_space
Definition: asio_stream.h:706
boost::beast::flat_buffer m_receive_buffer
Definition: asio_stream.h:699

◆ Stream() [2/4]

template<class StreamLayer , class ChannelT = Channel>
template<typename Arg >
Botan::TLS::Stream< StreamLayer, ChannelT >::Stream ( Arg &&  arg,
Context context 
)
inlineexplicit

Construct a new Stream.

Convenience overload for boost::asio::ssl::stream compatibility.

Parameters
argThis argument is forwarded to the construction of the next layer.
contextThe context parameter is used to set up the underlying native handle. Using code is responsible for lifetime management of the context and must ensure that is available for the lifetime of the stream.

Definition at line 83 of file asio_stream.h.

84  : m_context(context)
85  , m_nextLayer(std::forward<Arg>(arg))
89  {}
const boost::asio::mutable_buffer m_input_buffer
Definition: asio_stream.h:707
StreamLayer m_nextLayer
Definition: asio_stream.h:697
StreamCore m_core
Definition: asio_stream.h:702
Context & m_context
Definition: asio_stream.h:696
boost::beast::flat_buffer m_send_buffer
Definition: asio_stream.h:700
std::vector< uint8_t > m_input_buffer_space
Definition: asio_stream.h:706
boost::beast::flat_buffer m_receive_buffer
Definition: asio_stream.h:699

◆ ~Stream()

template<class StreamLayer , class ChannelT = Channel>
virtual Botan::TLS::Stream< StreamLayer, ChannelT >::~Stream ( )
virtualdefault

◆ Stream() [3/4]

template<class StreamLayer , class ChannelT = Channel>
Botan::TLS::Stream< StreamLayer, ChannelT >::Stream ( Stream< StreamLayer, ChannelT > &&  other)
default

◆ Stream() [4/4]

template<class StreamLayer , class ChannelT = Channel>
Botan::TLS::Stream< StreamLayer, ChannelT >::Stream ( const Stream< StreamLayer, ChannelT > &  other)
delete

Member Function Documentation

◆ async_shutdown()

template<class StreamLayer , class ChannelT = Channel>
template<typename ShutdownHandler >
void Botan::TLS::Stream< StreamLayer, ChannelT >::async_shutdown ( ShutdownHandler &&  handler)
inline

Asynchronously shut down SSL on the stream.

This function call always returns immediately.

Parameters
handlerThe handler to be called when the handshake operation completes. The equivalent function signature of the handler must be: void(boost::system::error_code)

Definition at line 345 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::BOOST_ASIO_HANDSHAKE_HANDLER_CHECK(), BOTAN_UNUSED, Botan::TLS::Stream< StreamLayer, ChannelT >::handler, and Botan::TLS::Stream< StreamLayer, ChannelT >::Not_Implemented().

346  {
347  BOOST_ASIO_HANDSHAKE_HANDLER_CHECK(ShutdownHandler, handler) type_check;
349  throw Not_Implemented("async shutdown is not implemented");
350  // TODO: Implement a subclass of AsyncBase that calls native_handle()->close() and writes pending data from
351  // the core to the network, e.g. using AsyncWriteOperation.
352  }
BOOST_ASIO_HANDSHAKE_HANDLER_CHECK(BufferedHandshakeHandler, handler) type_check
throw Not_Implemented("buffered async handshake is not implemented")
HandshakeHandler && handler
Definition: asio_stream.h:258
#define BOTAN_UNUSED(...)
Definition: assert.h:142

◆ BOOST_ASIO_HANDSHAKE_HANDLER_CHECK()

template<class StreamLayer , class ChannelT = Channel>
Botan::TLS::Stream< StreamLayer, ChannelT >::BOOST_ASIO_HANDSHAKE_HANDLER_CHECK ( BufferedHandshakeHandler  ,
handler   
)

◆ BOOST_ASIO_INITFN_RESULT_TYPE() [1/4]

template<class StreamLayer , class ChannelT = Channel>
template<typename HandshakeHandler >
Botan::TLS::Stream< StreamLayer, ChannelT >::BOOST_ASIO_INITFN_RESULT_TYPE ( HandshakeHandler  ,
void(boost::system::error_code)   
)

Starts an asynchronous SSL handshake.

This function call always returns immediately.

Parameters
typeThe type of handshaking to be performed, i.e. as a client or as a server.
handlerThe handler to be called when the handshake operation completes. The equivalent function signature of the handler must be: void(boost::system::error_code)
Exceptions
NotImplementedif Connection_Side is not CLIENT

◆ BOOST_ASIO_INITFN_RESULT_TYPE() [2/4]

template<class StreamLayer , class ChannelT = Channel>
template<typename ConstBufferSequence , typename BufferedHandshakeHandler >
Botan::TLS::Stream< StreamLayer, ChannelT >::BOOST_ASIO_INITFN_RESULT_TYPE ( BufferedHandshakeHandler  ,
void(boost::system::error_code, std::size_t)   
)
Exceptions
Not_Implemented

◆ BOOST_ASIO_INITFN_RESULT_TYPE() [3/4]

template<class StreamLayer , class ChannelT = Channel>
template<typename ConstBufferSequence , typename WriteHandler >
Botan::TLS::Stream< StreamLayer, ChannelT >::BOOST_ASIO_INITFN_RESULT_TYPE ( WriteHandler  ,
void(boost::system::error_code, std::size_t)   
) const &

Start an asynchronous write. The function call always returns immediately.

Parameters
buffersThe data to be written.
handlerThe handler to be called when the write operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be: void(boost::system::error_code, std::size_t)

◆ BOOST_ASIO_INITFN_RESULT_TYPE() [4/4]

template<class StreamLayer , class ChannelT = Channel>
template<typename MutableBufferSequence , typename ReadHandler >
Botan::TLS::Stream< StreamLayer, ChannelT >::BOOST_ASIO_INITFN_RESULT_TYPE ( ReadHandler  ,
void(boost::system::error_code, std::size_t)   
) const &

Start an asynchronous read. The function call always returns immediately.

Parameters
buffersThe buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.
handlerThe handler to be called when the read operation completes. The equivalent function signature of the handler must be: void(boost::system::error_code, std::size_t)

◆ consume_send_buffer()

template<class StreamLayer , class ChannelT = Channel>
void Botan::TLS::Stream< StreamLayer, ChannelT >::consume_send_buffer ( std::size_t  bytesConsumed)
inlineprotected

◆ copy_received_data()

template<class StreamLayer , class ChannelT = Channel>
template<typename MutableBufferSequence >
std::size_t Botan::TLS::Stream< StreamLayer, ChannelT >::copy_received_data ( MutableBufferSequence  buffers)
inlineprotected

Copy decrypted data into the user-provided buffer.

Definition at line 600 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, and Botan::TLS::Stream< StreamLayer, ChannelT >::m_receive_buffer.

Referenced by Botan::TLS::detail::AsyncReadOperation< typename std::decay< ReadHandler >::type, Botan::TLS::Stream, MutableBufferSequence >::operator()(), and Botan::TLS::Stream< StreamLayer, ChannelT >::read_some().

601  {
602  // Note: It would be nice to avoid this buffer copy. This could be achieved by equipping the StreamCore with
603  // the user's desired target buffer once a read is started, and reading directly into that buffer in tls_record
604  // received. However, we need to deal with the case that the receive buffer provided by the caller is smaller
605  // than the decrypted record, so this optimization might not be worth the additional complexity.
606  const auto copiedBytes = boost::asio::buffer_copy(buffers, m_receive_buffer.data());
607  m_receive_buffer.consume(copiedBytes);
608  return copiedBytes;
609  }
const ConstBufferSequence & buffers
Definition: asio_stream.h:278
boost::beast::flat_buffer m_receive_buffer
Definition: asio_stream.h:699

◆ get() [1/3]

template<class StreamLayer , class ChannelT = Channel>
return init result Botan::TLS::Stream< StreamLayer, ChannelT >::get ( )

◆ get() [2/3]

template<class StreamLayer , class ChannelT = Channel>
return init result Botan::TLS::Stream< StreamLayer, ChannelT >::get ( )

◆ get() [3/3]

template<class StreamLayer , class ChannelT = Channel>
return init result Botan::TLS::Stream< StreamLayer, ChannelT >::get ( )

◆ get_executor()

template<class StreamLayer , class ChannelT = Channel>
executor_type Botan::TLS::Stream< StreamLayer, ChannelT >::get_executor ( )
inlinenoexcept

Definition at line 108 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer.

108 { return m_nextLayer.get_executor(); }
StreamLayer m_nextLayer
Definition: asio_stream.h:697

◆ handshake() [1/2]

template<class StreamLayer , class ChannelT = Channel>
void Botan::TLS::Stream< StreamLayer, ChannelT >::handshake ( Connection_Side  side)
inline

Performs SSL handshaking.

The function call will block until handshaking is complete or an error occurs.

Parameters
typeThe type of handshaking to be performed, i.e. as a client or as a server.
Exceptions
boost::system::system_errorif error occured, or if the chosen Connection_Side is not available

Definition at line 195 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::ec.

196  {
197  boost::system::error_code ec;
198  handshake(side, ec);
199  boost::asio::detail::throw_error(ec, "handshake");
200  }
boost::system::error_code ec
Definition: asio_stream.h:261
void handshake(Connection_Side side)
Performs SSL handshaking.
Definition: asio_stream.h:195

◆ handshake() [2/2]

template<class StreamLayer , class ChannelT = Channel>
void Botan::TLS::Stream< StreamLayer, ChannelT >::handshake ( Connection_Side  side,
boost::system::error_code &  ec 
)
inline

Performs SSL handshaking.

The function call will block until handshaking is complete or an error occurs.

Parameters
typeThe type of handshaking to be performed, i.e. as a client or as a server.
ecSet to indicate what error occurred, if any.

Definition at line 210 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::ec, Botan::Exception::error_type(), Botan::TLS::Stream< StreamLayer, ChannelT >::input_buffer(), Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer, Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle(), Botan::TLS::Stream< StreamLayer, ChannelT >::send_pending_encrypted_data(), Botan::TLS::Stream< StreamLayer, ChannelT >::setup_native_handle(), Botan::TLS::TLS_Exception::type(), and Botan::Unknown.

211  {
212  setup_native_handle(side, ec);
213 
214  // send client hello, which was written to the send buffer on client instantiation
216 
217  while(!native_handle()->is_active() && !ec)
218  {
219  boost::asio::const_buffer read_buffer{input_buffer().data(), m_nextLayer.read_some(input_buffer(), ec)};
220  if(ec)
221  { return; }
222 
223  try
224  {
225  native_handle()->received_data(static_cast<const uint8_t*>(read_buffer.data()), read_buffer.size());
226  }
227  catch(const TLS_Exception& e)
228  {
229  ec = e.type();
230  }
231  catch(const Botan::Exception& e)
232  {
233  ec = e.error_type();
234  }
235  catch(const std::exception&)
236  {
238  }
239 
241  }
242  }
size_t send_pending_encrypted_data(boost::system::error_code &ec)
Definition: asio_stream.h:656
virtual ErrorType error_type() const noexcept
Definition: exceptn.h:99
boost::system::error_code ec
Definition: asio_stream.h:261
setup_native_handle(side, ec)
StreamLayer m_nextLayer
Definition: asio_stream.h:697
const boost::asio::mutable_buffer & input_buffer()
Definition: asio_stream.h:592
native_handle_type native_handle()
Definition: asio_stream.h:116

◆ has_data_to_send()

template<class StreamLayer , class ChannelT = Channel>
bool Botan::TLS::Stream< StreamLayer, ChannelT >::has_data_to_send ( ) const
inlineprotected

◆ has_received_data()

template<class StreamLayer , class ChannelT = Channel>
bool Botan::TLS::Stream< StreamLayer, ChannelT >::has_received_data ( ) const
inlineprotected

◆ if()

template<class StreamLayer , class ChannelT = Channel>
Botan::TLS::Stream< StreamLayer, ChannelT >::if ( ec  )
inline

Definition at line 475 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::consume_send_buffer(), Botan::TLS::Stream< StreamLayer, ChannelT >::ec, Botan::TLS::Stream< StreamLayer, ChannelT >::init(), Botan::TLS::Stream< StreamLayer, ChannelT >::m_send_buffer, and Botan::TLS::Stream< StreamLayer, ChannelT >::op.

476  {
477  // we cannot be sure how many bytes were committed here so clear the send_buffer and let the
478  // AsyncWriteOperation call the handler with the error_code set
481  op{std::move(init.completion_handler), *this, std::size_t(0), ec};
482  return init.result.get();
483  }
boost::system::error_code ec
Definition: asio_stream.h:261
detail::AsyncHandshakeOperation< typename std::decay< HandshakeHandler >::type, Stream > op
Definition: asio_stream.h:269
MechanismType type
boost::beast::flat_buffer m_send_buffer
Definition: asio_stream.h:700
boost::asio::async_completion< HandshakeHandler, void(boost::system::error_code)> init(handler)
Stream(Context &context, Args &&... args)
Construct a new Stream.
Definition: asio_stream.h:64
void consume_send_buffer(std::size_t bytesConsumed)
Mark bytes in the send buffer as consumed, removing them from the buffer.
Definition: asio_stream.h:615

◆ init() [1/3]

template<class StreamLayer , class ChannelT = Channel>
boost::asio::async_completion<HandshakeHandler, void(boost::system::error_code)> Botan::TLS::Stream< StreamLayer, ChannelT >::init ( handler  )

◆ init() [2/3]

template<class StreamLayer , class ChannelT = Channel>
boost::asio::async_completion<WriteHandler, void(boost::system::error_code, std::size_t)> Botan::TLS::Stream< StreamLayer, ChannelT >::init ( handler  )

◆ init() [3/3]

template<class StreamLayer , class ChannelT = Channel>
boost::asio::async_completion<ReadHandler, void(boost::system::error_code, std::size_t)> Botan::TLS::Stream< StreamLayer, ChannelT >::init ( handler  )

◆ input_buffer()

template<class StreamLayer , class ChannelT = Channel>
const boost::asio::mutable_buffer& Botan::TLS::Stream< StreamLayer, ChannelT >::input_buffer ( )
inlineprotected

◆ lowest_layer() [1/2]

template<class StreamLayer , class ChannelT = Channel>
lowest_layer_type& Botan::TLS::Stream< StreamLayer, ChannelT >::lowest_layer ( )
inline

Definition at line 113 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer.

113 { return m_nextLayer.lowest_layer(); }
StreamLayer m_nextLayer
Definition: asio_stream.h:697

◆ lowest_layer() [2/2]

template<class StreamLayer , class ChannelT = Channel>
const lowest_layer_type& Botan::TLS::Stream< StreamLayer, ChannelT >::lowest_layer ( ) const
inline

Definition at line 114 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer.

114 { return m_nextLayer.lowest_layer(); }
StreamLayer m_nextLayer
Definition: asio_stream.h:697

◆ native_handle()

template<class StreamLayer , class ChannelT = Channel>
native_handle_type Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle ( )
inline

◆ next_layer() [1/2]

template<class StreamLayer , class ChannelT = Channel>
const next_layer_type& Botan::TLS::Stream< StreamLayer, ChannelT >::next_layer ( ) const
inline

◆ next_layer() [2/2]

template<class StreamLayer , class ChannelT = Channel>
next_layer_type& Botan::TLS::Stream< StreamLayer, ChannelT >::next_layer ( )
inline

Definition at line 111 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer.

111 { return m_nextLayer; }
StreamLayer m_nextLayer
Definition: asio_stream.h:697

◆ Not_Implemented()

template<class StreamLayer , class ChannelT = Channel>
throw Botan::TLS::Stream< StreamLayer, ChannelT >::Not_Implemented ( "buffered async handshake is not implemented"  )

◆ operator=() [1/2]

template<class StreamLayer , class ChannelT = Channel>
Stream& Botan::TLS::Stream< StreamLayer, ChannelT >::operator= ( Stream< StreamLayer, ChannelT > &&  other)
default

◆ operator=() [2/2]

template<class StreamLayer , class ChannelT = Channel>
Stream& Botan::TLS::Stream< StreamLayer, ChannelT >::operator= ( const Stream< StreamLayer, ChannelT > &  other)
delete

◆ read_some() [1/2]

template<class StreamLayer , class ChannelT = Channel>
template<typename MutableBufferSequence >
std::size_t Botan::TLS::Stream< StreamLayer, ChannelT >::read_some ( const MutableBufferSequence &  buffers,
boost::system::error_code &  ec 
)
inline

Read some data from the stream.

The function call will block until one or more bytes of data has been read successfully, or until an error occurs.

Parameters
buffersThe buffers into which the data will be read.
ecSet to indicate what error occured, if any.
Returns
The number of bytes read. Returns 0 if an error occurred.

Definition at line 369 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, Botan::TLS::Stream< StreamLayer, ChannelT >::copy_received_data(), Botan::TLS::Stream< StreamLayer, ChannelT >::ec, Botan::Exception::error_type(), Botan::TLS::Stream< StreamLayer, ChannelT >::has_received_data(), Botan::TLS::Stream< StreamLayer, ChannelT >::input_buffer(), Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer, Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle(), Botan::TLS::TLS_Exception::type(), and Botan::Unknown.

Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::read_some().

371  {
372  if(has_received_data())
373  { return copy_received_data(buffers); }
374 
375  boost::asio::const_buffer read_buffer{input_buffer().data(), m_nextLayer.read_some(input_buffer(), ec)};
376  if(ec)
377  { return 0; }
378 
379  try
380  {
381  native_handle()->received_data(static_cast<const uint8_t*>(read_buffer.data()), read_buffer.size());
382  }
383  catch(const TLS_Exception& e)
384  {
385  ec = e.type();
386  }
387  catch(const Botan::Exception& e)
388  {
389  ec = e.error_type();
390  }
391  catch(const std::exception&)
392  {
394  }
395 
396  return !ec ? copy_received_data(buffers) : 0;
397  }
const ConstBufferSequence & buffers
Definition: asio_stream.h:278
virtual ErrorType error_type() const noexcept
Definition: exceptn.h:99
boost::system::error_code ec
Definition: asio_stream.h:261
StreamLayer m_nextLayer
Definition: asio_stream.h:697
const boost::asio::mutable_buffer & input_buffer()
Definition: asio_stream.h:592
std::size_t copy_received_data(MutableBufferSequence buffers)
Copy decrypted data into the user-provided buffer.
Definition: asio_stream.h:600
native_handle_type native_handle()
Definition: asio_stream.h:116
bool has_received_data() const
Check if decrypted data is available in the receive buffer.
Definition: asio_stream.h:596

◆ read_some() [2/2]

template<class StreamLayer , class ChannelT = Channel>
template<typename MutableBufferSequence >
std::size_t Botan::TLS::Stream< StreamLayer, ChannelT >::read_some ( const MutableBufferSequence &  buffers)
inline

Read some data from the stream.

The function call will block until one or more bytes of data has been read successfully, or until an error occurs.

Parameters
buffersThe buffers into which the data will be read.
Returns
The number of bytes read. Returns 0 if an error occurred.
Exceptions
boost::system::system_errorif error occured

Definition at line 410 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, Botan::TLS::Stream< StreamLayer, ChannelT >::ec, and Botan::TLS::Stream< StreamLayer, ChannelT >::read_some().

411  {
412  boost::system::error_code ec;
413  auto const n = read_some(buffers, ec);
414  boost::asio::detail::throw_error(ec, "read_some");
415  return n;
416  }
const ConstBufferSequence & buffers
Definition: asio_stream.h:278
boost::system::error_code ec
Definition: asio_stream.h:261
std::size_t read_some(const MutableBufferSequence &buffers, boost::system::error_code &ec)
Read some data from the stream.
Definition: asio_stream.h:369

◆ send_buffer()

template<class StreamLayer , class ChannelT = Channel>
boost::asio::const_buffer Botan::TLS::Stream< StreamLayer, ChannelT >::send_buffer ( ) const
inlineprotected

◆ send_pending_encrypted_data()

template<class StreamLayer , class ChannelT = Channel>
size_t Botan::TLS::Stream< StreamLayer, ChannelT >::send_pending_encrypted_data ( boost::system::error_code &  ec)
inlineprotected

Definition at line 656 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::consume_send_buffer(), Botan::TLS::Stream< StreamLayer, ChannelT >::ec, Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer, and Botan::TLS::Stream< StreamLayer, ChannelT >::send_buffer().

Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::handshake(), Botan::TLS::Stream< StreamLayer, ChannelT >::shutdown(), and Botan::TLS::Stream< StreamLayer, ChannelT >::write_some().

657  {
658  if(ec)
659  { return 0; }
660 
661  auto writtenBytes = boost::asio::write(m_nextLayer, send_buffer(), ec);
662  consume_send_buffer(writtenBytes);
663  return writtenBytes;
664  }
boost::system::error_code ec
Definition: asio_stream.h:261
StreamLayer m_nextLayer
Definition: asio_stream.h:697
boost::asio::const_buffer send_buffer() const
Definition: asio_stream.h:593
void consume_send_buffer(std::size_t bytesConsumed)
Mark bytes in the send buffer as consumed, removing them from the buffer.
Definition: asio_stream.h:615

◆ set_verify_callback() [1/2]

template<class StreamLayer , class ChannelT = Channel>
void Botan::TLS::Stream< StreamLayer, ChannelT >::set_verify_callback ( Context::Verify_Callback  callback)
inline

Override the tls_verify_cert_chain callback.

This changes the verify_callback in the stream's TLS::Context, and hence the tls_verify_cert_chain callback used in the handshake. Using this function is equivalent to setting the callback via

See also
Botan::TLS::Context::set_verify_callback
Note
This function should only be called before initiating the TLS handshake

Definition at line 131 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::m_context, and Botan::TLS::Context::set_verify_callback().

132  {
133  m_context.set_verify_callback(std::move(callback));
134  }
void set_verify_callback(Verify_Callback callback)
Override the tls_verify_cert_chain callback.
Definition: asio_context.h:84
Context & m_context
Definition: asio_stream.h:696

◆ set_verify_callback() [2/2]

template<class StreamLayer , class ChannelT = Channel>
void Botan::TLS::Stream< StreamLayer, ChannelT >::set_verify_callback ( Context::Verify_Callback  callback,
boost::system::error_code &  ec 
)
inline

Compatibility overload of set_verify_callback.

Parameters
ecThis parameter is unused.

Definition at line 141 of file asio_stream.h.

References BOTAN_UNUSED, Botan::TLS::Stream< StreamLayer, ChannelT >::ec, Botan::TLS::Stream< StreamLayer, ChannelT >::m_context, and Botan::TLS::Context::set_verify_callback().

142  {
143  BOTAN_UNUSED(ec);
144  m_context.set_verify_callback(std::move(callback));
145  }
void set_verify_callback(Verify_Callback callback)
Override the tls_verify_cert_chain callback.
Definition: asio_context.h:84
boost::system::error_code ec
Definition: asio_stream.h:261
Context & m_context
Definition: asio_stream.h:696
#define BOTAN_UNUSED(...)
Definition: assert.h:142

◆ set_verify_depth() [1/2]

template<class StreamLayer , class ChannelT = Channel>
void Botan::TLS::Stream< StreamLayer, ChannelT >::set_verify_depth ( int  depth)
inline
Exceptions
Not_Implemented

Definition at line 148 of file asio_stream.h.

References BOTAN_UNUSED, and Botan::TLS::Stream< StreamLayer, ChannelT >::Not_Implemented().

149  {
150  BOTAN_UNUSED(depth);
151  throw Not_Implemented("set_verify_depth is not implemented");
152  }
throw Not_Implemented("buffered async handshake is not implemented")
#define BOTAN_UNUSED(...)
Definition: assert.h:142

◆ set_verify_depth() [2/2]

template<class StreamLayer , class ChannelT = Channel>
void Botan::TLS::Stream< StreamLayer, ChannelT >::set_verify_depth ( int  depth,
boost::system::error_code &  ec 
)
inline

Not Implemented.

Parameters
ecWill be set to Botan::ErrorType::NotImplemented

Definition at line 158 of file asio_stream.h.

References BOTAN_UNUSED, Botan::TLS::Stream< StreamLayer, ChannelT >::ec, and Botan::NotImplemented.

159  {
160  BOTAN_UNUSED(depth);
162  }
boost::system::error_code ec
Definition: asio_stream.h:261
#define BOTAN_UNUSED(...)
Definition: assert.h:142

◆ set_verify_mode() [1/2]

template<class StreamLayer , class ChannelT = Channel>
template<typename verify_mode >
void Botan::TLS::Stream< StreamLayer, ChannelT >::set_verify_mode ( verify_mode  v)
inline
Exceptions
Not_Implemented

Definition at line 166 of file asio_stream.h.

References BOTAN_UNUSED, and Botan::TLS::Stream< StreamLayer, ChannelT >::Not_Implemented().

167  {
168  BOTAN_UNUSED(v);
169  throw Not_Implemented("set_verify_mode is not implemented");
170  }
throw Not_Implemented("buffered async handshake is not implemented")
#define BOTAN_UNUSED(...)
Definition: assert.h:142

◆ set_verify_mode() [2/2]

template<class StreamLayer , class ChannelT = Channel>
template<typename verify_mode >
void Botan::TLS::Stream< StreamLayer, ChannelT >::set_verify_mode ( verify_mode  v,
boost::system::error_code &  ec 
)
inline

Not Implemented.

Parameters
ecWill be set to Botan::ErrorType::NotImplemented

Definition at line 177 of file asio_stream.h.

References BOTAN_UNUSED, Botan::TLS::Stream< StreamLayer, ChannelT >::ec, and Botan::NotImplemented.

178  {
179  BOTAN_UNUSED(v);
181  }
boost::system::error_code ec
Definition: asio_stream.h:261
#define BOTAN_UNUSED(...)
Definition: assert.h:142

◆ setup_native_handle() [1/3]

template<class StreamLayer , class ChannelT = Channel>
Botan::TLS::Stream< StreamLayer, ChannelT >::setup_native_handle ( side  ,
ec   
)

◆ setup_native_handle() [2/3]

template<class StreamLayer , class ChannelT = Channel>
template<class T = ChannelT>
std::enable_if<!std::is_same<Channel, T>::value>::type Botan::TLS::Stream< StreamLayer, ChannelT >::setup_native_handle ( Connection_Side  ,
boost::system::error_code &   
)
inlineprotected

Definition at line 623 of file asio_stream.h.

623 {}

◆ setup_native_handle() [3/3]

template<class StreamLayer , class ChannelT = Channel>
template<class T = ChannelT>
std::enable_if<std::is_same<Channel, T>::value>::type Botan::TLS::Stream< StreamLayer, ChannelT >::setup_native_handle ( Connection_Side  side,
boost::system::error_code &  ec 
)
inlineprotected

Create the native handle.

Depending on the desired connection side, this function will create a Botan::TLS::Client or a Botan::TLS::Server.

Parameters
sideThe desired connection side (client or server)
ecSet to NotImplemented when side is SERVER - currently only CLIENT is implemented

Definition at line 636 of file asio_stream.h.

References Botan::TLS::CLIENT, Botan::TLS::Stream< StreamLayer, ChannelT >::ec, Botan::TLS::Stream< StreamLayer, ChannelT >::m_context, Botan::TLS::Stream< StreamLayer, ChannelT >::m_core, Botan::TLS::Context::m_credentials_manager, Botan::TLS::Stream< StreamLayer, ChannelT >::m_native_handle, Botan::TLS::Context::m_policy, Botan::TLS::Context::m_rng, Botan::TLS::Context::m_server_info, Botan::TLS::Context::m_session_manager, and Botan::NotImplemented.

637  {
638  if(side == CLIENT)
639  {
640  m_native_handle = std::unique_ptr<Client>(
641  new Client(m_core,
647  }
648  else
649  {
650  // TODO: First steps in order to support the server side of this stream would be to instantiate a
651  // Botan::TLS::Server instance as the stream's native_handle and implement the handshake appropriately.
653  }
654  }
RandomNumberGenerator & m_rng
Definition: asio_context.h:108
boost::system::error_code ec
Definition: asio_stream.h:261
Credentials_Manager & m_credentials_manager
Definition: asio_context.h:107
StreamCore m_core
Definition: asio_stream.h:702
Context & m_context
Definition: asio_stream.h:696
Server_Information m_server_info
Definition: asio_context.h:112
Session_Manager & m_session_manager
Definition: asio_context.h:109
std::unique_ptr< ChannelT > m_native_handle
Definition: asio_stream.h:703

◆ shutdown() [1/2]

template<class StreamLayer , class ChannelT = Channel>
void Botan::TLS::Stream< StreamLayer, ChannelT >::shutdown ( boost::system::error_code &  ec)
inline

Shut down SSL on the stream.

This function is used to shut down SSL on the stream. The function call will block until SSL has been shut down or an error occurs. Note that this will not close the lowest layer.

Parameters
ecSet to indicate what error occured, if any.

Definition at line 298 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::ec, Botan::Exception::error_type(), Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle(), Botan::TLS::Stream< StreamLayer, ChannelT >::send_pending_encrypted_data(), Botan::TLS::TLS_Exception::type(), and Botan::Unknown.

299  {
300  try
301  {
302  native_handle()->close();
303  }
304  catch(const TLS_Exception& e)
305  {
306  ec = e.type();
307  }
308  catch(const Botan::Exception& e)
309  {
310  ec = e.error_type();
311  }
312  catch(const std::exception&)
313  {
315  }
316 
317  if(!ec)
319  }
size_t send_pending_encrypted_data(boost::system::error_code &ec)
Definition: asio_stream.h:656
virtual ErrorType error_type() const noexcept
Definition: exceptn.h:99
boost::system::error_code ec
Definition: asio_stream.h:261
native_handle_type native_handle()
Definition: asio_stream.h:116

◆ shutdown() [2/2]

template<class StreamLayer , class ChannelT = Channel>
void Botan::TLS::Stream< StreamLayer, ChannelT >::shutdown ( )
inline

Shut down SSL on the stream.

This function is used to shut down SSL on the stream. The function call will block until SSL has been shut down or an error occurs. Note that this will not close the lowest layer.

Exceptions
boost::system::system_errorif error occured

Definition at line 329 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::ec.

330  {
331  boost::system::error_code ec;
332  shutdown(ec);
333  boost::asio::detail::throw_error(ec, "shutdown");
334  }
boost::system::error_code ec
Definition: asio_stream.h:261
void shutdown()
Shut down SSL on the stream.
Definition: asio_stream.h:329

◆ tls_encrypt() [1/2]

template<class StreamLayer , class ChannelT = Channel>
Botan::TLS::Stream< StreamLayer, ChannelT >::tls_encrypt ( buffers  ,
ec   
)

◆ tls_encrypt() [2/2]

template<class StreamLayer , class ChannelT = Channel>
template<typename ConstBufferSequence >
void Botan::TLS::Stream< StreamLayer, ChannelT >::tls_encrypt ( const ConstBufferSequence &  buffers,
boost::system::error_code &  ec 
)
inlineprotected

Definition at line 667 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, Botan::TLS::Stream< StreamLayer, ChannelT >::ec, Botan::Exception::error_type(), Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle(), Botan::TLS::TLS_Exception::type(), and Botan::Unknown.

668  {
669  // NOTE: This is not asynchronous: it encrypts the data synchronously.
670  // The data encrypted by native_handle()->send() is synchronously stored in the send_buffer of m_core,
671  // but is not actually written to the wire, yet.
672  for(auto it = boost::asio::buffer_sequence_begin(buffers);
673  !ec && it != boost::asio::buffer_sequence_end(buffers);
674  it++)
675  {
676  const boost::asio::const_buffer buffer = *it;
677  try
678  {
679  native_handle()->send(static_cast<const uint8_t*>(buffer.data()), buffer.size());
680  }
681  catch(const TLS_Exception& e)
682  {
683  ec = e.type();
684  }
685  catch(const Botan::Exception& e)
686  {
687  ec = e.error_type();
688  }
689  catch(const std::exception&)
690  {
692  }
693  }
694  }
const ConstBufferSequence & buffers
Definition: asio_stream.h:278
virtual ErrorType error_type() const noexcept
Definition: exceptn.h:99
boost::system::error_code ec
Definition: asio_stream.h:261
native_handle_type native_handle()
Definition: asio_stream.h:116

◆ write_some() [1/2]

template<class StreamLayer , class ChannelT = Channel>
template<typename ConstBufferSequence >
std::size_t Botan::TLS::Stream< StreamLayer, ChannelT >::write_some ( const ConstBufferSequence &  buffers,
boost::system::error_code &  ec 
)
inline

Write some data to the stream.

The function call will block until one or more bytes of data has been written successfully, or until an error occurs.

Parameters
buffersThe data to be written.
ecSet to indicate what error occurred, if any.
Returns
The number of bytes processed from the input buffers.

Definition at line 429 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, Botan::TLS::Stream< StreamLayer, ChannelT >::ec, Botan::TLS::Stream< StreamLayer, ChannelT >::send_pending_encrypted_data(), and Botan::TLS::Stream< StreamLayer, ChannelT >::tls_encrypt().

Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::write_some().

431  {
434  return !ec ? boost::asio::buffer_size(buffers) : 0;
435  }
size_t send_pending_encrypted_data(boost::system::error_code &ec)
Definition: asio_stream.h:656
const ConstBufferSequence & buffers
Definition: asio_stream.h:278
boost::system::error_code ec
Definition: asio_stream.h:261
tls_encrypt(buffers, ec)

◆ write_some() [2/2]

template<class StreamLayer , class ChannelT = Channel>
template<typename ConstBufferSequence >
std::size_t Botan::TLS::Stream< StreamLayer, ChannelT >::write_some ( const ConstBufferSequence &  buffers)
inline

Write some data to the stream.

The function call will block until one or more bytes of data has been written successfully, or until an error occurs.

Parameters
buffersThe data to be written.
Returns
The number of bytes written.
Exceptions
boost::system::system_errorif error occured

Definition at line 448 of file asio_stream.h.

References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, Botan::TLS::Stream< StreamLayer, ChannelT >::ec, and Botan::TLS::Stream< StreamLayer, ChannelT >::write_some().

449  {
450  boost::system::error_code ec;
451  auto const n = write_some(buffers, ec);
452  boost::asio::detail::throw_error(ec, "write_some");
453  return n;
454  }
const ConstBufferSequence & buffers
Definition: asio_stream.h:278
boost::system::error_code ec
Definition: asio_stream.h:261
std::size_t write_some(const ConstBufferSequence &buffers, boost::system::error_code &ec)
Write some data to the stream.
Definition: asio_stream.h:429

Friends And Related Function Documentation

◆ detail::AsyncHandshakeOperation

template<class StreamLayer , class ChannelT = Channel>
template<class H , class S , class A >
friend class detail::AsyncHandshakeOperation
friend

Definition at line 520 of file asio_stream.h.

◆ detail::AsyncReadOperation

template<class StreamLayer , class ChannelT = Channel>
template<class H , class S , class M , class A >
friend class detail::AsyncReadOperation
friend

Definition at line 518 of file asio_stream.h.

◆ detail::AsyncWriteOperation

template<class StreamLayer , class ChannelT = Channel>
template<class H , class S , class A >
friend class detail::AsyncWriteOperation
friend

Definition at line 519 of file asio_stream.h.

Member Data Documentation

◆ buffers

template<class StreamLayer , class ChannelT = Channel>
const ConstBufferSequence& Botan::TLS::Stream< StreamLayer, ChannelT >::buffers

◆ ec

template<class StreamLayer , class ChannelT = Channel>
boost::system::error_code Botan::TLS::Stream< StreamLayer, ChannelT >::ec

◆ handler [1/4]

template<class StreamLayer , class ChannelT = Channel>
HandshakeHandler&& Botan::TLS::Stream< StreamLayer, ChannelT >::handler
Initial value:
{
BOOST_ASIO_HANDSHAKE_HANDLER_CHECK(HandshakeHandler, handler) type_check

Definition at line 258 of file asio_stream.h.

Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::async_shutdown().

◆ handler [2/4]

template<class StreamLayer , class ChannelT = Channel>
const ConstBufferSequence BufferedHandshakeHandler&& Botan::TLS::Stream< StreamLayer, ChannelT >::handler
Initial value:

Definition at line 280 of file asio_stream.h.

◆ handler [3/4]

template<class StreamLayer , class ChannelT = Channel>
WriteHandler&& Botan::TLS::Stream< StreamLayer, ChannelT >::handler
Initial value:
{
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check

Definition at line 468 of file asio_stream.h.

◆ handler [4/4]

template<class StreamLayer , class ChannelT = Channel>
ReadHandler&& Botan::TLS::Stream< StreamLayer, ChannelT >::handler
Initial value:
{
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check

Definition at line 505 of file asio_stream.h.

◆ m_context

template<class StreamLayer , class ChannelT = Channel>
Context& Botan::TLS::Stream< StreamLayer, ChannelT >::m_context
protected

◆ m_core

template<class StreamLayer , class ChannelT = Channel>
StreamCore Botan::TLS::Stream< StreamLayer, ChannelT >::m_core
protected

◆ m_input_buffer

template<class StreamLayer , class ChannelT = Channel>
const boost::asio::mutable_buffer Botan::TLS::Stream< StreamLayer, ChannelT >::m_input_buffer
protected

◆ m_input_buffer_space

template<class StreamLayer , class ChannelT = Channel>
std::vector<uint8_t> Botan::TLS::Stream< StreamLayer, ChannelT >::m_input_buffer_space
protected

Definition at line 706 of file asio_stream.h.

◆ m_native_handle

template<class StreamLayer , class ChannelT = Channel>
std::unique_ptr<ChannelT> Botan::TLS::Stream< StreamLayer, ChannelT >::m_native_handle
protected

◆ m_nextLayer

template<class StreamLayer , class ChannelT = Channel>
StreamLayer Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer
protected

◆ m_receive_buffer

template<class StreamLayer , class ChannelT = Channel>
boost::beast::flat_buffer Botan::TLS::Stream< StreamLayer, ChannelT >::m_receive_buffer
protected

◆ m_send_buffer

template<class StreamLayer , class ChannelT = Channel>
boost::beast::flat_buffer Botan::TLS::Stream< StreamLayer, ChannelT >::m_send_buffer
protected

◆ op [1/3]

template<class StreamLayer , class ChannelT = Channel>
detail::AsyncHandshakeOperation<typename std::decay<HandshakeHandler>::type, Stream> Botan::TLS::Stream< StreamLayer, ChannelT >::op {std::move(init.completion_handler), *this, ec}

Definition at line 269 of file asio_stream.h.

Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::if().

◆ op [2/3]

template<class StreamLayer , class ChannelT = Channel>
detail::AsyncWriteOperation<typename std::decay<WriteHandler>::type, Stream> Botan::TLS::Stream< StreamLayer, ChannelT >::op {std::move(init.completion_handler), *this, boost::asio::buffer_size(buffers)}

Definition at line 486 of file asio_stream.h.

◆ op [3/3]

template<class StreamLayer , class ChannelT = Channel>
detail::AsyncReadOperation<typename std::decay<ReadHandler>::type, Stream, MutableBufferSequence> Botan::TLS::Stream< StreamLayer, ChannelT >::op {std::move(init.completion_handler), *this, buffers}

Definition at line 511 of file asio_stream.h.


The documentation for this class was generated from the following file: