Botan 3.0.0-alpha0
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 {
18
19namespace TLS {
20
21/**
22* Protocol Constants for SSL/TLS
23*
24* TODO: this should not be an enum
25*/
26enum Size_Limits : size_t {
29
30 // The "TLSInnerPlaintext" length, i.e. the maximum amount of plaintext
31 // application data that can be transmitted in a single TLS record.
33
36
37 // RFC 8446 5.2:
38 // This limit is derived from the maximum TLSInnerPlaintext length of 2^14
39 // octets + 1 octet for ContentType + the maximum AEAD expansion of 255
40 // octets.
43};
44
45// This will become an enum class in a future major release
46enum Connection_Side { CLIENT = 1, SERVER = 2 };
47
48// This will become an enum class in a future major release
50 INVALID = 0, // RFC 8446 (TLS 1.3)
51
53 ALERT = 21,
56
57 HEARTBEAT = 24, // RFC 6520 (TLS 1.3)
58
59 NO_RECORD = 256
60};
61
62// This will become an enum class in a future major release
68 NEW_SESSION_TICKET = 4, // RFC 5077
69
70 END_OF_EARLY_DATA = 5, // RFC 8446 (TLS 1.3)
71 ENCRYPTED_EXTENSIONS = 8, // RFC 8446 (TLS 1.3)
72
80
83
84 KEY_UPDATE = 24, // RFC 8446 (TLS 1.3)
85
86 HELLO_RETRY_REQUEST = 253, // Not a wire value (HRR appears as an ordinary Server Hello)
87 HANDSHAKE_CCS = 254, // Not a wire value (TLS 1.3 uses this value for 'message_hash' -- RFC 8446 4.4.1)
88 HANDSHAKE_NONE = 255 // Null value
89};
90
92
93using Transcript_Hash = std::vector<uint8_t>;
94
95}
96
97}
98
99#endif
@ HELLO_VERIFY_REQUEST
Definition: tls_magic.h:67
@ CLIENT_KEX
Definition: tls_magic.h:78
@ HANDSHAKE_CCS
Definition: tls_magic.h:87
@ ENCRYPTED_EXTENSIONS
Definition: tls_magic.h:71
@ CERTIFICATE_URL
Definition: tls_magic.h:81
@ SERVER_HELLO
Definition: tls_magic.h:66
@ HELLO_RETRY_REQUEST
Definition: tls_magic.h:86
@ NEW_SESSION_TICKET
Definition: tls_magic.h:68
@ END_OF_EARLY_DATA
Definition: tls_magic.h:70
@ KEY_UPDATE
Definition: tls_magic.h:84
@ SERVER_HELLO_DONE
Definition: tls_magic.h:76
@ HELLO_REQUEST
Definition: tls_magic.h:64
@ CERTIFICATE_REQUEST
Definition: tls_magic.h:75
@ CERTIFICATE
Definition: tls_magic.h:73
@ CERTIFICATE_STATUS
Definition: tls_magic.h:82
@ CERTIFICATE_VERIFY
Definition: tls_magic.h:77
@ HANDSHAKE_NONE
Definition: tls_magic.h:88
@ SERVER_KEX
Definition: tls_magic.h:74
@ CLIENT_HELLO
Definition: tls_magic.h:65
@ CHANGE_CIPHER_SPEC
Definition: tls_magic.h:52
@ APPLICATION_DATA
Definition: tls_magic.h:55
std::vector< uint8_t > Transcript_Hash
Definition: tls_magic.h:93
const char * handshake_type_to_string(Handshake_Type type)
@ MAX_CIPHERTEXT_SIZE
Definition: tls_magic.h:35
@ MAX_PLAINTEXT_SIZE
Definition: tls_magic.h:32
@ MAX_CIPHERTEXT_SIZE_TLS13
Definition: tls_magic.h:42
@ MAX_AEAD_EXPANSION_SIZE_TLS13
Definition: tls_magic.h:41
@ TLS_HEADER_SIZE
Definition: tls_magic.h:27
@ MAX_COMPRESSED_SIZE
Definition: tls_magic.h:34
@ DTLS_HEADER_SIZE
Definition: tls_magic.h:28
Definition: alg_id.cpp:13