Botan 3.14.1
Crypto and TLS for C&
tls_types_13.h
Go to the documentation of this file.
1/**
2 * TLS 1.3 Strong Type Wrappers
3 * (C) 2026 Jack Lloyd
4 * 2026 Amos Treiber, René Meusel - Rohde & Schwarz Networks and Cybersecurity
5 *
6 * Botan is released under the Simplified BSD License (see license.txt)
7 */
8
9#ifndef BOTAN_TLS_TYPES_13_H_
10#define BOTAN_TLS_TYPES_13_H_
11
12#include <botan/strong_type.h>
13#include <functional>
14#include <vector>
15
16namespace Botan::TLS {
17
18using BytesNeeded = size_t;
19
20using SecretLoggerFn = std::function<void(std::string_view label, std::span<const uint8_t> secret)>;
21
22/// Holds the serialization of a single TLS 1.3 handshake message without the
23/// handshake protocol header.
24using SerializedHandshakeMessage = Strong<std::vector<uint8_t>, struct SerializedHandshakeMessage_>;
25
26/// Holds the serialization of a TLS 1.3 handshake protocol header.
27using HandshakeProtocolHeader = Strong<std::array<uint8_t, 4>, struct HandshakeProtocolHeader_>;
28
29/// Holds the serialization of a TLS 1.3 handshake message flight containing
30/// multiple handshake messages along with their handshake protocol headers.
31using MarshalledHandshakeMessageFlight = Strong<std::vector<uint8_t>, struct MarshalledHandshakeMessageFlight_>;
32
33/**
34 * Wraps the epoch0 (unprotected) sequence numbers that are being handed down
35 * from a DTLS 1.3 handshake to a DTLS 1.2 handshake during protocol downgrade.
36 */
38 uint64_t read;
39 uint64_t write;
40};
41
42} // namespace Botan::TLS
43
44#endif
Strong< std::vector< uint8_t >, struct MarshalledHandshakeMessageFlight_ > MarshalledHandshakeMessageFlight
Strong< std::array< uint8_t, 4 >, struct HandshakeProtocolHeader_ > HandshakeProtocolHeader
Holds the serialization of a TLS 1.3 handshake protocol header.
size_t BytesNeeded
Strong< std::vector< uint8_t >, struct SerializedHandshakeMessage_ > SerializedHandshakeMessage
std::function< void(std::string_view label, std::span< const uint8_t > secret)> SecretLoggerFn