Botan 3.0.0
Crypto and TLS for C&
|
boost::asio compatible SSL/TLS stream More...
#include <asio_stream.h>
Classes | |
class | StreamCore |
Helper class that implements TLS::Callbacks. More... | |
Public Member Functions | |
bool | shutdown_received () const |
Indicates whether a close_notify alert has been received from the peer. | |
construction | |
template<typename... Args> | |
Stream (std::shared_ptr< Context > context, Args &&... args) | |
Construct a new Stream. | |
template<typename Arg > | |
Stream (Arg &&arg, std::shared_ptr< Context > context) | |
Construct a new Stream. | |
virtual | ~Stream ()=default |
Stream (Stream &&other)=default | |
Stream & | operator= (Stream &&other)=default |
Stream (const Stream &other)=delete | |
Stream & | operator= (const Stream &other)=delete |
configuration and callback setters | |
void | set_verify_callback (Context::Verify_Callback callback) |
Override the tls_verify_cert_chain callback. | |
void | set_verify_callback (Context::Verify_Callback callback, boost::system::error_code &ec) |
Compatibility overload of set_verify_callback. | |
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. | |
void | shutdown () |
Shut down SSL on the stream. | |
template<typename CompletionToken > | |
auto | async_shutdown (CompletionToken &&completion_token) |
Asynchronously shut down SSL on the stream. | |
I/O methods | |
template<typename MutableBufferSequence > | |
std::size_t | read_some (const MutableBufferSequence &buffers, boost::system::error_code &ec) |
Read some data from the stream. | |
template<typename MutableBufferSequence > | |
std::size_t | read_some (const MutableBufferSequence &buffers) |
Read some data from the stream. | |
template<typename ConstBufferSequence > | |
std::size_t | write_some (const ConstBufferSequence &buffers, boost::system::error_code &ec) |
Write some data to the stream. | |
template<typename ConstBufferSequence > | |
std::size_t | write_some (const ConstBufferSequence &buffers) |
Write some data to the stream. | |
template<typename ConstBufferSequence , typename CompletionToken > | |
auto | async_write_some (const ConstBufferSequence &buffers, CompletionToken &&completion_token) |
Start an asynchronous write. The function call always returns immediately. | |
template<typename MutableBufferSequence , typename CompletionToken > | |
auto | async_read_some (const MutableBufferSequence &buffers, CompletionToken &&completion_token) |
Start an asynchronous read. The function call always returns immediately. | |
Protected Member Functions | |
void | consume_send_buffer (std::size_t bytesConsumed) |
Mark bytes in the send buffer as consumed, removing them from the buffer. | |
template<typename MutableBufferSequence > | |
std::size_t | copy_received_data (MutableBufferSequence buffers) |
Copy decrypted data into the user-provided buffer. | |
bool | has_data_to_send () const |
Check if encrypted data is available in the send buffer. | |
bool | has_received_data () const |
Check if decrypted data is available in the receive buffer. | |
const boost::asio::mutable_buffer & | input_buffer () |
void | process_encrypted_data (const boost::asio::const_buffer &read_buffer, boost::system::error_code &ec) |
Pass encrypted data to the native handle for processing. | |
boost::asio::const_buffer | send_buffer () const |
size_t | send_pending_encrypted_data (boost::system::error_code &ec) |
Synchronously write encrypted data from the send buffer to the next layer. | |
void | setup_native_handle (Connection_Side side, boost::system::error_code &ec) |
Create the native handle. | |
template<typename ConstBufferSequence > | |
void | tls_encrypt (const ConstBufferSequence &buffers, boost::system::error_code &ec) |
Pass plaintext data to the native handle for processing. | |
template<typename Fun > | |
void | try_with_error_code (Fun f, boost::system::error_code &ec) |
Catch exceptions and set an error_code. | |
Protected Attributes | |
std::shared_ptr< Context > | m_context |
std::shared_ptr< 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 |
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 |
const next_layer_type & | next_layer () const |
next_layer_type & | next_layer () |
lowest_layer_type & | lowest_layer () |
const lowest_layer_type & | lowest_layer () const |
executor_type | get_executor () noexcept |
native_handle_type | native_handle () |
handshake methods | |
const ConstBufferSequence & | buffers |
const ConstBufferSequence BufferedHandshakeHandler && | handler |
void | handshake (Connection_Side side) |
Performs SSL handshaking. | |
void | handshake (Connection_Side side, boost::system::error_code &ec) |
Performs SSL handshaking. | |
template<typename CompletionToken > | |
auto | async_handshake (Botan::TLS::Connection_Side side, CompletionToken &&completion_token) |
Starts an asynchronous SSL handshake. | |
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") |
boost::asio compatible SSL/TLS stream
StreamLayer | type of the next layer, usually a network socket |
ChannelT | type of the native_handle, defaults to TLS::Channel, only needed for testing purposes |
Definition at line 48 of file asio_stream.h.
using Botan::TLS::Stream< StreamLayer, ChannelT >::executor_type = typename next_layer_type::executor_type |
Definition at line 124 of file asio_stream.h.
using Botan::TLS::Stream< StreamLayer, ChannelT >::lowest_layer_type = typename next_layer_type::lowest_layer_type |
Definition at line 118 of file asio_stream.h.
using Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle_type = typename std::add_pointer<ChannelT>::type |
Definition at line 127 of file asio_stream.h.
using Botan::TLS::Stream< StreamLayer, ChannelT >::next_layer_type = typename std::remove_reference<StreamLayer>::type |
Definition at line 102 of file asio_stream.h.
|
inlineexplicit |
Construct a new Stream.
context | The 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. |
args | Arguments to be forwarded to the construction of the next layer. |
Definition at line 63 of file asio_stream.h.
|
inlineexplicit |
Construct a new Stream.
Convenience overload for boost::asio::ssl::stream compatibility.
arg | This argument is forwarded to the construction of the next layer. |
context | The 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 82 of file asio_stream.h.
|
virtualdefault |
|
default |
|
delete |
|
inline |
Starts an asynchronous SSL handshake.
This function call always returns immediately.
side | The type of handshaking to be performed, i.e. as a client or as a server. |
completion_token | The completion handler to be called when the handshake operation completes. The completion signature of the handler must be: void(boost::system::error_code). |
Definition at line 262 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::BOOST_ASIO_HANDSHAKE_HANDLER_CHECK(), and Botan::TLS::Stream< StreamLayer, ChannelT >::setup_native_handle().
|
inline |
Start an asynchronous read. The function call always returns immediately.
buffers | The 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. |
completion_token | The completion handler to be called when the read operation completes. The completion signature of the handler must be: void(boost::system::error_code, std::size_t). |
Definition at line 556 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers.
|
inline |
Asynchronously shut down SSL on the stream.
This function call always returns immediately.
Note that this can be used in reaction of a received shutdown alert from the peer.
completion_token | The completion handler to be called when the shutdown operation completes. The completion signature of the handler must be: void(boost::system::error_code). |
Definition at line 382 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::get_executor(), Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle(), Botan::TLS::Stream< StreamLayer, ChannelT >::send_buffer(), and Botan::TLS::Stream< StreamLayer, ChannelT >::try_with_error_code().
|
inline |
Start an asynchronous write. The function call always returns immediately.
buffers | The data to be written. |
completion_token | The completion handler to be called when the write operation completes. Copies of the handler will be made as required. The completion signature of the handler must be: void(boost::system::error_code, std::size_t). |
Definition at line 517 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, Botan::TLS::Stream< StreamLayer, ChannelT >::consume_send_buffer(), Botan::TLS::Stream< StreamLayer, ChannelT >::m_core, and Botan::TLS::Stream< StreamLayer, ChannelT >::tls_encrypt().
Botan::TLS::Stream< StreamLayer, ChannelT >::BOOST_ASIO_HANDSHAKE_HANDLER_CHECK | ( | BufferedHandshakeHandler | , |
handler | |||
) |
Botan::TLS::Stream< StreamLayer, ChannelT >::BOOST_ASIO_INITFN_RESULT_TYPE | ( | BufferedHandshakeHandler | , |
void(boost::system::error_code, std::size_t) | |||
) |
Not_Implemented |
|
inlineprotected |
Mark bytes in the send buffer as consumed, removing them from the buffer.
Definition at line 696 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_core.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::async_write_some(), Botan::TLS::detail::AsyncWriteOperation< Handler, Stream, Allocator >::operator()(), and Botan::TLS::Stream< StreamLayer, ChannelT >::send_pending_encrypted_data().
|
inlineprotected |
Copy decrypted data into the user-provided buffer.
Definition at line 681 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, and Botan::TLS::Stream< StreamLayer, ChannelT >::m_core.
Referenced by Botan::TLS::detail::AsyncReadOperation< Handler, Stream, MutableBufferSequence, Allocator >::operator()(), and Botan::TLS::Stream< StreamLayer, ChannelT >::read_some().
|
inlinenoexcept |
Definition at line 125 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::async_shutdown().
|
inline |
Performs SSL handshaking.
The function call will block until handshaking is complete or an error occurs.
side | The type of handshaking to be performed, i.e. as a client or as a server. |
boost::system::system_error | if error occured |
Definition at line 215 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::handshake().
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::handshake().
|
inline |
Performs SSL handshaking.
The function call will block until handshaking is complete or an error occurs.
side | The type of handshaking to be performed, i.e. as a client or as a server. |
ec | Set to indicate what error occurred, if any. |
Definition at line 230 of file asio_stream.h.
References Botan::TLS::Client, 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 >::process_encrypted_data(), Botan::TLS::Stream< StreamLayer, ChannelT >::send_pending_encrypted_data(), and Botan::TLS::Stream< StreamLayer, ChannelT >::setup_native_handle().
|
inlineprotected |
Check if encrypted data is available in the send buffer.
Definition at line 693 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_core.
Referenced by Botan::TLS::detail::AsyncWriteOperation< Handler, Stream, Allocator >::operator()(), and Botan::TLS::detail::AsyncHandshakeOperation< Handler, Stream, Allocator >::operator()().
|
inlineprotected |
Check if decrypted data is available in the receive buffer.
Definition at line 677 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_core.
Referenced by Botan::TLS::detail::AsyncReadOperation< Handler, Stream, MutableBufferSequence, Allocator >::operator()(), and Botan::TLS::Stream< StreamLayer, ChannelT >::read_some().
|
inlineprotected |
Definition at line 673 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_input_buffer.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::handshake(), Botan::TLS::detail::AsyncReadOperation< Handler, Stream, MutableBufferSequence, Allocator >::operator()(), Botan::TLS::detail::AsyncHandshakeOperation< Handler, Stream, Allocator >::operator()(), and Botan::TLS::Stream< StreamLayer, ChannelT >::read_some().
|
inline |
Definition at line 120 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer.
|
inline |
Definition at line 121 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer.
|
inline |
Definition at line 128 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_native_handle.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::async_shutdown(), Botan::TLS::Stream< StreamLayer, ChannelT >::handshake(), Botan::TLS::detail::AsyncHandshakeOperation< Handler, Stream, Allocator >::operator()(), Botan::TLS::Stream< StreamLayer, ChannelT >::process_encrypted_data(), Botan::TLS::Stream< StreamLayer, ChannelT >::shutdown(), and Botan::TLS::Stream< StreamLayer, ChannelT >::tls_encrypt().
|
inline |
Definition at line 105 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer.
|
inline |
Definition at line 104 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer.
Referenced by Botan::TLS::detail::AsyncReadOperation< Handler, Stream, MutableBufferSequence, Allocator >::operator()(), Botan::TLS::detail::AsyncWriteOperation< Handler, Stream, Allocator >::operator()(), and Botan::TLS::detail::AsyncHandshakeOperation< Handler, Stream, Allocator >::operator()().
throw Botan::TLS::Stream< StreamLayer, ChannelT >::Not_Implemented | ( | "buffered async handshake is not implemented" | ) |
|
delete |
|
default |
|
inlineprotected |
Pass encrypted data to the native handle for processing.
If an exception occurs while processing the data, an error code will be set.
read_buffer | Input buffer containing the encrypted data. |
ec | Set to indicate what error occurred, if any. |
Definition at line 798 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle(), and Botan::TLS::Stream< StreamLayer, ChannelT >::try_with_error_code().
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::handshake(), Botan::TLS::detail::AsyncReadOperation< Handler, Stream, MutableBufferSequence, Allocator >::operator()(), Botan::TLS::detail::AsyncHandshakeOperation< Handler, Stream, Allocator >::operator()(), and Botan::TLS::Stream< StreamLayer, ChannelT >::read_some().
|
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.
buffers | The buffers into which the data will be read. |
boost::system::system_error | if error occured |
Definition at line 462 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, and Botan::TLS::Stream< StreamLayer, ChannelT >::read_some().
|
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.
buffers | The buffers into which the data will be read. |
ec | Set to indicate what error occurred, if any. Specifically, StreamTruncated will be set if the peer has closed the connection but did not properly shut down the SSL connection. |
Definition at line 422 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 >::has_received_data(), Botan::TLS::Stream< StreamLayer, ChannelT >::input_buffer(), Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer, Botan::TLS::Stream< StreamLayer, ChannelT >::process_encrypted_data(), Botan::TLS::Stream< StreamLayer, ChannelT >::shutdown_received(), and Botan::TLS::StreamTruncated.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::read_some().
|
inlineprotected |
Definition at line 674 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_core.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::async_shutdown(), Botan::TLS::detail::AsyncWriteOperation< Handler, Stream, Allocator >::operator()(), and Botan::TLS::Stream< StreamLayer, ChannelT >::send_pending_encrypted_data().
|
inlineprotected |
Synchronously write encrypted data from the send buffer to the next layer.
If this function is called with an error code other than 'Success', it will do nothing and return 0.
ec | Set to indicate what error occurred, if any. Specifically, StreamTruncated will be set if the peer has closed the connection but did not properly shut down the SSL connection. |
Definition at line 750 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::consume_send_buffer(), Botan::TLS::Stream< StreamLayer, ChannelT >::m_nextLayer, Botan::TLS::Stream< StreamLayer, ChannelT >::send_buffer(), Botan::TLS::Stream< StreamLayer, ChannelT >::shutdown_received(), and Botan::TLS::StreamTruncated.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::handshake(), Botan::TLS::Stream< StreamLayer, ChannelT >::shutdown(), and Botan::TLS::Stream< StreamLayer, ChannelT >::write_some().
|
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
Definition at line 148 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_context.
|
inline |
Compatibility overload of set_verify_callback.
callback | the callback implementation |
ec | This parameter is unused. |
Definition at line 159 of file asio_stream.h.
References BOTAN_UNUSED, and Botan::TLS::Stream< StreamLayer, ChannelT >::m_context.
|
inline |
Not_Implemented |
Definition at line 166 of file asio_stream.h.
References BOTAN_UNUSED.
|
inline |
Not Implemented.
depth | the desired verification depth |
ec | Will be set to Botan::ErrorType::NotImplemented |
Definition at line 177 of file asio_stream.h.
References BOTAN_UNUSED, and Botan::NotImplemented.
|
inline |
|
inline |
Not Implemented.
v | the desired verify mode |
ec | Will be set to Botan::ErrorType::NotImplemented |
Definition at line 197 of file asio_stream.h.
References BOTAN_UNUSED, and Botan::NotImplemented.
|
inlineprotected |
Create the native handle.
Depending on the desired connection side, this function will create a TLS::Client or a TLS::Server.
side | The desired connection side (client or server) |
ec | Set to indicate what error occurred, if any. |
Definition at line 707 of file asio_stream.h.
References BOTAN_UNUSED, Botan::TLS::Client, Botan::TLS::Stream< StreamLayer, ChannelT >::m_context, Botan::TLS::Stream< StreamLayer, ChannelT >::m_core, Botan::TLS::Stream< StreamLayer, ChannelT >::m_native_handle, and Botan::TLS::Stream< StreamLayer, ChannelT >::try_with_error_code().
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::async_handshake(), and Botan::TLS::Stream< StreamLayer, ChannelT >::handshake().
|
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.
Note that this can be used in reaction of a received shutdown alert from the peer.
boost::system::system_error | if error occured |
Definition at line 329 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::shutdown().
Referenced by 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.
Note that this can be used in reaction of a received shutdown alert from the peer.
ec | Set to indicate what error occured, if any. |
Definition at line 309 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle(), Botan::TLS::Stream< StreamLayer, ChannelT >::send_pending_encrypted_data(), and Botan::TLS::Stream< StreamLayer, ChannelT >::try_with_error_code().
|
inline |
Indicates whether a close_notify alert has been received from the peer.
Note that we cannot m_core.is_closed_for_reading() because this wants to explicitly check that the peer sent close_notify.
Definition at line 580 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::m_core.
Referenced by Botan::TLS::detail::AsyncReadOperation< Handler, Stream, MutableBufferSequence, Allocator >::operator()(), Botan::TLS::detail::AsyncWriteOperation< Handler, Stream, Allocator >::operator()(), Botan::TLS::Stream< StreamLayer, ChannelT >::read_some(), and Botan::TLS::Stream< StreamLayer, ChannelT >::send_pending_encrypted_data().
|
inlineprotected |
Pass plaintext data to the native handle for processing.
The native handle will then create TLS records and hand them back to the Stream via the tls_emit_data callback.
Definition at line 773 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle(), and Botan::TLS::Stream< StreamLayer, ChannelT >::try_with_error_code().
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::async_write_some(), and Botan::TLS::Stream< StreamLayer, ChannelT >::write_some().
|
inlineprotected |
Catch exceptions and set an error_code.
Definition at line 808 of file asio_stream.h.
References Botan::TLS::TLS_Exception::error_type(), Botan::TLS::TLS_Exception::type(), and Botan::Unknown.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::async_shutdown(), Botan::TLS::Stream< StreamLayer, ChannelT >::process_encrypted_data(), Botan::TLS::Stream< StreamLayer, ChannelT >::setup_native_handle(), Botan::TLS::Stream< StreamLayer, ChannelT >::shutdown(), and Botan::TLS::Stream< StreamLayer, ChannelT >::tls_encrypt().
|
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.
buffers | The data to be written. |
boost::system::system_error | if error occured |
Definition at line 500 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, and Botan::TLS::Stream< StreamLayer, ChannelT >::write_some().
|
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.
buffers | The data to be written. |
ec | Set to indicate what error occurred, if any. |
Definition at line 481 of file asio_stream.h.
References Botan::TLS::Stream< StreamLayer, ChannelT >::buffers, 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().
|
friend |
Definition at line 588 of file asio_stream.h.
|
friend |
Definition at line 586 of file asio_stream.h.
|
friend |
Definition at line 587 of file asio_stream.h.
const ConstBufferSequence& Botan::TLS::Stream< StreamLayer, ChannelT >::buffers |
Definition at line 287 of file asio_stream.h.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::async_read_some(), Botan::TLS::Stream< StreamLayer, ChannelT >::async_write_some(), Botan::TLS::Stream< StreamLayer, ChannelT >::copy_received_data(), Botan::TLS::Stream< StreamLayer, ChannelT >::read_some(), Botan::TLS::Stream< StreamLayer, ChannelT >::tls_encrypt(), and Botan::TLS::Stream< StreamLayer, ChannelT >::write_some().
const ConstBufferSequence BufferedHandshakeHandler&& Botan::TLS::Stream< StreamLayer, ChannelT >::handler |
Definition at line 288 of file asio_stream.h.
|
protected |
Definition at line 828 of file asio_stream.h.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::set_verify_callback(), and Botan::TLS::Stream< StreamLayer, ChannelT >::setup_native_handle().
|
protected |
Definition at line 831 of file asio_stream.h.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::async_write_some(), Botan::TLS::Stream< StreamLayer, ChannelT >::consume_send_buffer(), Botan::TLS::Stream< StreamLayer, ChannelT >::copy_received_data(), Botan::TLS::Stream< StreamLayer, ChannelT >::has_data_to_send(), Botan::TLS::Stream< StreamLayer, ChannelT >::has_received_data(), Botan::TLS::Stream< StreamLayer, ChannelT >::send_buffer(), Botan::TLS::Stream< StreamLayer, ChannelT >::setup_native_handle(), and Botan::TLS::Stream< StreamLayer, ChannelT >::shutdown_received().
|
protected |
Definition at line 836 of file asio_stream.h.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::input_buffer().
|
protected |
Definition at line 835 of file asio_stream.h.
|
protected |
Definition at line 832 of file asio_stream.h.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::native_handle(), and Botan::TLS::Stream< StreamLayer, ChannelT >::setup_native_handle().
|
protected |
Definition at line 829 of file asio_stream.h.
Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::get_executor(), Botan::TLS::Stream< StreamLayer, ChannelT >::handshake(), Botan::TLS::Stream< StreamLayer, ChannelT >::lowest_layer(), Botan::TLS::Stream< StreamLayer, ChannelT >::next_layer(), Botan::TLS::Stream< StreamLayer, ChannelT >::read_some(), and Botan::TLS::Stream< StreamLayer, ChannelT >::send_pending_encrypted_data().