328b266116b58fc39f0a9053a8ffd0da2780167d
[openssl.git] / include / openssl / tls1.h
1 /*
2  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the OpenSSL license (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 /* ====================================================================
11  * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
12  *
13  * Portions of the attached software ("Contribution") are developed by
14  * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
15  *
16  * The Contribution is licensed pursuant to the OpenSSL open source
17  * license provided above.
18  *
19  * ECC cipher suite support in OpenSSL originally written by
20  * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories.
21  *
22  */
23 /* ====================================================================
24  * Copyright 2005 Nokia. All rights reserved.
25  *
26  * The portions of the attached software ("Contribution") is developed by
27  * Nokia Corporation and is licensed pursuant to the OpenSSL open source
28  * license.
29  *
30  * The Contribution, originally written by Mika Kousa and Pasi Eronen of
31  * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
32  * support (see RFC 4279) to OpenSSL.
33  *
34  * No patent licenses or other rights except those expressly stated in
35  * the OpenSSL open source license shall be deemed granted or received
36  * expressly, by implication, estoppel, or otherwise.
37  *
38  * No assurances are provided by Nokia that the Contribution does not
39  * infringe the patent or other intellectual property rights of any third
40  * party or that the license provides you with all the necessary rights
41  * to make use of the Contribution.
42  *
43  * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
44  * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
45  * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
46  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
47  * OTHERWISE.
48  */
49
50 #ifndef HEADER_TLS1_H
51 # define HEADER_TLS1_H
52
53 # include <openssl/buffer.h>
54 # include <openssl/x509.h>
55
56 #ifdef  __cplusplus
57 extern "C" {
58 #endif
59
60 /* Default security level if not overridden at config time */
61 # ifndef OPENSSL_TLS_SECURITY_LEVEL
62 #  define OPENSSL_TLS_SECURITY_LEVEL 1
63 # endif
64
65 # define TLS1_VERSION                    0x0301
66 # define TLS1_1_VERSION                  0x0302
67 # define TLS1_2_VERSION                  0x0303
68 # define TLS1_3_VERSION                  0x0304
69 # define TLS_MAX_VERSION                 TLS1_3_VERSION
70
71 /* TODO(TLS1.3) REMOVE ME: Version indicator for draft -18 */
72 # define TLS1_3_VERSION_DRAFT            0x7f12
73 # define TLS1_3_VERSION_DRAFT_TXT        "TLS 1.3 (draft 18)"
74
75 /* Special value for method supporting multiple versions */
76 # define TLS_ANY_VERSION                 0x10000
77
78 # define TLS1_VERSION_MAJOR              0x03
79 # define TLS1_VERSION_MINOR              0x01
80
81 # define TLS1_1_VERSION_MAJOR            0x03
82 # define TLS1_1_VERSION_MINOR            0x02
83
84 # define TLS1_2_VERSION_MAJOR            0x03
85 # define TLS1_2_VERSION_MINOR            0x03
86
87 # define TLS1_get_version(s) \
88                 ((SSL_version(s) >> 8) == TLS1_VERSION_MAJOR ? SSL_version(s) : 0)
89
90 # define TLS1_get_client_version(s) \
91                 ((SSL_client_version(s) >> 8) == TLS1_VERSION_MAJOR ? SSL_client_version(s) : 0)
92
93 # define TLS1_AD_DECRYPTION_FAILED       21
94 # define TLS1_AD_RECORD_OVERFLOW         22
95 # define TLS1_AD_UNKNOWN_CA              48/* fatal */
96 # define TLS1_AD_ACCESS_DENIED           49/* fatal */
97 # define TLS1_AD_DECODE_ERROR            50/* fatal */
98 # define TLS1_AD_DECRYPT_ERROR           51
99 # define TLS1_AD_EXPORT_RESTRICTION      60/* fatal */
100 # define TLS1_AD_PROTOCOL_VERSION        70/* fatal */
101 # define TLS1_AD_INSUFFICIENT_SECURITY   71/* fatal */
102 # define TLS1_AD_INTERNAL_ERROR          80/* fatal */
103 # define TLS1_AD_INAPPROPRIATE_FALLBACK  86/* fatal */
104 # define TLS1_AD_USER_CANCELLED          90
105 # define TLS1_AD_NO_RENEGOTIATION        100
106 /* TLSv1.3 alerts */
107 # define TLS13_AD_MISSING_EXTENSION      109 /* fatal */
108 /* codes 110-114 are from RFC3546 */
109 # define TLS1_AD_UNSUPPORTED_EXTENSION   110
110 # define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111
111 # define TLS1_AD_UNRECOGNIZED_NAME       112
112 # define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113
113 # define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114
114 # define TLS1_AD_UNKNOWN_PSK_IDENTITY    115/* fatal */
115 # define TLS1_AD_NO_APPLICATION_PROTOCOL 120 /* fatal */
116
117 /* ExtensionType values from RFC3546 / RFC4366 / RFC6066 */
118 # define TLSEXT_TYPE_server_name                 0
119 # define TLSEXT_TYPE_max_fragment_length         1
120 # define TLSEXT_TYPE_client_certificate_url      2
121 # define TLSEXT_TYPE_trusted_ca_keys             3
122 # define TLSEXT_TYPE_truncated_hmac              4
123 # define TLSEXT_TYPE_status_request              5
124 /* ExtensionType values from RFC4681 */
125 # define TLSEXT_TYPE_user_mapping                6
126 /* ExtensionType values from RFC5878 */
127 # define TLSEXT_TYPE_client_authz                7
128 # define TLSEXT_TYPE_server_authz                8
129 /* ExtensionType values from RFC6091 */
130 # define TLSEXT_TYPE_cert_type           9
131
132 /* ExtensionType values from RFC4492 */
133 /*
134  * Prior to TLSv1.3 the supported_groups extension was known as
135  * elliptic_curves
136  */
137 # define TLSEXT_TYPE_supported_groups            10
138 # define TLSEXT_TYPE_elliptic_curves             TLSEXT_TYPE_supported_groups
139 # define TLSEXT_TYPE_ec_point_formats            11
140
141
142 /* ExtensionType value from RFC5054 */
143 # define TLSEXT_TYPE_srp                         12
144
145 /* ExtensionType values from RFC5246 */
146 # define TLSEXT_TYPE_signature_algorithms        13
147
148 /* ExtensionType value from RFC5764 */
149 # define TLSEXT_TYPE_use_srtp    14
150
151 /* ExtensionType value from RFC5620 */
152 # define TLSEXT_TYPE_heartbeat   15
153
154 /* ExtensionType value from RFC7301 */
155 # define TLSEXT_TYPE_application_layer_protocol_negotiation 16
156
157 /*
158  * Extension type for Certificate Transparency
159  * https://tools.ietf.org/html/rfc6962#section-3.3.1
160  */
161 # define TLSEXT_TYPE_signed_certificate_timestamp    18
162
163 /*
164  * ExtensionType value for TLS padding extension.
165  * http://tools.ietf.org/html/draft-agl-tls-padding
166  */
167 # define TLSEXT_TYPE_padding     21
168
169 /* ExtensionType value from RFC7366 */
170 # define TLSEXT_TYPE_encrypt_then_mac    22
171
172 /* ExtensionType value from RFC7627 */
173 # define TLSEXT_TYPE_extended_master_secret      23
174
175 /* ExtensionType value from RFC4507 */
176 # define TLSEXT_TYPE_session_ticket              35
177
178 /* As defined for TLS1.3 */
179 # define TLSEXT_TYPE_key_share                   40
180 # define TLSEXT_TYPE_psk                         41
181 # define TLSEXT_TYPE_supported_versions          43
182 # define TLSEXT_TYPE_psk_kex_modes               45
183
184 /* Temporary extension type */
185 # define TLSEXT_TYPE_renegotiate                 0xff01
186
187 # ifndef OPENSSL_NO_NEXTPROTONEG
188 /* This is not an IANA defined extension number */
189 #  define TLSEXT_TYPE_next_proto_neg              13172
190 # endif
191
192 /* NameType value from RFC3546 */
193 # define TLSEXT_NAMETYPE_host_name 0
194 /* status request value from RFC3546 */
195 # define TLSEXT_STATUSTYPE_ocsp 1
196
197 /* ECPointFormat values from RFC4492 */
198 # define TLSEXT_ECPOINTFORMAT_first                      0
199 # define TLSEXT_ECPOINTFORMAT_uncompressed               0
200 # define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime  1
201 # define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2  2
202 # define TLSEXT_ECPOINTFORMAT_last                       2
203
204 /* Signature and hash algorithms from RFC5246 */
205 # define TLSEXT_signature_anonymous                      0
206 # define TLSEXT_signature_rsa                            1
207 # define TLSEXT_signature_dsa                            2
208 # define TLSEXT_signature_ecdsa                          3
209 # define TLSEXT_signature_gostr34102001                  237
210 # define TLSEXT_signature_gostr34102012_256              238
211 # define TLSEXT_signature_gostr34102012_512              239
212
213 /* Total number of different signature algorithms */
214 # define TLSEXT_signature_num                            7
215
216 # define TLSEXT_hash_none                                0
217 # define TLSEXT_hash_md5                                 1
218 # define TLSEXT_hash_sha1                                2
219 # define TLSEXT_hash_sha224                              3
220 # define TLSEXT_hash_sha256                              4
221 # define TLSEXT_hash_sha384                              5
222 # define TLSEXT_hash_sha512                              6
223 # define TLSEXT_hash_gostr3411                           237
224 # define TLSEXT_hash_gostr34112012_256                   238
225 # define TLSEXT_hash_gostr34112012_512                   239
226
227 /* Total number of different digest algorithms */
228
229 # define TLSEXT_hash_num                                 10
230
231 /* Flag set for unrecognised algorithms */
232 # define TLSEXT_nid_unknown                              0x1000000
233
234 /* ECC curves */
235
236 # define TLSEXT_curve_P_256                              23
237 # define TLSEXT_curve_P_384                              24
238
239 # define TLSEXT_MAXLEN_host_name 255
240
241 __owur const char *SSL_get_servername(const SSL *s, const int type);
242 __owur int SSL_get_servername_type(const SSL *s);
243 /*
244  * SSL_export_keying_material exports a value derived from the master secret,
245  * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and
246  * optional context. (Since a zero length context is allowed, the |use_context|
247  * flag controls whether a context is included.) It returns 1 on success and
248  * zero otherwise.
249  */
250 __owur int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
251                                const char *label, size_t llen,
252                                const unsigned char *p, size_t plen,
253                                int use_context);
254
255 int SSL_get_sigalgs(SSL *s, int idx,
256                     int *psign, int *phash, int *psignandhash,
257                     unsigned char *rsig, unsigned char *rhash);
258
259 int SSL_get_shared_sigalgs(SSL *s, int idx,
260                            int *psign, int *phash, int *psignandhash,
261                            unsigned char *rsig, unsigned char *rhash);
262
263 __owur int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain);
264
265 # define SSL_set_tlsext_host_name(s,name) \
266 SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name)
267
268 # define SSL_set_tlsext_debug_callback(ssl, cb) \
269 SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,(void (*)(void))cb)
270
271 # define SSL_set_tlsext_debug_arg(ssl, arg) \
272 SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0, (void *)arg)
273
274 # define SSL_get_tlsext_status_type(ssl) \
275 SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE,0, NULL)
276
277 # define SSL_set_tlsext_status_type(ssl, type) \
278 SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type, NULL)
279
280 # define SSL_get_tlsext_status_exts(ssl, arg) \
281 SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg)
282
283 # define SSL_set_tlsext_status_exts(ssl, arg) \
284 SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg)
285
286 # define SSL_get_tlsext_status_ids(ssl, arg) \
287 SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg)
288
289 # define SSL_set_tlsext_status_ids(ssl, arg) \
290 SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg)
291
292 # define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \
293 SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0, (void *)arg)
294
295 # define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \
296 SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen, (void *)arg)
297
298 # define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \
299 SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,(void (*)(void))cb)
300
301 # define SSL_TLSEXT_ERR_OK 0
302 # define SSL_TLSEXT_ERR_ALERT_WARNING 1
303 # define SSL_TLSEXT_ERR_ALERT_FATAL 2
304 # define SSL_TLSEXT_ERR_NOACK 3
305
306 # define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \
307 SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0, (void *)arg)
308
309 # define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \
310         SSL_CTX_ctrl((ctx),SSL_CTRL_GET_TLSEXT_TICKET_KEYS,(keylen),(keys))
311 # define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \
312         SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLSEXT_TICKET_KEYS,(keylen),(keys))
313
314 # define SSL_CTX_get_tlsext_status_cb(ssl, cb) \
315 SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0, (void (**)(void))cb)
316 # define SSL_CTX_set_tlsext_status_cb(ssl, cb) \
317 SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb)
318
319 # define SSL_CTX_get_tlsext_status_arg(ssl, arg) \
320 SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg
321 # define SSL_CTX_set_tlsext_status_arg(ssl, arg) \
322 SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg)
323
324 #define SSL_CTX_set_tlsext_status_type(ssl, type) \
325         SSL_CTX_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE, type, NULL)
326
327 #define SSL_CTX_get_tlsext_status_type(ssl) \
328         SSL_CTX_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE, 0, NULL)
329
330 # define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \
331 SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
332
333 # ifndef OPENSSL_NO_HEARTBEATS
334 #  define SSL_DTLSEXT_HB_ENABLED                   0x01
335 #  define SSL_DTLSEXT_HB_DONT_SEND_REQUESTS        0x02
336 #  define SSL_DTLSEXT_HB_DONT_RECV_REQUESTS        0x04
337 #  define SSL_get_dtlsext_heartbeat_pending(ssl) \
338         SSL_ctrl((ssl),SSL_CTRL_GET_DTLS_EXT_HEARTBEAT_PENDING,0,NULL)
339 #  define SSL_set_dtlsext_heartbeat_no_requests(ssl, arg) \
340         SSL_ctrl((ssl),SSL_CTRL_SET_DTLS_EXT_HEARTBEAT_NO_REQUESTS,arg,NULL)
341
342 #  if OPENSSL_API_COMPAT < 0x10100000L
343 #   define SSL_CTRL_TLS_EXT_SEND_HEARTBEAT \
344         SSL_CTRL_DTLS_EXT_SEND_HEARTBEAT
345 #   define SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING \
346         SSL_CTRL_GET_DTLS_EXT_HEARTBEAT_PENDING
347 #   define SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS \
348         SSL_CTRL_SET_DTLS_EXT_HEARTBEAT_NO_REQUESTS
349 #   define SSL_TLSEXT_HB_ENABLED \
350         SSL_DTLSEXT_HB_ENABLED
351 #   define SSL_TLSEXT_HB_DONT_SEND_REQUESTS \
352         SSL_DTLSEXT_HB_DONT_SEND_REQUESTS
353 #   define SSL_TLSEXT_HB_DONT_RECV_REQUESTS \
354         SSL_DTLSEXT_HB_DONT_RECV_REQUESTS
355 #   define SSL_get_tlsext_heartbeat_pending(ssl) \
356         SSL_get_dtlsext_heartbeat_pending(ssl)
357 #   define SSL_set_tlsext_heartbeat_no_requests(ssl, arg) \
358         SSL_set_dtlsext_heartbeat_no_requests(ssl, arg)
359 #  endif
360 # endif
361
362 /* PSK ciphersuites from 4279 */
363 # define TLS1_CK_PSK_WITH_RC4_128_SHA                    0x0300008A
364 # define TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA               0x0300008B
365 # define TLS1_CK_PSK_WITH_AES_128_CBC_SHA                0x0300008C
366 # define TLS1_CK_PSK_WITH_AES_256_CBC_SHA                0x0300008D
367
368 # define TLS1_CK_DHE_PSK_WITH_RC4_128_SHA                0x0300008E
369 # define TLS1_CK_DHE_PSK_WITH_3DES_EDE_CBC_SHA           0x0300008F
370 # define TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA            0x03000090
371 # define TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA            0x03000091
372
373 # define TLS1_CK_RSA_PSK_WITH_RC4_128_SHA                0x03000092
374 # define TLS1_CK_RSA_PSK_WITH_3DES_EDE_CBC_SHA           0x03000093
375 # define TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA            0x03000094
376 # define TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA            0x03000095
377
378 /* PSK ciphersuites from 5487 */
379 # define TLS1_CK_PSK_WITH_AES_128_GCM_SHA256             0x030000A8
380 # define TLS1_CK_PSK_WITH_AES_256_GCM_SHA384             0x030000A9
381 # define TLS1_CK_DHE_PSK_WITH_AES_128_GCM_SHA256         0x030000AA
382 # define TLS1_CK_DHE_PSK_WITH_AES_256_GCM_SHA384         0x030000AB
383 # define TLS1_CK_RSA_PSK_WITH_AES_128_GCM_SHA256         0x030000AC
384 # define TLS1_CK_RSA_PSK_WITH_AES_256_GCM_SHA384         0x030000AD
385
386 # define TLS1_CK_PSK_WITH_AES_128_CBC_SHA256             0x030000AE
387 # define TLS1_CK_PSK_WITH_AES_256_CBC_SHA384             0x030000AF
388 # define TLS1_CK_PSK_WITH_NULL_SHA256                    0x030000B0
389 # define TLS1_CK_PSK_WITH_NULL_SHA384                    0x030000B1
390
391 # define TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA256         0x030000B2
392 # define TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA384         0x030000B3
393 # define TLS1_CK_DHE_PSK_WITH_NULL_SHA256                0x030000B4
394 # define TLS1_CK_DHE_PSK_WITH_NULL_SHA384                0x030000B5
395
396 # define TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA256         0x030000B6
397 # define TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA384         0x030000B7
398 # define TLS1_CK_RSA_PSK_WITH_NULL_SHA256                0x030000B8
399 # define TLS1_CK_RSA_PSK_WITH_NULL_SHA384                0x030000B9
400
401 /* NULL PSK ciphersuites from RFC4785 */
402 # define TLS1_CK_PSK_WITH_NULL_SHA                       0x0300002C
403 # define TLS1_CK_DHE_PSK_WITH_NULL_SHA                   0x0300002D
404 # define TLS1_CK_RSA_PSK_WITH_NULL_SHA                   0x0300002E
405
406 /* AES ciphersuites from RFC3268 */
407 # define TLS1_CK_RSA_WITH_AES_128_SHA                    0x0300002F
408 # define TLS1_CK_DH_DSS_WITH_AES_128_SHA                 0x03000030
409 # define TLS1_CK_DH_RSA_WITH_AES_128_SHA                 0x03000031
410 # define TLS1_CK_DHE_DSS_WITH_AES_128_SHA                0x03000032
411 # define TLS1_CK_DHE_RSA_WITH_AES_128_SHA                0x03000033
412 # define TLS1_CK_ADH_WITH_AES_128_SHA                    0x03000034
413
414 # define TLS1_CK_RSA_WITH_AES_256_SHA                    0x03000035
415 # define TLS1_CK_DH_DSS_WITH_AES_256_SHA                 0x03000036
416 # define TLS1_CK_DH_RSA_WITH_AES_256_SHA                 0x03000037
417 # define TLS1_CK_DHE_DSS_WITH_AES_256_SHA                0x03000038
418 # define TLS1_CK_DHE_RSA_WITH_AES_256_SHA                0x03000039
419 # define TLS1_CK_ADH_WITH_AES_256_SHA                    0x0300003A
420
421 /* TLS v1.2 ciphersuites */
422 # define TLS1_CK_RSA_WITH_NULL_SHA256                    0x0300003B
423 # define TLS1_CK_RSA_WITH_AES_128_SHA256                 0x0300003C
424 # define TLS1_CK_RSA_WITH_AES_256_SHA256                 0x0300003D
425 # define TLS1_CK_DH_DSS_WITH_AES_128_SHA256              0x0300003E
426 # define TLS1_CK_DH_RSA_WITH_AES_128_SHA256              0x0300003F
427 # define TLS1_CK_DHE_DSS_WITH_AES_128_SHA256             0x03000040
428
429 /* Camellia ciphersuites from RFC4132 */
430 # define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA           0x03000041
431 # define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA        0x03000042
432 # define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA        0x03000043
433 # define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA       0x03000044
434 # define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA       0x03000045
435 # define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA           0x03000046
436
437 /* TLS v1.2 ciphersuites */
438 # define TLS1_CK_DHE_RSA_WITH_AES_128_SHA256             0x03000067
439 # define TLS1_CK_DH_DSS_WITH_AES_256_SHA256              0x03000068
440 # define TLS1_CK_DH_RSA_WITH_AES_256_SHA256              0x03000069
441 # define TLS1_CK_DHE_DSS_WITH_AES_256_SHA256             0x0300006A
442 # define TLS1_CK_DHE_RSA_WITH_AES_256_SHA256             0x0300006B
443 # define TLS1_CK_ADH_WITH_AES_128_SHA256                 0x0300006C
444 # define TLS1_CK_ADH_WITH_AES_256_SHA256                 0x0300006D
445
446 /* Camellia ciphersuites from RFC4132 */
447 # define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA           0x03000084
448 # define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA        0x03000085
449 # define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA        0x03000086
450 # define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA       0x03000087
451 # define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA       0x03000088
452 # define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA           0x03000089
453
454 /* SEED ciphersuites from RFC4162 */
455 # define TLS1_CK_RSA_WITH_SEED_SHA                       0x03000096
456 # define TLS1_CK_DH_DSS_WITH_SEED_SHA                    0x03000097
457 # define TLS1_CK_DH_RSA_WITH_SEED_SHA                    0x03000098
458 # define TLS1_CK_DHE_DSS_WITH_SEED_SHA                   0x03000099
459 # define TLS1_CK_DHE_RSA_WITH_SEED_SHA                   0x0300009A
460 # define TLS1_CK_ADH_WITH_SEED_SHA                       0x0300009B
461
462 /* TLS v1.2 GCM ciphersuites from RFC5288 */
463 # define TLS1_CK_RSA_WITH_AES_128_GCM_SHA256             0x0300009C
464 # define TLS1_CK_RSA_WITH_AES_256_GCM_SHA384             0x0300009D
465 # define TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256         0x0300009E
466 # define TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384         0x0300009F
467 # define TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256          0x030000A0
468 # define TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384          0x030000A1
469 # define TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256         0x030000A2
470 # define TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384         0x030000A3
471 # define TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256          0x030000A4
472 # define TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384          0x030000A5
473 # define TLS1_CK_ADH_WITH_AES_128_GCM_SHA256             0x030000A6
474 # define TLS1_CK_ADH_WITH_AES_256_GCM_SHA384             0x030000A7
475
476 /* CCM ciphersuites from RFC6655 */
477 # define TLS1_CK_RSA_WITH_AES_128_CCM                    0x0300C09C
478 # define TLS1_CK_RSA_WITH_AES_256_CCM                    0x0300C09D
479 # define TLS1_CK_DHE_RSA_WITH_AES_128_CCM                0x0300C09E
480 # define TLS1_CK_DHE_RSA_WITH_AES_256_CCM                0x0300C09F
481 # define TLS1_CK_RSA_WITH_AES_128_CCM_8                  0x0300C0A0
482 # define TLS1_CK_RSA_WITH_AES_256_CCM_8                  0x0300C0A1
483 # define TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8              0x0300C0A2
484 # define TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8              0x0300C0A3
485 # define TLS1_CK_PSK_WITH_AES_128_CCM                    0x0300C0A4
486 # define TLS1_CK_PSK_WITH_AES_256_CCM                    0x0300C0A5
487 # define TLS1_CK_DHE_PSK_WITH_AES_128_CCM                0x0300C0A6
488 # define TLS1_CK_DHE_PSK_WITH_AES_256_CCM                0x0300C0A7
489 # define TLS1_CK_PSK_WITH_AES_128_CCM_8                  0x0300C0A8
490 # define TLS1_CK_PSK_WITH_AES_256_CCM_8                  0x0300C0A9
491 # define TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8              0x0300C0AA
492 # define TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8              0x0300C0AB
493
494 /* CCM ciphersuites from RFC7251 */
495 # define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM            0x0300C0AC
496 # define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM            0x0300C0AD
497 # define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8          0x0300C0AE
498 # define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8          0x0300C0AF
499
500 /* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 */
501 # define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256                0x030000BA
502 # define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256             0x030000BB
503 # define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256             0x030000BC
504 # define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256            0x030000BD
505 # define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256            0x030000BE
506 # define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA256                0x030000BF
507
508 # define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA256                0x030000C0
509 # define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256             0x030000C1
510 # define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256             0x030000C2
511 # define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256            0x030000C3
512 # define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256            0x030000C4
513 # define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256                0x030000C5
514
515 /* ECC ciphersuites from RFC4492 */
516 # define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA                0x0300C001
517 # define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA             0x0300C002
518 # define TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA        0x0300C003
519 # define TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA         0x0300C004
520 # define TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA         0x0300C005
521
522 # define TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA               0x0300C006
523 # define TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA            0x0300C007
524 # define TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA       0x0300C008
525 # define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA        0x0300C009
526 # define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA        0x0300C00A
527
528 # define TLS1_CK_ECDH_RSA_WITH_NULL_SHA                  0x0300C00B
529 # define TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA               0x0300C00C
530 # define TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA          0x0300C00D
531 # define TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA           0x0300C00E
532 # define TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA           0x0300C00F
533
534 # define TLS1_CK_ECDHE_RSA_WITH_NULL_SHA                 0x0300C010
535 # define TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA              0x0300C011
536 # define TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA         0x0300C012
537 # define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA          0x0300C013
538 # define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA          0x0300C014
539
540 # define TLS1_CK_ECDH_anon_WITH_NULL_SHA                 0x0300C015
541 # define TLS1_CK_ECDH_anon_WITH_RC4_128_SHA              0x0300C016
542 # define TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA         0x0300C017
543 # define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA          0x0300C018
544 # define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA          0x0300C019
545
546 /* SRP ciphersuites from RFC 5054 */
547 # define TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA           0x0300C01A
548 # define TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA       0x0300C01B
549 # define TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA       0x0300C01C
550 # define TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA            0x0300C01D
551 # define TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA        0x0300C01E
552 # define TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA        0x0300C01F
553 # define TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA            0x0300C020
554 # define TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA        0x0300C021
555 # define TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA        0x0300C022
556
557 /* ECDH HMAC based ciphersuites from RFC5289 */
558
559 # define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256         0x0300C023
560 # define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384         0x0300C024
561 # define TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256          0x0300C025
562 # define TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384          0x0300C026
563 # define TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256           0x0300C027
564 # define TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384           0x0300C028
565 # define TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256            0x0300C029
566 # define TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384            0x0300C02A
567
568 /* ECDH GCM based ciphersuites from RFC5289 */
569 # define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256     0x0300C02B
570 # define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384     0x0300C02C
571 # define TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256      0x0300C02D
572 # define TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384      0x0300C02E
573 # define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256       0x0300C02F
574 # define TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384       0x0300C030
575 # define TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256        0x0300C031
576 # define TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384        0x0300C032
577
578 /* ECDHE PSK ciphersuites from RFC5489 */
579 # define TLS1_CK_ECDHE_PSK_WITH_RC4_128_SHA              0x0300C033
580 # define TLS1_CK_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA         0x0300C034
581 # define TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA          0x0300C035
582 # define TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA          0x0300C036
583
584 # define TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA256       0x0300C037
585 # define TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA384       0x0300C038
586
587 /* NULL PSK ciphersuites from RFC4785 */
588
589 # define TLS1_CK_ECDHE_PSK_WITH_NULL_SHA                 0x0300C039
590 # define TLS1_CK_ECDHE_PSK_WITH_NULL_SHA256              0x0300C03A
591 # define TLS1_CK_ECDHE_PSK_WITH_NULL_SHA384              0x0300C03B
592
593 /* Camellia-CBC ciphersuites from RFC6367 */
594 # define TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0x0300C072
595 # define TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0x0300C073
596 # define TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256  0x0300C074
597 # define TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384  0x0300C075
598 # define TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256   0x0300C076
599 # define TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384   0x0300C077
600 # define TLS1_CK_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256    0x0300C078
601 # define TLS1_CK_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384    0x0300C079
602
603 # define TLS1_CK_PSK_WITH_CAMELLIA_128_CBC_SHA256         0x0300C094
604 # define TLS1_CK_PSK_WITH_CAMELLIA_256_CBC_SHA384         0x0300C095
605 # define TLS1_CK_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256     0x0300C096
606 # define TLS1_CK_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384     0x0300C097
607 # define TLS1_CK_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256     0x0300C098
608 # define TLS1_CK_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384     0x0300C099
609 # define TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256   0x0300C09A
610 # define TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384   0x0300C09B
611
612 /* draft-ietf-tls-chacha20-poly1305-03 */
613 # define TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305         0x0300CCA8
614 # define TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305       0x0300CCA9
615 # define TLS1_CK_DHE_RSA_WITH_CHACHA20_POLY1305           0x0300CCAA
616 # define TLS1_CK_PSK_WITH_CHACHA20_POLY1305               0x0300CCAB
617 # define TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305         0x0300CCAC
618 # define TLS1_CK_DHE_PSK_WITH_CHACHA20_POLY1305           0x0300CCAD
619 # define TLS1_CK_RSA_PSK_WITH_CHACHA20_POLY1305           0x0300CCAE
620
621 /* TLS v1.3 ciphersuites */
622 # define TLS1_3_CK_AES_128_GCM_SHA256                     0x03001301
623
624 /*
625  * XXX Backward compatibility alert: Older versions of OpenSSL gave some DHE
626  * ciphers names with "EDH" instead of "DHE".  Going forward, we should be
627  * using DHE everywhere, though we may indefinitely maintain aliases for
628  * users or configurations that used "EDH"
629  */
630 # define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA               "DHE-DSS-RC4-SHA"
631
632 # define TLS1_TXT_PSK_WITH_NULL_SHA                      "PSK-NULL-SHA"
633 # define TLS1_TXT_DHE_PSK_WITH_NULL_SHA                  "DHE-PSK-NULL-SHA"
634 # define TLS1_TXT_RSA_PSK_WITH_NULL_SHA                  "RSA-PSK-NULL-SHA"
635
636 /* AES ciphersuites from RFC3268 */
637 # define TLS1_TXT_RSA_WITH_AES_128_SHA                   "AES128-SHA"
638 # define TLS1_TXT_DH_DSS_WITH_AES_128_SHA                "DH-DSS-AES128-SHA"
639 # define TLS1_TXT_DH_RSA_WITH_AES_128_SHA                "DH-RSA-AES128-SHA"
640 # define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA               "DHE-DSS-AES128-SHA"
641 # define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA               "DHE-RSA-AES128-SHA"
642 # define TLS1_TXT_ADH_WITH_AES_128_SHA                   "ADH-AES128-SHA"
643
644 # define TLS1_TXT_RSA_WITH_AES_256_SHA                   "AES256-SHA"
645 # define TLS1_TXT_DH_DSS_WITH_AES_256_SHA                "DH-DSS-AES256-SHA"
646 # define TLS1_TXT_DH_RSA_WITH_AES_256_SHA                "DH-RSA-AES256-SHA"
647 # define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA               "DHE-DSS-AES256-SHA"
648 # define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA               "DHE-RSA-AES256-SHA"
649 # define TLS1_TXT_ADH_WITH_AES_256_SHA                   "ADH-AES256-SHA"
650
651 /* ECC ciphersuites from RFC4492 */
652 # define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA               "ECDH-ECDSA-NULL-SHA"
653 # define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA            "ECDH-ECDSA-RC4-SHA"
654 # define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA       "ECDH-ECDSA-DES-CBC3-SHA"
655 # define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA        "ECDH-ECDSA-AES128-SHA"
656 # define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA        "ECDH-ECDSA-AES256-SHA"
657
658 # define TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA              "ECDHE-ECDSA-NULL-SHA"
659 # define TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA           "ECDHE-ECDSA-RC4-SHA"
660 # define TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA      "ECDHE-ECDSA-DES-CBC3-SHA"
661 # define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA       "ECDHE-ECDSA-AES128-SHA"
662 # define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA       "ECDHE-ECDSA-AES256-SHA"
663
664 # define TLS1_TXT_ECDH_RSA_WITH_NULL_SHA                 "ECDH-RSA-NULL-SHA"
665 # define TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA              "ECDH-RSA-RC4-SHA"
666 # define TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA         "ECDH-RSA-DES-CBC3-SHA"
667 # define TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA          "ECDH-RSA-AES128-SHA"
668 # define TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA          "ECDH-RSA-AES256-SHA"
669
670 # define TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA                "ECDHE-RSA-NULL-SHA"
671 # define TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA             "ECDHE-RSA-RC4-SHA"
672 # define TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA        "ECDHE-RSA-DES-CBC3-SHA"
673 # define TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA         "ECDHE-RSA-AES128-SHA"
674 # define TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA         "ECDHE-RSA-AES256-SHA"
675
676 # define TLS1_TXT_ECDH_anon_WITH_NULL_SHA                "AECDH-NULL-SHA"
677 # define TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA             "AECDH-RC4-SHA"
678 # define TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA        "AECDH-DES-CBC3-SHA"
679 # define TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA         "AECDH-AES128-SHA"
680 # define TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA         "AECDH-AES256-SHA"
681
682 /* PSK ciphersuites from RFC 4279 */
683 # define TLS1_TXT_PSK_WITH_RC4_128_SHA                   "PSK-RC4-SHA"
684 # define TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA              "PSK-3DES-EDE-CBC-SHA"
685 # define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA               "PSK-AES128-CBC-SHA"
686 # define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA               "PSK-AES256-CBC-SHA"
687
688 # define TLS1_TXT_DHE_PSK_WITH_RC4_128_SHA               "DHE-PSK-RC4-SHA"
689 # define TLS1_TXT_DHE_PSK_WITH_3DES_EDE_CBC_SHA          "DHE-PSK-3DES-EDE-CBC-SHA"
690 # define TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA           "DHE-PSK-AES128-CBC-SHA"
691 # define TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA           "DHE-PSK-AES256-CBC-SHA"
692 # define TLS1_TXT_RSA_PSK_WITH_RC4_128_SHA               "RSA-PSK-RC4-SHA"
693 # define TLS1_TXT_RSA_PSK_WITH_3DES_EDE_CBC_SHA          "RSA-PSK-3DES-EDE-CBC-SHA"
694 # define TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA           "RSA-PSK-AES128-CBC-SHA"
695 # define TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA           "RSA-PSK-AES256-CBC-SHA"
696
697 /* PSK ciphersuites from RFC 5487 */
698 # define TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256            "PSK-AES128-GCM-SHA256"
699 # define TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384            "PSK-AES256-GCM-SHA384"
700 # define TLS1_TXT_DHE_PSK_WITH_AES_128_GCM_SHA256        "DHE-PSK-AES128-GCM-SHA256"
701 # define TLS1_TXT_DHE_PSK_WITH_AES_256_GCM_SHA384        "DHE-PSK-AES256-GCM-SHA384"
702 # define TLS1_TXT_RSA_PSK_WITH_AES_128_GCM_SHA256        "RSA-PSK-AES128-GCM-SHA256"
703 # define TLS1_TXT_RSA_PSK_WITH_AES_256_GCM_SHA384        "RSA-PSK-AES256-GCM-SHA384"
704
705 # define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA256            "PSK-AES128-CBC-SHA256"
706 # define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA384            "PSK-AES256-CBC-SHA384"
707 # define TLS1_TXT_PSK_WITH_NULL_SHA256                   "PSK-NULL-SHA256"
708 # define TLS1_TXT_PSK_WITH_NULL_SHA384                   "PSK-NULL-SHA384"
709
710 # define TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA256        "DHE-PSK-AES128-CBC-SHA256"
711 # define TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA384        "DHE-PSK-AES256-CBC-SHA384"
712 # define TLS1_TXT_DHE_PSK_WITH_NULL_SHA256               "DHE-PSK-NULL-SHA256"
713 # define TLS1_TXT_DHE_PSK_WITH_NULL_SHA384               "DHE-PSK-NULL-SHA384"
714
715 # define TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA256        "RSA-PSK-AES128-CBC-SHA256"
716 # define TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA384        "RSA-PSK-AES256-CBC-SHA384"
717 # define TLS1_TXT_RSA_PSK_WITH_NULL_SHA256               "RSA-PSK-NULL-SHA256"
718 # define TLS1_TXT_RSA_PSK_WITH_NULL_SHA384               "RSA-PSK-NULL-SHA384"
719
720 /* SRP ciphersuite from RFC 5054 */
721 # define TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA          "SRP-3DES-EDE-CBC-SHA"
722 # define TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA      "SRP-RSA-3DES-EDE-CBC-SHA"
723 # define TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA      "SRP-DSS-3DES-EDE-CBC-SHA"
724 # define TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA           "SRP-AES-128-CBC-SHA"
725 # define TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA       "SRP-RSA-AES-128-CBC-SHA"
726 # define TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA       "SRP-DSS-AES-128-CBC-SHA"
727 # define TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA           "SRP-AES-256-CBC-SHA"
728 # define TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA       "SRP-RSA-AES-256-CBC-SHA"
729 # define TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA       "SRP-DSS-AES-256-CBC-SHA"
730
731 /* Camellia ciphersuites from RFC4132 */
732 # define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA          "CAMELLIA128-SHA"
733 # define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA       "DH-DSS-CAMELLIA128-SHA"
734 # define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA       "DH-RSA-CAMELLIA128-SHA"
735 # define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA      "DHE-DSS-CAMELLIA128-SHA"
736 # define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA      "DHE-RSA-CAMELLIA128-SHA"
737 # define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA          "ADH-CAMELLIA128-SHA"
738
739 # define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA          "CAMELLIA256-SHA"
740 # define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA       "DH-DSS-CAMELLIA256-SHA"
741 # define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA       "DH-RSA-CAMELLIA256-SHA"
742 # define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA      "DHE-DSS-CAMELLIA256-SHA"
743 # define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA      "DHE-RSA-CAMELLIA256-SHA"
744 # define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA          "ADH-CAMELLIA256-SHA"
745
746 /* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 */
747 # define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA256               "CAMELLIA128-SHA256"
748 # define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256            "DH-DSS-CAMELLIA128-SHA256"
749 # define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256            "DH-RSA-CAMELLIA128-SHA256"
750 # define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256           "DHE-DSS-CAMELLIA128-SHA256"
751 # define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256           "DHE-RSA-CAMELLIA128-SHA256"
752 # define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA256               "ADH-CAMELLIA128-SHA256"
753
754 # define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA256               "CAMELLIA256-SHA256"
755 # define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256            "DH-DSS-CAMELLIA256-SHA256"
756 # define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256            "DH-RSA-CAMELLIA256-SHA256"
757 # define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256           "DHE-DSS-CAMELLIA256-SHA256"
758 # define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256           "DHE-RSA-CAMELLIA256-SHA256"
759 # define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA256               "ADH-CAMELLIA256-SHA256"
760
761 # define TLS1_TXT_PSK_WITH_CAMELLIA_128_CBC_SHA256               "PSK-CAMELLIA128-SHA256"
762 # define TLS1_TXT_PSK_WITH_CAMELLIA_256_CBC_SHA384               "PSK-CAMELLIA256-SHA384"
763 # define TLS1_TXT_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256           "DHE-PSK-CAMELLIA128-SHA256"
764 # define TLS1_TXT_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384           "DHE-PSK-CAMELLIA256-SHA384"
765 # define TLS1_TXT_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256           "RSA-PSK-CAMELLIA128-SHA256"
766 # define TLS1_TXT_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384           "RSA-PSK-CAMELLIA256-SHA384"
767 # define TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256         "ECDHE-PSK-CAMELLIA128-SHA256"
768 # define TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384         "ECDHE-PSK-CAMELLIA256-SHA384"
769
770 /* SEED ciphersuites from RFC4162 */
771 # define TLS1_TXT_RSA_WITH_SEED_SHA                      "SEED-SHA"
772 # define TLS1_TXT_DH_DSS_WITH_SEED_SHA                   "DH-DSS-SEED-SHA"
773 # define TLS1_TXT_DH_RSA_WITH_SEED_SHA                   "DH-RSA-SEED-SHA"
774 # define TLS1_TXT_DHE_DSS_WITH_SEED_SHA                  "DHE-DSS-SEED-SHA"
775 # define TLS1_TXT_DHE_RSA_WITH_SEED_SHA                  "DHE-RSA-SEED-SHA"
776 # define TLS1_TXT_ADH_WITH_SEED_SHA                      "ADH-SEED-SHA"
777
778 /* TLS v1.2 ciphersuites */
779 # define TLS1_TXT_RSA_WITH_NULL_SHA256                   "NULL-SHA256"
780 # define TLS1_TXT_RSA_WITH_AES_128_SHA256                "AES128-SHA256"
781 # define TLS1_TXT_RSA_WITH_AES_256_SHA256                "AES256-SHA256"
782 # define TLS1_TXT_DH_DSS_WITH_AES_128_SHA256             "DH-DSS-AES128-SHA256"
783 # define TLS1_TXT_DH_RSA_WITH_AES_128_SHA256             "DH-RSA-AES128-SHA256"
784 # define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256            "DHE-DSS-AES128-SHA256"
785 # define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256            "DHE-RSA-AES128-SHA256"
786 # define TLS1_TXT_DH_DSS_WITH_AES_256_SHA256             "DH-DSS-AES256-SHA256"
787 # define TLS1_TXT_DH_RSA_WITH_AES_256_SHA256             "DH-RSA-AES256-SHA256"
788 # define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256            "DHE-DSS-AES256-SHA256"
789 # define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256            "DHE-RSA-AES256-SHA256"
790 # define TLS1_TXT_ADH_WITH_AES_128_SHA256                "ADH-AES128-SHA256"
791 # define TLS1_TXT_ADH_WITH_AES_256_SHA256                "ADH-AES256-SHA256"
792
793 /* TLS v1.2 GCM ciphersuites from RFC5288 */
794 # define TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256            "AES128-GCM-SHA256"
795 # define TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384            "AES256-GCM-SHA384"
796 # define TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256        "DHE-RSA-AES128-GCM-SHA256"
797 # define TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384        "DHE-RSA-AES256-GCM-SHA384"
798 # define TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256         "DH-RSA-AES128-GCM-SHA256"
799 # define TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384         "DH-RSA-AES256-GCM-SHA384"
800 # define TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256        "DHE-DSS-AES128-GCM-SHA256"
801 # define TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384        "DHE-DSS-AES256-GCM-SHA384"
802 # define TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256         "DH-DSS-AES128-GCM-SHA256"
803 # define TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384         "DH-DSS-AES256-GCM-SHA384"
804 # define TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256            "ADH-AES128-GCM-SHA256"
805 # define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384            "ADH-AES256-GCM-SHA384"
806
807 /* CCM ciphersuites from RFC6655 */
808
809 # define TLS1_TXT_RSA_WITH_AES_128_CCM                   "AES128-CCM"
810 # define TLS1_TXT_RSA_WITH_AES_256_CCM                   "AES256-CCM"
811 # define TLS1_TXT_DHE_RSA_WITH_AES_128_CCM               "DHE-RSA-AES128-CCM"
812 # define TLS1_TXT_DHE_RSA_WITH_AES_256_CCM               "DHE-RSA-AES256-CCM"
813
814 # define TLS1_TXT_RSA_WITH_AES_128_CCM_8                 "AES128-CCM8"
815 # define TLS1_TXT_RSA_WITH_AES_256_CCM_8                 "AES256-CCM8"
816 # define TLS1_TXT_DHE_RSA_WITH_AES_128_CCM_8             "DHE-RSA-AES128-CCM8"
817 # define TLS1_TXT_DHE_RSA_WITH_AES_256_CCM_8             "DHE-RSA-AES256-CCM8"
818
819 # define TLS1_TXT_PSK_WITH_AES_128_CCM                   "PSK-AES128-CCM"
820 # define TLS1_TXT_PSK_WITH_AES_256_CCM                   "PSK-AES256-CCM"
821 # define TLS1_TXT_DHE_PSK_WITH_AES_128_CCM               "DHE-PSK-AES128-CCM"
822 # define TLS1_TXT_DHE_PSK_WITH_AES_256_CCM               "DHE-PSK-AES256-CCM"
823
824 # define TLS1_TXT_PSK_WITH_AES_128_CCM_8                 "PSK-AES128-CCM8"
825 # define TLS1_TXT_PSK_WITH_AES_256_CCM_8                 "PSK-AES256-CCM8"
826 # define TLS1_TXT_DHE_PSK_WITH_AES_128_CCM_8             "DHE-PSK-AES128-CCM8"
827 # define TLS1_TXT_DHE_PSK_WITH_AES_256_CCM_8             "DHE-PSK-AES256-CCM8"
828
829 /* CCM ciphersuites from RFC7251 */
830
831 # define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM       "ECDHE-ECDSA-AES128-CCM"
832 # define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM       "ECDHE-ECDSA-AES256-CCM"
833 # define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM_8     "ECDHE-ECDSA-AES128-CCM8"
834 # define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8     "ECDHE-ECDSA-AES256-CCM8"
835
836 /* ECDH HMAC based ciphersuites from RFC5289 */
837
838 # define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256    "ECDHE-ECDSA-AES128-SHA256"
839 # define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384    "ECDHE-ECDSA-AES256-SHA384"
840 # define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256     "ECDH-ECDSA-AES128-SHA256"
841 # define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384     "ECDH-ECDSA-AES256-SHA384"
842 # define TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256      "ECDHE-RSA-AES128-SHA256"
843 # define TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384      "ECDHE-RSA-AES256-SHA384"
844 # define TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256       "ECDH-RSA-AES128-SHA256"
845 # define TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384       "ECDH-RSA-AES256-SHA384"
846
847 /* ECDH GCM based ciphersuites from RFC5289 */
848 # define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256    "ECDHE-ECDSA-AES128-GCM-SHA256"
849 # define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384    "ECDHE-ECDSA-AES256-GCM-SHA384"
850 # define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256     "ECDH-ECDSA-AES128-GCM-SHA256"
851 # define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384     "ECDH-ECDSA-AES256-GCM-SHA384"
852 # define TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256      "ECDHE-RSA-AES128-GCM-SHA256"
853 # define TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384      "ECDHE-RSA-AES256-GCM-SHA384"
854 # define TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256       "ECDH-RSA-AES128-GCM-SHA256"
855 # define TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384       "ECDH-RSA-AES256-GCM-SHA384"
856
857 /* TLS v1.2 PSK GCM ciphersuites from RFC5487 */
858 # define TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256            "PSK-AES128-GCM-SHA256"
859 # define TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384            "PSK-AES256-GCM-SHA384"
860
861 /* ECDHE PSK ciphersuites from RFC 5489 */
862 # define TLS1_TXT_ECDHE_PSK_WITH_RC4_128_SHA               "ECDHE-PSK-RC4-SHA"
863 # define TLS1_TXT_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA          "ECDHE-PSK-3DES-EDE-CBC-SHA"
864 # define TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA           "ECDHE-PSK-AES128-CBC-SHA"
865 # define TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA           "ECDHE-PSK-AES256-CBC-SHA"
866
867 # define TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA256        "ECDHE-PSK-AES128-CBC-SHA256"
868 # define TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA384        "ECDHE-PSK-AES256-CBC-SHA384"
869
870 # define TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA                  "ECDHE-PSK-NULL-SHA"
871 # define TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA256               "ECDHE-PSK-NULL-SHA256"
872 # define TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA384               "ECDHE-PSK-NULL-SHA384"
873
874 /* Camellia-CBC ciphersuites from RFC6367 */
875 # define TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 "ECDHE-ECDSA-CAMELLIA128-SHA256"
876 # define TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 "ECDHE-ECDSA-CAMELLIA256-SHA384"
877 # define TLS1_TXT_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256  "ECDH-ECDSA-CAMELLIA128-SHA256"
878 # define TLS1_TXT_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384  "ECDH-ECDSA-CAMELLIA256-SHA384"
879 # define TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256   "ECDHE-RSA-CAMELLIA128-SHA256"
880 # define TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384   "ECDHE-RSA-CAMELLIA256-SHA384"
881 # define TLS1_TXT_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256    "ECDH-RSA-CAMELLIA128-SHA256"
882 # define TLS1_TXT_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384    "ECDH-RSA-CAMELLIA256-SHA384"
883
884 /* draft-ietf-tls-chacha20-poly1305-03 */
885 # define TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305         "ECDHE-RSA-CHACHA20-POLY1305"
886 # define TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305       "ECDHE-ECDSA-CHACHA20-POLY1305"
887 # define TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305           "DHE-RSA-CHACHA20-POLY1305"
888 # define TLS1_TXT_PSK_WITH_CHACHA20_POLY1305               "PSK-CHACHA20-POLY1305"
889 # define TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305         "ECDHE-PSK-CHACHA20-POLY1305"
890 # define TLS1_TXT_DHE_PSK_WITH_CHACHA20_POLY1305           "DHE-PSK-CHACHA20-POLY1305"
891 # define TLS1_TXT_RSA_PSK_WITH_CHACHA20_POLY1305           "RSA-PSK-CHACHA20-POLY1305"
892
893 /* TLSv1.3 ciphersuites */
894 /*
895  * TODO(TLS1.3): Review the naming scheme for TLSv1.3 ciphers and also the
896  * cipherstring selection process for these ciphers
897  */
898 # define TLS1_3_TXT_AES_128_GCM_SHA256                     "TLS13-AES-128-GCM-SHA256"
899
900 # define TLS_CT_RSA_SIGN                 1
901 # define TLS_CT_DSS_SIGN                 2
902 # define TLS_CT_RSA_FIXED_DH             3
903 # define TLS_CT_DSS_FIXED_DH             4
904 # define TLS_CT_ECDSA_SIGN               64
905 # define TLS_CT_RSA_FIXED_ECDH           65
906 # define TLS_CT_ECDSA_FIXED_ECDH         66
907 # define TLS_CT_GOST01_SIGN              22
908 # define TLS_CT_GOST12_SIGN              238
909 # define TLS_CT_GOST12_512_SIGN          239
910
911 /*
912  * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see
913  * comment there)
914  */
915 # define TLS_CT_NUMBER                   9
916
917 # define TLS1_FINISH_MAC_LENGTH          12
918
919 # define TLS_MD_MAX_CONST_SIZE                   22
920 # define TLS_MD_CLIENT_FINISH_CONST              "client finished"
921 # define TLS_MD_CLIENT_FINISH_CONST_SIZE         15
922 # define TLS_MD_SERVER_FINISH_CONST              "server finished"
923 # define TLS_MD_SERVER_FINISH_CONST_SIZE         15
924 # define TLS_MD_KEY_EXPANSION_CONST              "key expansion"
925 # define TLS_MD_KEY_EXPANSION_CONST_SIZE         13
926 # define TLS_MD_CLIENT_WRITE_KEY_CONST           "client write key"
927 # define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE      16
928 # define TLS_MD_SERVER_WRITE_KEY_CONST           "server write key"
929 # define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE      16
930 # define TLS_MD_IV_BLOCK_CONST                   "IV block"
931 # define TLS_MD_IV_BLOCK_CONST_SIZE              8
932 # define TLS_MD_MASTER_SECRET_CONST              "master secret"
933 # define TLS_MD_MASTER_SECRET_CONST_SIZE         13
934 # define TLS_MD_EXTENDED_MASTER_SECRET_CONST     "extended master secret"
935 # define TLS_MD_EXTENDED_MASTER_SECRET_CONST_SIZE        22
936
937 # ifdef CHARSET_EBCDIC
938 #  undef TLS_MD_CLIENT_FINISH_CONST
939 /*
940  * client finished
941  */
942 #  define TLS_MD_CLIENT_FINISH_CONST    "\x63\x6c\x69\x65\x6e\x74\x20\x66\x69\x6e\x69\x73\x68\x65\x64"
943
944 #  undef TLS_MD_SERVER_FINISH_CONST
945 /*
946  * server finished
947  */
948 #  define TLS_MD_SERVER_FINISH_CONST    "\x73\x65\x72\x76\x65\x72\x20\x66\x69\x6e\x69\x73\x68\x65\x64"
949
950 #  undef TLS_MD_SERVER_WRITE_KEY_CONST
951 /*
952  * server write key
953  */
954 #  define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79"
955
956 #  undef TLS_MD_KEY_EXPANSION_CONST
957 /*
958  * key expansion
959  */
960 #  define TLS_MD_KEY_EXPANSION_CONST    "\x6b\x65\x79\x20\x65\x78\x70\x61\x6e\x73\x69\x6f\x6e"
961
962 #  undef TLS_MD_CLIENT_WRITE_KEY_CONST
963 /*
964  * client write key
965  */
966 #  define TLS_MD_CLIENT_WRITE_KEY_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79"
967
968 #  undef TLS_MD_SERVER_WRITE_KEY_CONST
969 /*
970  * server write key
971  */
972 #  define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79"
973
974 #  undef TLS_MD_IV_BLOCK_CONST
975 /*
976  * IV block
977  */
978 #  define TLS_MD_IV_BLOCK_CONST         "\x49\x56\x20\x62\x6c\x6f\x63\x6b"
979
980 #  undef TLS_MD_MASTER_SECRET_CONST
981 /*
982  * master secret
983  */
984 #  define TLS_MD_MASTER_SECRET_CONST    "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74"
985 #  undef TLS_MD_EXTENDED_MASTER_SECRET_CONST
986 /*
987  * extended master secret
988  */
989 #  define TLS_MD_EXTENDED_MASTER_SECRET_CONST    "\x65\x78\x74\x65\x63\x64\x65\x64\x20\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74"
990 # endif
991
992 /* TLS Session Ticket extension struct */
993 struct tls_session_ticket_ext_st {
994     unsigned short length;
995     void *data;
996 };
997
998 #ifdef  __cplusplus
999 }
1000 #endif
1001 #endif