10#ifndef BOTAN_TLS_RECORD_13_H_
11#define BOTAN_TLS_RECORD_13_H_
13#include <botan/secmem.h>
14#include <botan/tls_magic.h>
15#include <botan/tls_version.h>
16#include <botan/internal/tls_types_13.h>
40using Record = std::variant<ChangeCipherSpec_Record, Alert_Record, Handshake_Record, ApplicationData_Record>;
85 size_t append(std::span<const uint8_t> bytes);
94 size_t stored_bytes()
const {
return m_header_bytes_stored + m_payload.size(); }
98 size_t missing_bytes_hint()
const;
102 uint16_t payload_length()
const;
104 std::span<uint8_t, TLS_HEADER_SIZE> header();
105 std::span<const uint8_t, TLS_HEADER_SIZE> header()
const;
107 std::span<const uint8_t> payload()
const;
111 uint8_t m_header_bytes_stored = 0;
112 std::array<uint8_t, TLS_HEADER_SIZE> m_header = {};
Record_TLS & operator=(const Record_TLS &)=delete
Record_TLS & operator=(Record_TLS &&)=default
Record_TLS(const Record_TLS &)=delete
bool header_complete() const
Returns true if the record has collected all header bytes.
bool complete() const
Returns true if the record has collected all its bytes.
size_t stored_bytes() const
Returns the total number of bytes in this record, including the header.
Record_TLS(Record_TLS &&)=default
size_t missing_bytes_hint() const
Returns the number of bytes needed to complete at least the record.
static std::array< uint8_t, TLS_HEADER_SIZE > serialize_header(Record_Type type, Protocol_Version legacy_version, uint16_t payload_length)
size_t append(std::span< const uint8_t > bytes)
uint16_t payload_length() const
Protocol_Version legacy_version() const
std::variant< ChangeCipherSpec_Record, Alert_Record, Handshake_Record, ApplicationData_Record > Record
Record annotate_record_type(Record_Content &&record)
std::vector< T, secure_allocator< T > > secure_vector
secure_vector< uint8_t > payload
std::optional< uint64_t > sequence_number