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