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