Botan 3.6.1
Crypto and TLS for C&
tls_magic.h
Go to the documentation of this file.
1/*
2* SSL/TLS Protocol Constants
3* (C) 2004-2010 Jack Lloyd
4*
5* Botan is released under the Simplified BSD License (see license.txt)
6*/
7
8#ifndef BOTAN_TLS_PROTOCOL_MAGIC_H_
9#define BOTAN_TLS_PROTOCOL_MAGIC_H_
10
11#include <vector>
12
13#include <botan/types.h>
14
15//BOTAN_FUTURE_INTERNAL_HEADER(tls_magic.h)
16
17namespace Botan::TLS {
18
19/**
20* Protocol Constants for SSL/TLS
21*
22* TODO: this should not be an enum
23*/
24enum Size_Limits : size_t {
27
28 // The "TLSInnerPlaintext" length, i.e. the maximum amount of plaintext
29 // application data that can be transmitted in a single TLS record.
30 MAX_PLAINTEXT_SIZE = 16 * 1024,
31
34
35 // RFC 8446 5.2:
36 // This limit is derived from the maximum TLSInnerPlaintext length of 2^14
37 // octets + 1 octet for ContentType + the maximum AEAD expansion of 255
38 // octets.
41};
42
43enum class Connection_Side {
44 Client = 1,
45 Server = 2,
46
47 CLIENT BOTAN_DEPRECATED("Use Connection_Side::Client") = Client,
48 SERVER BOTAN_DEPRECATED("Use Connection_Side::Server") = Server,
49};
50
51enum class Handshake_Type {
52 HelloRequest = 0,
53 ClientHello = 1,
54 ServerHello = 2,
56 NewSessionTicket = 4, // RFC 5077
57
58 EndOfEarlyData = 5, // RFC 8446 (TLS 1.3)
59 EncryptedExtensions = 8, // RFC 8446 (TLS 1.3)
60
61 Certificate = 11,
64 ServerHelloDone = 14,
67 Finished = 20,
68
69 CertificateUrl = 21,
71
72 KeyUpdate = 24, // RFC 8446 (TLS 1.3)
73
74 HelloRetryRequest = 253, // Not a wire value (HRR appears as an ordinary Server Hello)
75 HandshakeCCS = 254, // Not a wire value (TLS 1.3 uses this value for 'message_hash' -- RFC 8446 4.4.1)
76 None = 255 // Null value
77};
78
80
81using Transcript_Hash = std::vector<uint8_t>;
82
83} // namespace Botan::TLS
84
85#endif
#define BOTAN_DEPRECATED(msg)
Definition compiler.h:125
#define BOTAN_TEST_API
Definition compiler.h:51
const char * handshake_type_to_string(Handshake_Type type)
std::vector< uint8_t > Transcript_Hash
Definition tls_magic.h:81
@ MAX_CIPHERTEXT_SIZE
Definition tls_magic.h:33
@ MAX_PLAINTEXT_SIZE
Definition tls_magic.h:30
@ MAX_CIPHERTEXT_SIZE_TLS13
Definition tls_magic.h:40
@ MAX_AEAD_EXPANSION_SIZE_TLS13
Definition tls_magic.h:39
@ TLS_HEADER_SIZE
Definition tls_magic.h:25
@ MAX_COMPRESSED_SIZE
Definition tls_magic.h:32
@ DTLS_HEADER_SIZE
Definition tls_magic.h:26