Botan: src/ssl/tls_magic.h Source File

Botan 1.10.17

tls_magic.h
Go to the documentation of this file.
1 /*
2 * SSL/TLS Protocol Constants
3 * (C) 2004-2010 Jack Lloyd
4 *
5 * Released under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_TLS_PROTOCOL_MAGIC_H__
9 #define BOTAN_TLS_PROTOCOL_MAGIC_H__
10
11 namespace Botan {
12
13 /**
14 * Protocol Constants for SSL/TLS
15 */
16 enum Size_Limits {
17 MAX_PLAINTEXT_SIZE = 16*1024,
18 MAX_COMPRESSED_SIZE = MAX_PLAINTEXT_SIZE + 1024,
19 MAX_CIPHERTEXT_SIZE = MAX_COMPRESSED_SIZE + 1024
20 };
21
22 enum Version_Code {
23 NO_VERSION_SET = 0x0000,
24 SSL_V3 = 0x0300,
25 TLS_V10 = 0x0301,
26 TLS_V11 = 0x0302
27 };
28
29 enum Connection_Side { CLIENT, SERVER };
30
31 enum Record_Type {
32 CONNECTION_CLOSED = 0,
33
34 CHANGE_CIPHER_SPEC = 20,
35 ALERT = 21,
36 HANDSHAKE = 22,
37 APPLICATION_DATA = 23
38 };
39
40 enum Handshake_Type {
41 HELLO_REQUEST = 0,
42 CLIENT_HELLO = 1,
43 CLIENT_HELLO_SSLV2 = 255, // not a wire value
44 SERVER_HELLO = 2,
45 CERTIFICATE = 11,
46 SERVER_KEX = 12,
47 CERTIFICATE_REQUEST = 13,
48 SERVER_HELLO_DONE = 14,
49 CERTIFICATE_VERIFY = 15,
50 CLIENT_KEX = 16,
51 FINISHED = 20,
52
53 HANDSHAKE_CCS = 100,
54 HANDSHAKE_NONE = 101
55 };
56
57 enum Alert_Level {
58 WARNING = 1,
59 FATAL = 2
60 };
61
62 enum Alert_Type {
63 CLOSE_NOTIFY = 0,
64 UNEXPECTED_MESSAGE = 10,
65 BAD_RECORD_MAC = 20,
66 DECRYPTION_FAILED = 21,
67 RECORD_OVERFLOW = 22,
68 DECOMPRESSION_FAILURE = 30,
69 HANDSHAKE_FAILURE = 40,
70 BAD_CERTIFICATE = 42,
71 UNSUPPORTED_CERTIFICATE = 43,
72 CERTIFICATE_REVOKED = 44,
73 CERTIFICATE_EXPIRED = 45,
74 CERTIFICATE_UNKNOWN = 46,
75 ILLEGAL_PARAMETER = 47,
76 UNKNOWN_CA = 48,
77 ACCESS_DENIED = 49,
78 DECODE_ERROR = 50,
79 DECRYPT_ERROR = 51,
80 EXPORT_RESTRICTION = 60,
81 PROTOCOL_VERSION = 70,
82 INSUFFICIENT_SECURITY = 71,
83 INTERNAL_ERROR = 80,
84 USER_CANCELED = 90,
85 NO_RENEGOTIATION = 100,
86
87 UNKNOWN_PSK_IDENTITY = 115,
88
89 NO_ALERT_TYPE = 0xFFFF
90 };
91
92 enum Certificate_Type {
93 RSA_CERT = 1,
94 DSS_CERT = 2,
95 DH_RSA_CERT = 3,
96 DH_DSS_CERT = 4
97 };
98
99 enum Ciphersuite_Code {
100 TLS_RSA_WITH_RC4_128_MD5 = 0x0004,
101 TLS_RSA_WITH_RC4_128_SHA = 0x0005,
102
103 TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A,
104 TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F,
105 TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035,
106 TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C,
107 TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D,
108 TLS_RSA_WITH_SEED_CBC_SHA = 0x0096,
109
110 TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013,
111 TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x0032,
112 TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x0038,
113 TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x0040,
114 TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x006A,
115 TLS_DHE_DSS_WITH_SEED_CBC_SHA = 0x0099,
116
117 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016,
118 TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033,
119 TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039,
120 TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067,
121 TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B,
122 TLS_DHE_RSA_WITH_SEED_CBC_SHA = 0x009A,
123
124 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 0xC007,
125 TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC008,
126 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009,
127 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A,
128 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023,
129 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024,
130
131 TLS_ECDHE_RSA_WITH_RC4_128_SHA = 0xC011,
132 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 0xC012,
133 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013,
134 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014,
135 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027,
136 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028,
137
138 TLS_NO_RENEGOTIATION_SCSV = 0x00FF,
139 };
140
141 /*
142 * Form of the ciphersuites broken down by field instead of
143 * being randomly assigned codepoints.
144 */
145 enum TLS_Ciphersuite_Algos {
146 TLS_ALGO_SIGNER_MASK = 0xFF000000,
147 TLS_ALGO_SIGNER_ANON = 0x01000000,
148 TLS_ALGO_SIGNER_RSA = 0x02000000,
149 TLS_ALGO_SIGNER_DSA = 0x03000000,
150 TLS_ALGO_SIGNER_ECDSA = 0x04000000,
151
152 TLS_ALGO_KEYEXCH_MASK = 0x00FF0000,
153 TLS_ALGO_KEYEXCH_NOKEX = 0x00010000,
154 TLS_ALGO_KEYEXCH_RSA = 0x00020000,
155 TLS_ALGO_KEYEXCH_DH = 0x00030000,
156 TLS_ALGO_KEYEXCH_ECDH = 0x00040000,
157
158 TLS_ALGO_MAC_MASK = 0x0000FF00,
159 TLS_ALGO_MAC_MD5 = 0x00000100,
160 TLS_ALGO_MAC_SHA1 = 0x00000200,
161 TLS_ALGO_MAC_SHA256 = 0x00000300,
162 TLS_ALGO_MAC_SHA384 = 0x00000400,
163
164 TLS_ALGO_CIPHER_MASK = 0x000000FF,
165 TLS_ALGO_CIPHER_RC4_128 = 0x00000001,
166 TLS_ALGO_CIPHER_3DES_CBC = 0x00000002,
167 TLS_ALGO_CIPHER_AES128_CBC = 0x00000003,
168 TLS_ALGO_CIPHER_AES256_CBC = 0x00000004,
169 TLS_ALGO_CIPHER_SEED_CBC = 0x00000005
170 };
171
172 enum Compression_Algo {
173 NO_COMPRESSION = 0x00
174 };
175
176 enum TLS_Handshake_Extension_Type {
177 TLSEXT_SERVER_NAME_INDICATION = 0,
178 TLSEXT_MAX_FRAGMENT_LENGTH = 1,
179 TLSEXT_CLIENT_CERT_URL = 2,
180 TLSEXT_TRUSTED_CA_KEYS = 3,
181 TLSEXT_TRUNCATED_HMAC = 4,
182
183 TLSEXT_USABLE_ELLIPTIC_CURVES = 10,
184 TLSEXT_EC_POINT_FORMATS = 11,
185
186 TLSEXT_SRP_IDENTIFIER = 12,
187
188 TLSEXT_CERTIFICATE_TYPES = 9,
189 TLSEXT_SESSION_TICKET = 35
190 };
191
192 }
193
194 #endif
Botan::TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
Definition: tls_magic.h:114
Botan::TLS_ALGO_CIPHER_SEED_CBC
Definition: tls_magic.h:169
Botan::DH_RSA_CERT
Definition: tls_magic.h:95
Botan::TLS_RSA_WITH_SEED_CBC_SHA
Definition: tls_magic.h:108
Botan::TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
Definition: tls_magic.h:136
Botan::TLS_RSA_WITH_AES_256_CBC_SHA
Definition: tls_magic.h:105
Botan::TLS_DHE_DSS_WITH_AES_256_CBC_SHA
Definition: tls_magic.h:112
Botan::CERTIFICATE_EXPIRED
Definition: tls_magic.h:73
Botan::NO_COMPRESSION
Definition: tls_magic.h:173
Botan::TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
Definition: tls_magic.h:126
Botan::TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
Definition: tls_magic.h:125
Botan::TLSEXT_USABLE_ELLIPTIC_CURVES
Definition: tls_magic.h:183
Botan::ALERT
Definition: tls_magic.h:35
Botan::USER_CANCELED
Definition: tls_magic.h:84
Botan::TLS_ALGO_SIGNER_DSA
Definition: tls_magic.h:149
Botan::TLS_DHE_DSS_WITH_AES_128_CBC_SHA
Definition: tls_magic.h:111
Botan::CERTIFICATE_REVOKED
Definition: tls_magic.h:72
Botan::TLS_ALGO_CIPHER_AES256_CBC
Definition: tls_magic.h:168
Botan::TLS_ALGO_KEYEXCH_NOKEX
Definition: tls_magic.h:153
Botan::UNEXPECTED_MESSAGE
Definition: tls_magic.h:64
Botan::TLS_ALGO_SIGNER_ECDSA
Definition: tls_magic.h:150
Botan::NO_VERSION_SET
Definition: tls_magic.h:23
Botan::SERVER
Definition: tls_magic.h:29
Botan::NO_ALERT_TYPE
Definition: tls_magic.h:89
Botan::ACCESS_DENIED
Definition: tls_magic.h:77
Botan::HANDSHAKE_FAILURE
Definition: tls_magic.h:69
Botan::TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
Definition: tls_magic.h:110
Botan::TLS_RSA_WITH_AES_128_CBC_SHA
Definition: tls_magic.h:104
Botan::FINISHED
Definition: tls_magic.h:51
Botan::Record_Type
Record_Type
Definition: tls_magic.h:31
Botan::CERTIFICATE_REQUEST
Definition: tls_magic.h:47
Botan::TLSEXT_SESSION_TICKET
Definition: tls_magic.h:189
Botan::TLS_ECDHE_RSA_WITH_RC4_128_SHA
Definition: tls_magic.h:131
Botan::Compression_Algo
Compression_Algo
Definition: tls_magic.h:172
Botan::TLSEXT_CLIENT_CERT_URL
Definition: tls_magic.h:179
Botan::WARNING
Definition: tls_magic.h:58
Botan::HANDSHAKE
Definition: tls_magic.h:36
Botan::TLS_RSA_WITH_AES_256_CBC_SHA256
Definition: tls_magic.h:107
Botan::TLS_V10
Definition: tls_magic.h:25
Botan::TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
Definition: tls_magic.h:129
Botan::DH_DSS_CERT
Definition: tls_magic.h:96
Botan::TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
Definition: tls_magic.h:120
Botan::SERVER_KEX
Definition: tls_magic.h:46
Botan::CLIENT_HELLO_SSLV2
Definition: tls_magic.h:43
Botan::RSA_CERT
Definition: tls_magic.h:93
Botan::Handshake_Type
Handshake_Type
Definition: tls_magic.h:40
Botan::EXPORT_RESTRICTION
Definition: tls_magic.h:80
Botan::UNSUPPORTED_CERTIFICATE
Definition: tls_magic.h:71
Botan::Ciphersuite_Code
Ciphersuite_Code
Definition: tls_magic.h:99
Botan::Alert_Level
Alert_Level
Definition: tls_magic.h:57
Botan::Connection_Side
Connection_Side
Definition: tls_magic.h:29
Botan::TLS_DHE_DSS_WITH_SEED_CBC_SHA
Definition: tls_magic.h:115
Botan::MAX_PLAINTEXT_SIZE
Definition: tls_magic.h:17
Botan::TLS_RSA_WITH_AES_128_CBC_SHA256
Definition: tls_magic.h:106
Botan::TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
Definition: tls_magic.h:128
Botan::BAD_RECORD_MAC
Definition: tls_magic.h:65
Botan::TLS_NO_RENEGOTIATION_SCSV
Definition: tls_magic.h:138
Botan::TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
Definition: tls_magic.h:113
Botan::TLSEXT_TRUSTED_CA_KEYS
Definition: tls_magic.h:180
Botan::MAX_COMPRESSED_SIZE
Definition: tls_magic.h:18
Botan::TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
Definition: tls_magic.h:124
Botan::TLS_ALGO_MAC_SHA384
Definition: tls_magic.h:162
Botan::TLS_RSA_WITH_RC4_128_MD5
Definition: tls_magic.h:100
Botan::TLS_RSA_WITH_3DES_EDE_CBC_SHA
Definition: tls_magic.h:103
Botan::TLSEXT_EC_POINT_FORMATS
Definition: tls_magic.h:184
Botan::TLS_DHE_RSA_WITH_AES_256_CBC_SHA
Definition: tls_magic.h:119
Botan::TLSEXT_TRUNCATED_HMAC
Definition: tls_magic.h:181
Botan::TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
Definition: tls_magic.h:133
Botan::DECOMPRESSION_FAILURE
Definition: tls_magic.h:68
Botan::PROTOCOL_VERSION
Definition: tls_magic.h:81
Botan::ILLEGAL_PARAMETER
Definition: tls_magic.h:75
Botan::TLS_DHE_RSA_WITH_SEED_CBC_SHA
Definition: tls_magic.h:122
Botan::TLS_ALGO_MAC_MASK
Definition: tls_magic.h:158
Botan::DECRYPT_ERROR
Definition: tls_magic.h:79
Botan::CLOSE_NOTIFY
Definition: tls_magic.h:63
Botan::Version_Code
Version_Code
Definition: tls_magic.h:22
Botan::NO_RENEGOTIATION
Definition: tls_magic.h:85
Botan::TLS_Handshake_Extension_Type
TLS_Handshake_Extension_Type
Definition: tls_magic.h:176
Botan::TLS_ALGO_SIGNER_ANON
Definition: tls_magic.h:147
Botan
Definition: algo_base.h:14
Botan::TLS_ALGO_CIPHER_3DES_CBC
Definition: tls_magic.h:166
Botan::SSL_V3
Definition: tls_magic.h:24
Botan::TLS_ALGO_MAC_MD5
Definition: tls_magic.h:159
Botan::TLS_ALGO_CIPHER_AES128_CBC
Definition: tls_magic.h:167
Botan::TLS_ALGO_MAC_SHA256
Definition: tls_magic.h:161
Botan::UNKNOWN_PSK_IDENTITY
Definition: tls_magic.h:87
Botan::HELLO_REQUEST
Definition: tls_magic.h:41
Botan::TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
Definition: tls_magic.h:135
Botan::INSUFFICIENT_SECURITY
Definition: tls_magic.h:82
Botan::TLS_ALGO_KEYEXCH_DH
Definition: tls_magic.h:155
Botan::Size_Limits
Size_Limits
Definition: tls_magic.h:16
Botan::Alert_Type
Alert_Type
Definition: tls_magic.h:62
Botan::TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
Definition: tls_magic.h:121
Botan::HANDSHAKE_CCS
Definition: tls_magic.h:53
Botan::TLS_DHE_RSA_WITH_AES_128_CBC_SHA
Definition: tls_magic.h:118
Botan::Certificate_Type
Certificate_Type
Definition: tls_magic.h:92
Botan::CERTIFICATE
Definition: tls_magic.h:45
Botan::SERVER_HELLO_DONE
Definition: tls_magic.h:48
Botan::TLS_ALGO_MAC_SHA1
Definition: tls_magic.h:160
Botan::TLSEXT_SRP_IDENTIFIER
Definition: tls_magic.h:186
Botan::TLS_RSA_WITH_RC4_128_SHA
Definition: tls_magic.h:101
Botan::CLIENT_KEX
Definition: tls_magic.h:50
Botan::APPLICATION_DATA
Definition: tls_magic.h:37
Botan::RECORD_OVERFLOW
Definition: tls_magic.h:67
Botan::CONNECTION_CLOSED
Definition: tls_magic.h:32
Botan::DECODE_ERROR
Definition: tls_magic.h:78
Botan::INTERNAL_ERROR
Definition: tls_magic.h:83
Botan::TLS_ALGO_CIPHER_MASK
Definition: tls_magic.h:164
Botan::TLS_V11
Definition: tls_magic.h:26
Botan::TLS_ALGO_KEYEXCH_ECDH
Definition: tls_magic.h:156
Botan::CLIENT_HELLO
Definition: tls_magic.h:42
Botan::TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Definition: tls_magic.h:134
Botan::TLS_ALGO_CIPHER_RC4_128
Definition: tls_magic.h:165
Botan::TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
Definition: tls_magic.h:132
Botan::TLS_Ciphersuite_Algos
TLS_Ciphersuite_Algos
Definition: tls_magic.h:145
Botan::TLSEXT_MAX_FRAGMENT_LENGTH
Definition: tls_magic.h:178
Botan::TLS_ALGO_SIGNER_RSA
Definition: tls_magic.h:148
Botan::TLS_ALGO_KEYEXCH_MASK
Definition: tls_magic.h:152
Botan::TLS_ALGO_SIGNER_MASK
Definition: tls_magic.h:146
Botan::FATAL
Definition: tls_magic.h:59
Botan::TLSEXT_CERTIFICATE_TYPES
Definition: tls_magic.h:188
Botan::DECRYPTION_FAILED
Definition: tls_magic.h:66
Botan::DSS_CERT
Definition: tls_magic.h:94
Botan::TLSEXT_SERVER_NAME_INDICATION
Definition: tls_magic.h:177
Botan::TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
Definition: tls_magic.h:127
Botan::TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
Definition: tls_magic.h:117
Botan::CHANGE_CIPHER_SPEC
Definition: tls_magic.h:34
Botan::TLS_ALGO_KEYEXCH_RSA
Definition: tls_magic.h:154
Botan::HANDSHAKE_NONE
Definition: tls_magic.h:54
Botan::UNKNOWN_CA
Definition: tls_magic.h:76
Botan::BAD_CERTIFICATE
Definition: tls_magic.h:70
Botan::SERVER_HELLO
Definition: tls_magic.h:44
Botan::CLIENT
Definition: tls_magic.h:29
Botan::CERTIFICATE_UNKNOWN
Definition: tls_magic.h:74
Botan::MAX_CIPHERTEXT_SIZE
Definition: tls_magic.h:19
Botan::CERTIFICATE_VERIFY
Definition: tls_magic.h:49