|
Botan 3.14.1
Crypto and TLS for C&
|
#include <tls_record_layer_13.h>
Public Types | |
| using | ReadResult = variant_append_t<Record, BytesNeeded> |
Public Member Functions | |
| virtual void | clear_read_buffer ()=0 |
| void | disable_receiving_compat_mode () noexcept |
| uint16_t | incoming_record_size_limit () const noexcept |
| Record_Layer & | operator= (const Record_Layer &)=delete |
| Record_Layer & | operator= (Record_Layer &&)=delete |
| uint16_t | outgoing_record_size_limit () const noexcept |
| bool | receiving_compat_mode () const noexcept |
| Record_Layer (const Record_Layer &)=delete | |
| Record_Layer (Record_Layer &&)=delete | |
| virtual uint16_t | record_payload_size_limit (const Policy &policy, Cipher_State *cipher_state=nullptr) const =0 |
| void | set_record_size_limits (uint16_t outgoing_limit, uint16_t incoming_limit) |
| virtual | ~Record_Layer ()=default |
Record Ingestion | |
| virtual void | copy_data (std::span< const uint8_t > data_from_peer)=0 |
| virtual ReadResult | next_record (Cipher_State *cipher_state=nullptr)=0 |
Record Preparation | |
| virtual void | prepare_record (const Policy &policy, Record_Type type, std::span< const uint8_t > payload, Cipher_State *cipher_state, secure_vector< uint8_t > &out)=0 |
Protected Member Functions | |
| Record_Layer () | |
Implementation of the TLS 1.3 record protocol layer
This component transforms bytes received from the peer into bytes containing plaintext TLS messages and vice versa.
Definition at line 33 of file tls_record_layer_13.h.
Definition at line 44 of file tls_record_layer_13.h.
|
protected |
Definition at line 44 of file tls_record_layer_13.cpp.
References Botan::TLS::MAX_PLAINTEXT_SIZE.
Referenced by operator=(), operator=(), Record_Layer(), and Record_Layer().
|
virtualdefault |
|
delete |
References Record_Layer().
|
delete |
References Record_Layer().
|
pure virtual |
Clears any data currently stored in the read buffer. This is typically used for memory cleanup when the peer sent a CloseNotify alert.
Implemented in Botan::TLS::TLS_Record_Layer.
References set_record_size_limits().
Referenced by Botan::TLS::Channel_IO::notify_closed_for_reading().
|
pure virtual |
Reads data that was received by the peer and stores it internally for further processing during the invocation of next_record().
| data_from_peer | The data to be parsed. |
Implemented in Botan::TLS::TLS_Record_Layer.
Referenced by Botan::TLS::Channel_IO::copy_data().
|
inlinenoexcept |
Definition at line 133 of file tls_record_layer_13.h.
|
inlinenoexcept |
Definition at line 131 of file tls_record_layer_13.h.
Referenced by Botan::TLS::TLS_Record_Layer::next_record().
|
pure virtual |
Parses one record off the internal buffer that is being filled using copy_data.
Return value contains either the number of bytes (size_t) needed to proceed with processing TLS records or a single plaintext TLS record content containing higher level protocol or application data.
| cipher_state | Optional pointer to a Cipher_State instance. If provided, the cipher_state should be ready to decrypt data. Pass nullptr to process plaintext data. |
Implemented in Botan::TLS::TLS_Record_Layer.
Referenced by Botan::TLS::Channel_IO::next_pending_event().
|
delete |
References Record_Layer().
|
delete |
References Record_Layer().
|
inlinenoexcept |
Definition at line 129 of file tls_record_layer_13.h.
Referenced by Botan::TLS::TLS_Record_Layer::prepare_record(), and Botan::TLS::TLS_Record_Layer::record_payload_size_limit().
|
pure virtual |
Prepares a record for transmission.
The payload passed into this function must fit into a single record,
| policy | The TLS policy for record size constraints |
| type | The type of the record to be prepared. |
| payload | The plaintext payload to be included in the record. |
| cipher_state | If not nullptr, the record will be encrypted using this cipher state. Pass nullptr to prepare a plaintext record. |
| out | The container the marshalled record is written to |
Implemented in Botan::TLS::TLS_Record_Layer.
|
inlinenoexcept |
Definition at line 135 of file tls_record_layer_13.h.
Referenced by Botan::TLS::TLS_Record_Layer::next_record().
|
pure virtual |
Returns the maximum number of bytes that can be put into a record.
Both the specified and negotiated record size limit is taken into account. Depending on the cipher_state, the size of the record overhead (e.g. MAC, padding, record header, etc.) is also considered.
Implemented in Botan::TLS::TLS_Record_Layer.
| void Botan::TLS::Record_Layer::set_record_size_limits | ( | uint16_t | outgoing_limit, |
| uint16_t | incoming_limit ) |
Set the record size limits as negotiated by the "record_size_limit" extension (RFC 8449). The limits refer to the number of plaintext bytes to be encrypted/decrypted – INCLUDING the encrypted content type byte introduced with TLS 1.3. The record size limit is not applied to unprotected records. Incoming records that exceed the set limit will result in a fatal alert.
| outgoing_limit | the maximal number of plaintext bytes to be sent in a protected record |
| incoming_limit | the maximal number of plaintext bytes to be accepted in a received protected record |
Definition at line 68 of file tls_record_layer_13.cpp.
References BOTAN_ARG_CHECK, and Botan::TLS::MAX_PLAINTEXT_SIZE.
Referenced by clear_read_buffer(), and Botan::TLS::Channel_IO::set_record_size_limits().