Botan 3.6.1
Crypto and TLS for C&
|
#include <tls_channel_impl.h>
Classes | |
struct | Downgrade_Information |
Public Member Functions | |
virtual std::string | application_protocol () const =0 |
void | close () |
bool | expects_downgrade () const |
virtual std::optional< std::string > | external_psk_identity () const =0 |
std::unique_ptr< Downgrade_Information > | extract_downgrade_info () |
virtual size_t | from_peer (std::span< const uint8_t > data)=0 |
virtual bool | is_active () const =0 |
virtual bool | is_closed () const =0 |
virtual bool | is_closed_for_reading () const =0 |
virtual bool | is_closed_for_writing () const =0 |
bool | is_downgrading () const |
virtual bool | is_handshake_complete () const =0 |
virtual SymmetricKey | key_material_export (std::string_view label, std::string_view context, size_t length) const =0 |
virtual bool | new_session_ticket_supported () const |
virtual std::vector< X509_Certificate > | peer_cert_chain () const =0 |
virtual std::shared_ptr< const Public_Key > | peer_raw_public_key () const =0 |
virtual void | renegotiate (bool force_full_renegotiation=false)=0 |
virtual bool | secure_renegotiation_supported () const =0 |
virtual void | send_alert (const Alert &alert)=0 |
void | send_fatal_alert (Alert::Type type) |
virtual size_t | send_new_session_tickets (const size_t) |
void | send_warning_alert (Alert::Type type) |
virtual bool | timeout_check ()=0 |
virtual void | to_peer (std::span< const uint8_t > data)=0 |
virtual void | update_traffic_keys (bool request_peer_update=false)=0 |
virtual | ~Channel_Impl ()=default |
Protected Member Functions | |
void | preserve_client_hello (std::span< const uint8_t > msg) |
void | preserve_peer_transcript (std::span< const uint8_t > input) |
void | request_downgrade () |
void | request_downgrade_for_resumption (Session_with_Handle session) |
void | set_io_buffer_size (size_t io_buf_sz) |
Protected Attributes | |
std::unique_ptr< Downgrade_Information > | m_downgrade_info |
Friends | |
class | Client |
class | Server |
Definition at line 43 of file tls_channel_impl.h.
|
virtualdefault |
|
pure virtual |
Return the protocol notification set for this connection, if any (ALPN). This value is not tied to the session and a later renegotiation of the same session can choose a new protocol.
Implemented in Botan::TLS::Client_Impl_12, Botan::TLS::Client_Impl_13, and Botan::TLS::Server_Impl_13.
|
inline |
Send a close notification alert
Definition at line 80 of file tls_channel_impl.h.
References send_warning_alert().
|
inline |
Definition at line 278 of file tls_channel_impl.h.
References m_downgrade_info.
Referenced by Botan::TLS::Client_Impl_13::Client_Impl_13(), and Botan::TLS::Channel_Impl_13::from_peer().
|
pure virtual |
Implemented in Botan::TLS::Channel_Impl_12, Botan::TLS::Client_Impl_13, and Botan::TLS::Server_Impl_13.
|
inline |
Definition at line 276 of file tls_channel_impl.h.
References m_downgrade_info.
|
pure virtual |
Inject TLS traffic received from counterparty
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
|
pure virtual |
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
|
pure virtual |
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
|
pure virtual |
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
|
pure virtual |
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
|
inline |
Indicates whether a downgrade to TLS 1.2 or lower is in progress
Definition at line 271 of file tls_channel_impl.h.
References m_downgrade_info.
Referenced by Botan::TLS::Channel_Impl_13::from_peer(), Botan::TLS::Channel_Impl_13::key_material_export(), and Botan::TLS::Channel_Impl_13::update_traffic_keys().
|
pure virtual |
Implemented in Botan::TLS::Channel_Impl_12, Botan::TLS::Client_Impl_13, and Botan::TLS::Server_Impl_13.
Referenced by Botan::TLS::Channel_Impl_13::from_peer(), and Botan::TLS::Channel_Impl_13::update_traffic_keys().
|
pure virtual |
Key material export (RFC 5705)
label | a disambiguating label string |
context | a per-association context value |
length | the length of the desired key in bytes |
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
|
inlinevirtual |
Reimplemented in Botan::TLS::Server_Impl_13.
Definition at line 144 of file tls_channel_impl.h.
|
pure virtual |
Implemented in Botan::TLS::Channel_Impl_12, Botan::TLS::Client_Impl_13, and Botan::TLS::Server_Impl_13.
|
pure virtual |
Implemented in Botan::TLS::Channel_Impl_12, Botan::TLS::Client_Impl_13, and Botan::TLS::Server_Impl_13.
|
inlineprotected |
Definition at line 231 of file tls_channel_impl.h.
References BOTAN_STATE_CHECK, and m_downgrade_info.
Referenced by Botan::TLS::Client_Impl_13::Client_Impl_13().
|
inlineprotected |
Definition at line 226 of file tls_channel_impl.h.
References BOTAN_STATE_CHECK, and m_downgrade_info.
Referenced by Botan::TLS::Channel_Impl_13::from_peer().
|
pure virtual |
Attempt to renegotiate the session
force_full_renegotiation | if true, require a full renegotiation, otherwise allow session resumption |
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
|
inlineprotected |
Implementations use this to signal that the peer indicated a protocol version downgrade. After calling request_downgrade()
no further state changes must be perfomed by the implementation. Particularly, no further handshake messages must be emitted. Instead, they must yield control flow back to the underlying Channel implementation to perform the protocol version downgrade.
Definition at line 252 of file tls_channel_impl.h.
References BOTAN_STATE_CHECK, and m_downgrade_info.
Referenced by request_downgrade_for_resumption().
|
inlineprotected |
Definition at line 257 of file tls_channel_impl.h.
References BOTAN_ASSERT_NOMSG, BOTAN_STATE_CHECK, Botan::TLS::Protocol_Version::is_pre_tls_13(), m_downgrade_info, request_downgrade(), Botan::TLS::Session_with_Handle::session, and Botan::TLS::Session_Base::version().
Referenced by Botan::TLS::Client_Impl_13::Client_Impl_13().
|
pure virtual |
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
|
pure virtual |
Send a TLS alert message. If the alert is fatal, the internal state (keys, etc) will be reset.
alert | the Alert to send |
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
Referenced by send_fatal_alert(), and send_warning_alert().
|
inline |
Send a fatal alert
Definition at line 75 of file tls_channel_impl.h.
References Botan::TLS::Alert, and send_alert().
Referenced by Botan::TLS::Channel_Impl_12::from_peer(), and Botan::TLS::Channel_Impl_13::from_peer().
|
inlinevirtual |
Send tickets
new session tickets to the peer. This is only supported on TLS 1.3 servers.
If the server's Session_Manager does not accept the generated Session objects, the server implementation won't be able to send new tickets. Additionally, anything but TLS 1.3 servers will return 0 (because they don't support sending such session tickets).
Reimplemented in Botan::TLS::Server_Impl_13.
Definition at line 157 of file tls_channel_impl.h.
|
inline |
Send a warning alert
Definition at line 70 of file tls_channel_impl.h.
References Botan::TLS::Alert, and send_alert().
Referenced by close().
|
inlineprotected |
Definition at line 239 of file tls_channel_impl.h.
References BOTAN_STATE_CHECK, and m_downgrade_info.
|
pure virtual |
Perform a handshake timeout check. This does nothing unless this is a DTLS channel with a pending handshake state, in which case we check for timeout and potentially retransmit handshake packets.
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
|
pure virtual |
Inject plaintext intended for counterparty Throws an exception if is_active() is false
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
|
pure virtual |
Attempt to update the session's traffic key material Note that this is possible with a TLS 1.3 channel, only.
request_peer_update | if true, require a reciprocal key update |
Implemented in Botan::TLS::Channel_Impl_12, and Botan::TLS::Channel_Impl_13.
|
friend |
Definition at line 236 of file tls_channel_impl.h.
|
friend |
Definition at line 237 of file tls_channel_impl.h.
|
protected |
Definition at line 224 of file tls_channel_impl.h.
Referenced by Botan::TLS::Channel_Impl_13::expect_downgrade(), expects_downgrade(), extract_downgrade_info(), Botan::TLS::Channel_Impl_13::from_peer(), is_downgrading(), preserve_client_hello(), preserve_peer_transcript(), request_downgrade(), request_downgrade_for_resumption(), and set_io_buffer_size().