Botan 3.6.1
Crypto and TLS for C&
|
#include <tls_handshake_layer_13.h>
Public Member Functions | |
void | copy_data (std::span< const uint8_t > data_from_peer) |
Handshake_Layer (Connection_Side whoami) | |
bool | has_pending_data () const |
std::optional< Handshake_Message_13 > | next_message (const Policy &policy, Transcript_Hash_State &transcript_hash) |
std::optional< Post_Handshake_Message_13 > | next_post_handshake_message (const Policy &policy) |
void | set_selected_certificate_type (Certificate_Type cert_type) |
Static Public Member Functions | |
static std::vector< uint8_t > | prepare_message (Handshake_Message_13_Ref message, Transcript_Hash_State &transcript_hash) |
static std::vector< uint8_t > | prepare_post_handshake_message (const Post_Handshake_Message_13 &message) |
Implementation of the TLS 1.3 handshake protocol layer
This component transforms payload bytes received in TLS records from the peer into parsed handshake messages and vice versa.
Definition at line 28 of file tls_handshake_layer_13.h.
|
inline |
Definition at line 30 of file tls_handshake_layer_13.h.
void Botan::TLS::Handshake_Layer::copy_data | ( | std::span< const uint8_t > | data_from_peer | ) |
Reads data that was received in handshake records and stores it internally for further processing during the invocation of next_message()
.
data_from_peer | The data to be parsed. |
Definition at line 19 of file tls_handshake_layer_13.cpp.
Referenced by Botan::TLS::Channel_Impl_13::from_peer().
|
inline |
Check if the Handshake_Layer has stored a partial message in its internal buffer. This can happen if a handshake message spans multiple records.
Definition at line 95 of file tls_handshake_layer_13.h.
Referenced by Botan::TLS::Channel_Impl_13::from_peer(), and Botan::TLS::Channel_Impl_13::handle().
std::optional< Handshake_Message_13 > Botan::TLS::Handshake_Layer::next_message | ( | const Policy & | policy, |
Transcript_Hash_State & | transcript_hash ) |
Parses one handshake message off the internal buffer that is being filled using copy_data
.
policy | the TLS policy |
transcript_hash | the transcript hash state to be updated |
Definition at line 119 of file tls_handshake_layer_13.cpp.
References BOTAN_ASSERT_NOMSG, Botan::TLS::TLS_Data_Reader::read_so_far(), and Botan::TLS::Transcript_Hash_State::update().
Referenced by Botan::TLS::Channel_Impl_13::from_peer().
std::optional< Post_Handshake_Message_13 > Botan::TLS::Handshake_Layer::next_post_handshake_message | ( | const Policy & | policy | ) |
Parses one post-handshake message off the internal buffer that is being filled using copy_data
.
policy | the TLS policy |
Definition at line 133 of file tls_handshake_layer_13.cpp.
References Botan::TLS::TLS_Data_Reader::read_so_far().
Referenced by Botan::TLS::Channel_Impl_13::from_peer().
|
static |
Marshalls one handshake message for sending in an (encrypted) record and updates the provided transcript hash state accordingly.
message | the handshake message to be marshalled |
transcript_hash | the transcript hash state to be updated |
Definition at line 172 of file tls_handshake_layer_13.cpp.
References Botan::TLS::Transcript_Hash_State::update().
Referenced by Botan::TLS::Channel_Impl_13::AggregatedHandshakeMessages::add().
|
static |
Marshalls one post-handshake message for sending in an (encrypted) record.
message | the post handshake message to be marshalled |
Definition at line 179 of file tls_handshake_layer_13.cpp.
Referenced by Botan::TLS::Channel_Impl_13::AggregatedPostHandshakeMessages::add().
|
inline |
Set the certificate_type used for parsing Certificate messages. This is determined via (client/server)_certificate_type extensions during the handshake.
RFC 7250 4.3 and 4.4 When the TLS server has specified RawPublicKey as the [client_certificate_type/server_certificate_type], authentication of the TLS [client/server] to the TLS [server/client] is supported only through authentication of the received client SubjectPublicKeyInfo via an out-of-band method.
If the peer sends a Certificate message containing an incompatible means of authentication, a 'decode_error' will be generated.
Definition at line 112 of file tls_handshake_layer_13.h.
Referenced by Botan::TLS::Channel_Impl_13::set_selected_certificate_type().