9 #ifndef BOTAN_TLS_BLOCKING_CHANNELS_H__
10 #define BOTAN_TLS_BLOCKING_CHANNELS_H__
12 #include <botan/tls_client.h>
13 #include <botan/tls_server.h>
33 typedef std::function<size_t (uint8_t[], size_t)>
read_fn;
34 typedef std::function<void (const uint8_t[], size_t)>
write_fn;
45 const
std::vector<
std::
string>& next_protos = {});
56 size_t pending()
const {
return m_plaintext.size(); }
62 size_t read(uint8_t buf[],
size_t buf_len);
64 void write(
const uint8_t buf[],
size_t buf_len) { m_channel.send(buf, buf_len); }
69 void close() { m_channel.close(); }
71 bool is_closed()
const {
return m_channel.is_closed(); }
74 {
return m_channel.peer_cert_chain(); }
91 bool handshake_cb(
const Session&);
93 void data_cb(
const uint8_t data[],
size_t data_len);
95 void alert_cb(
const Alert& alert);
98 std::unique_ptr<Compat_Callbacks> m_callbacks;
std::function< size_t(uint8_t[], size_t)> read_fn
virtual void alert_notification(const Alert &)
void write(const uint8_t buf[], size_t buf_len)
TLS::Channel & underlying_channel()
std::function< void(const uint8_t[], size_t)> write_fn
std::vector< T, secure_allocator< T >> secure_vector
class BOTAN_DLL BOTAN_DEPRECATED("LibraryInitializer is no longer required") LibraryInitializer
const TLS::Channel & underlying_channel() const
virtual bool handshake_complete(const Session &)
std::vector< X509_Certificate > peer_cert_chain() const