|
Botan 3.14.1
Crypto and TLS for C&
|
#include <tls_handshake_layer_13.h>
Public Member Functions | |
| virtual void | copy_data (const Policy &policy, const Handshake_Record &data_from_peer)=0 |
| Handshake_Layer (const Handshake_Layer &)=delete | |
| Handshake_Layer (Handshake_Layer &&)=delete | |
| virtual bool | has_pending_data () const =0 |
| virtual std::optional< Handshake_Message_13 > | next_message (const Policy &policy, Transcript_Hash_State &transcript_hash)=0 |
| virtual std::optional< Post_Handshake_Message_13 > | next_post_handshake_message (const Policy &policy)=0 |
| Handshake_Layer & | operator= (const Handshake_Layer &)=delete |
| Handshake_Layer & | operator= (Handshake_Layer &&)=delete |
| void | set_selected_certificate_type (Certificate_Type cert_type) |
| virtual | ~Handshake_Layer ()=default |
Static Public Member Functions | |
| 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 |
| Handshake_Layer (Connection_Side whoami) | |
| 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) |
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 30 of file tls_handshake_layer_13.h.
|
strongprotected |
|
inlineexplicitprotected |
Definition at line 32 of file tls_handshake_layer_13.h.
Referenced by Handshake_Layer(), Handshake_Layer(), operator=(), operator=(), and Botan::TLS::TLS_Handshake_Layer::TLS_Handshake_Layer().
|
delete |
References Handshake_Layer().
|
delete |
References Handshake_Layer().
|
virtualdefault |
|
inlineprotected |
Definition at line 128 of file tls_handshake_layer_13.h.
Referenced by parse_handshake_message().
|
pure virtual |
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 |
Implemented in Botan::TLS::TLS_Handshake_Layer.
|
pure virtual |
Check if the Handshake_Layer has stored a partial message in its internal buffer. This can happen if a handshake message spans multiple records.
Implemented in Botan::TLS::TLS_Handshake_Layer.
|
pure virtual |
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 |
Implemented in Botan::TLS::TLS_Handshake_Layer.
|
pure virtual |
Parses one post-handshake message off the internal buffer that is being filled using copy_data.
| policy | the TLS policy |
Implemented in Botan::TLS::TLS_Handshake_Layer.
References update_transcript_for_psk_binder_calc().
|
delete |
References Handshake_Layer().
|
delete |
References Handshake_Layer().
|
protectedvirtual |
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().
|
protected |
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().
|
inlineprotected |
Definition at line 126 of file tls_handshake_layer_13.h.
Referenced by parse_handshake_message(), and parse_post_handshake_message().
|
staticprotected |
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.
|
inlinestatic |
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().
|
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 119 of file tls_handshake_layer_13.h.
Referenced by Botan::TLS::Channel_IO::set_selected_certificate_type().
|
static |
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().