|
Botan 3.14.1
Crypto and TLS for C&
|
#include <tls_handshake_layer_13.h>
Public Member Functions | |
| void | copy_data (const Policy &policy, const Handshake_Record &data_from_peer) override |
| bool | has_pending_data () const override |
| std::optional< Handshake_Message_13 > | next_message (const Policy &policy, Transcript_Hash_State &transcript_hash) override |
| std::optional< Post_Handshake_Message_13 > | next_post_handshake_message (const Policy &policy) override |
| void | set_selected_certificate_type (Certificate_Type cert_type) |
| TLS_Handshake_Layer (Connection_Side whoami) | |
Static Public Member Functions | |
| static HandshakeProtocolHeader | prepare_header (Handshake_Type type, size_t payload_length) |
| static SerializedHandshakeMessage | serialize (const Handshake_Message &message) |
| static void | update_transcript_for_psk_binder_calc (const Client_Hello_13 &message, Transcript_Hash_State &transcript_hash) |
Protected Types | |
| enum class | Handshake_Phase : bool { Handshake , PostHandshake } |
Protected Member Functions | |
| Certificate_Type | certificate_type () const |
| virtual Handshake_Message_13 | parse_handshake_message (Handshake_Type type, std::span< const uint8_t > msg, const Policy &policy) const |
| Post_Handshake_Message_13 | parse_post_handshake_message (Handshake_Type type, std::span< const uint8_t > msg) const |
| Connection_Side | peer () const |
Static Protected Member Functions | |
| static Handshake_Type | read_handshake_message_type (uint8_t value, Handshake_Phase phase) |
Definition at line 141 of file tls_handshake_layer_13.h.
|
strongprotectedinherited |
|
inlineexplicit |
Definition at line 143 of file tls_handshake_layer_13.h.
References Botan::TLS::Handshake_Layer::Handshake_Layer().
|
inlineprotectedinherited |
Definition at line 128 of file tls_handshake_layer_13.h.
Referenced by parse_handshake_message().
|
overridevirtual |
Reads data that was received in handshake records and stores it internally for further processing during the invocation of next_message().
| policy | The TLS policy |
| data_from_peer | The data to be parsed; typically the payload of one handshake record |
Implements Botan::TLS::Handshake_Layer.
Definition at line 137 of file tls_handshake_layer_13.cpp.
References BOTAN_ASSERT_NOMSG, BOTAN_UNUSED, and Botan::TLS::Record_Content::payload.
|
inlineoverridevirtual |
Check if the Handshake_Layer has stored a partial message in its internal buffer. This can happen if a handshake message spans multiple records.
Implements Botan::TLS::Handshake_Layer.
Definition at line 150 of file tls_handshake_layer_13.h.
|
overridevirtual |
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 |
Implements Botan::TLS::Handshake_Layer.
Definition at line 197 of file tls_handshake_layer_13.cpp.
References Botan::TLS::Handshake_Layer::Handshake, Botan::TLS::Handshake_Layer::parse_handshake_message(), and Botan::TLS::Transcript_Hash_State::update().
|
overridevirtual |
Parses one post-handshake message off the internal buffer that is being filled using copy_data.
| policy | the TLS policy |
Implements Botan::TLS::Handshake_Layer.
Definition at line 208 of file tls_handshake_layer_13.cpp.
References Botan::TLS::Handshake_Layer::parse_post_handshake_message(), and Botan::TLS::Handshake_Layer::PostHandshake.
|
protectedvirtualinherited |
Definition at line 30 of file tls_handshake_layer_13.cpp.
References Botan::TLS::Certificate, certificate_type(), Botan::TLS::CertificateRequest, Botan::TLS::CertificateVerify, Botan::TLS::ClientHello, Botan::TLS::EncryptedExtensions, Botan::TLS::Finished, Botan::generalize_to(), Botan::TLS::Client_Hello_13::parse(), Botan::TLS::Server_Hello_13::parse(), peer(), Botan::TLS::ServerHello, and Botan::TLS::UnexpectedMessage.
Referenced by Botan::TLS::TLS_Handshake_Layer::next_message().
|
protectedinherited |
Definition at line 60 of file tls_handshake_layer_13.cpp.
References Botan::TLS::KeyUpdate, Botan::TLS::NewSessionTicket, peer(), and Botan::TLS::UnexpectedMessage.
Referenced by Botan::TLS::TLS_Handshake_Layer::next_post_handshake_message().
|
inlineprotectedinherited |
Definition at line 126 of file tls_handshake_layer_13.h.
Referenced by parse_handshake_message(), and parse_post_handshake_message().
|
static |
Prepare the TLS message header according to RFC9846 Section 4
Definition at line 130 of file tls_handshake_layer_13.cpp.
References BOTAN_ASSERT_NOMSG, and Botan::store_be().
Referenced by Botan::TLS::Handshake_Layer::update_transcript_for_psk_binder_calc().
|
staticprotectedinherited |
Definition at line 78 of file tls_handshake_layer_13.cpp.
References Botan::TLS::Certificate, Botan::TLS::CertificateRequest, Botan::TLS::CertificateStatus, Botan::TLS::CertificateUrl, Botan::TLS::CertificateVerify, Botan::TLS::ClientHello, Botan::TLS::ClientKeyExchange, Botan::TLS::EncryptedExtensions, Botan::TLS::EndOfEarlyData, Botan::TLS::Finished, Handshake, Botan::TLS::HandshakeCCS, Botan::TLS::HelloRequest, Botan::TLS::HelloRetryRequest, Botan::TLS::HelloVerifyRequest, Botan::TLS::KeyUpdate, Botan::TLS::MessageHash, Botan::TLS::NewSessionTicket, Botan::TLS::None, PostHandshake, Botan::TLS::ServerHello, Botan::TLS::ServerHelloDone, Botan::TLS::ServerKeyExchange, and Botan::TLS::UnexpectedMessage.
|
inlinestaticinherited |
Definition at line 46 of file tls_handshake_layer_13.h.
References Botan::TLS::Handshake_Message::serialize().
Referenced by update_transcript_for_psk_binder_calc().
|
inlineinherited |
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 119 of file tls_handshake_layer_13.h.
Referenced by Botan::TLS::Channel_IO::set_selected_certificate_type().
|
staticinherited |
Marshals a ClientHello prematurely for a truncated transcript hash calculation (cf. RFC 8446 Section 4.2.11.2).
| message | the ClientHello message to be marshalled |
| transcript_hash | the transcript hash state to be updated |
Definition at line 72 of file tls_handshake_layer_13.cpp.
References Botan::TLS::TLS_Handshake_Layer::prepare_header(), serialize(), Botan::TLS::Transcript_Hash_State::update(), and Botan::TLS::Handshake_Message::wire_type().
Referenced by next_post_handshake_message().