Make sure we use the libctx when creating an EVP_PKEY_CTX in libssl
[openssl.git] / ssl / s3_lib.c
1 /*
2  * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
3  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
4  * Copyright 2005 Nokia. All rights reserved.
5  *
6  * Licensed under the Apache License 2.0 (the "License").  You may not use
7  * this file except in compliance with the License.  You can obtain a copy
8  * in the file LICENSE in the source distribution or at
9  * https://www.openssl.org/source/license.html
10  */
11
12 #include <stdio.h>
13 #include <openssl/objects.h>
14 #include "internal/nelem.h"
15 #include "ssl_local.h"
16 #include <openssl/md5.h>
17 #include <openssl/dh.h>
18 #include <openssl/rand.h>
19 #include <openssl/trace.h>
20 #include <openssl/x509v3.h>
21 #include "internal/cryptlib.h"
22
23 #define TLS13_NUM_CIPHERS       OSSL_NELEM(tls13_ciphers)
24 #define SSL3_NUM_CIPHERS        OSSL_NELEM(ssl3_ciphers)
25 #define SSL3_NUM_SCSVS          OSSL_NELEM(ssl3_scsvs)
26
27 /* TLSv1.3 downgrade protection sentinel values */
28 const unsigned char tls11downgrade[] = {
29     0x44, 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x00
30 };
31 const unsigned char tls12downgrade[] = {
32     0x44, 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x01
33 };
34
35 /* The list of available TLSv1.3 ciphers */
36 static SSL_CIPHER tls13_ciphers[] = {
37     {
38         1,
39         TLS1_3_RFC_AES_128_GCM_SHA256,
40         TLS1_3_RFC_AES_128_GCM_SHA256,
41         TLS1_3_CK_AES_128_GCM_SHA256,
42         SSL_kANY,
43         SSL_aANY,
44         SSL_AES128GCM,
45         SSL_AEAD,
46         TLS1_3_VERSION, TLS1_3_VERSION,
47         0, 0,
48         SSL_HIGH,
49         SSL_HANDSHAKE_MAC_SHA256,
50         128,
51         128,
52     }, {
53         1,
54         TLS1_3_RFC_AES_256_GCM_SHA384,
55         TLS1_3_RFC_AES_256_GCM_SHA384,
56         TLS1_3_CK_AES_256_GCM_SHA384,
57         SSL_kANY,
58         SSL_aANY,
59         SSL_AES256GCM,
60         SSL_AEAD,
61         TLS1_3_VERSION, TLS1_3_VERSION,
62         0, 0,
63         SSL_HIGH,
64         SSL_HANDSHAKE_MAC_SHA384,
65         256,
66         256,
67     },
68 #if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
69     {
70         1,
71         TLS1_3_RFC_CHACHA20_POLY1305_SHA256,
72         TLS1_3_RFC_CHACHA20_POLY1305_SHA256,
73         TLS1_3_CK_CHACHA20_POLY1305_SHA256,
74         SSL_kANY,
75         SSL_aANY,
76         SSL_CHACHA20POLY1305,
77         SSL_AEAD,
78         TLS1_3_VERSION, TLS1_3_VERSION,
79         0, 0,
80         SSL_HIGH,
81         SSL_HANDSHAKE_MAC_SHA256,
82         256,
83         256,
84     },
85 #endif
86     {
87         1,
88         TLS1_3_RFC_AES_128_CCM_SHA256,
89         TLS1_3_RFC_AES_128_CCM_SHA256,
90         TLS1_3_CK_AES_128_CCM_SHA256,
91         SSL_kANY,
92         SSL_aANY,
93         SSL_AES128CCM,
94         SSL_AEAD,
95         TLS1_3_VERSION, TLS1_3_VERSION,
96         0, 0,
97         SSL_NOT_DEFAULT | SSL_HIGH,
98         SSL_HANDSHAKE_MAC_SHA256,
99         128,
100         128,
101     }, {
102         1,
103         TLS1_3_RFC_AES_128_CCM_8_SHA256,
104         TLS1_3_RFC_AES_128_CCM_8_SHA256,
105         TLS1_3_CK_AES_128_CCM_8_SHA256,
106         SSL_kANY,
107         SSL_aANY,
108         SSL_AES128CCM8,
109         SSL_AEAD,
110         TLS1_3_VERSION, TLS1_3_VERSION,
111         0, 0,
112         SSL_NOT_DEFAULT | SSL_HIGH,
113         SSL_HANDSHAKE_MAC_SHA256,
114         128,
115         128,
116     }
117 };
118
119 /*
120  * The list of available ciphers, mostly organized into the following
121  * groups:
122  *      Always there
123  *      EC
124  *      PSK
125  *      SRP (within that: RSA EC PSK)
126  *      Cipher families: Chacha/poly, Camellia, Gost, IDEA, SEED
127  *      Weak ciphers
128  */
129 static SSL_CIPHER ssl3_ciphers[] = {
130     {
131      1,
132      SSL3_TXT_RSA_NULL_MD5,
133      SSL3_RFC_RSA_NULL_MD5,
134      SSL3_CK_RSA_NULL_MD5,
135      SSL_kRSA,
136      SSL_aRSA,
137      SSL_eNULL,
138      SSL_MD5,
139      SSL3_VERSION, TLS1_2_VERSION,
140      DTLS1_BAD_VER, DTLS1_2_VERSION,
141      SSL_STRONG_NONE,
142      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
143      0,
144      0,
145      },
146     {
147      1,
148      SSL3_TXT_RSA_NULL_SHA,
149      SSL3_RFC_RSA_NULL_SHA,
150      SSL3_CK_RSA_NULL_SHA,
151      SSL_kRSA,
152      SSL_aRSA,
153      SSL_eNULL,
154      SSL_SHA1,
155      SSL3_VERSION, TLS1_2_VERSION,
156      DTLS1_BAD_VER, DTLS1_2_VERSION,
157      SSL_STRONG_NONE | SSL_FIPS,
158      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
159      0,
160      0,
161      },
162 #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
163     {
164      1,
165      SSL3_TXT_RSA_DES_192_CBC3_SHA,
166      SSL3_RFC_RSA_DES_192_CBC3_SHA,
167      SSL3_CK_RSA_DES_192_CBC3_SHA,
168      SSL_kRSA,
169      SSL_aRSA,
170      SSL_3DES,
171      SSL_SHA1,
172      SSL3_VERSION, TLS1_2_VERSION,
173      DTLS1_BAD_VER, DTLS1_2_VERSION,
174      SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
175      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
176      112,
177      168,
178      },
179     {
180      1,
181      SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA,
182      SSL3_RFC_DHE_DSS_DES_192_CBC3_SHA,
183      SSL3_CK_DHE_DSS_DES_192_CBC3_SHA,
184      SSL_kDHE,
185      SSL_aDSS,
186      SSL_3DES,
187      SSL_SHA1,
188      SSL3_VERSION, TLS1_2_VERSION,
189      DTLS1_BAD_VER, DTLS1_2_VERSION,
190      SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
191      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
192      112,
193      168,
194      },
195     {
196      1,
197      SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA,
198      SSL3_RFC_DHE_RSA_DES_192_CBC3_SHA,
199      SSL3_CK_DHE_RSA_DES_192_CBC3_SHA,
200      SSL_kDHE,
201      SSL_aRSA,
202      SSL_3DES,
203      SSL_SHA1,
204      SSL3_VERSION, TLS1_2_VERSION,
205      DTLS1_BAD_VER, DTLS1_2_VERSION,
206      SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
207      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
208      112,
209      168,
210      },
211     {
212      1,
213      SSL3_TXT_ADH_DES_192_CBC_SHA,
214      SSL3_RFC_ADH_DES_192_CBC_SHA,
215      SSL3_CK_ADH_DES_192_CBC_SHA,
216      SSL_kDHE,
217      SSL_aNULL,
218      SSL_3DES,
219      SSL_SHA1,
220      SSL3_VERSION, TLS1_2_VERSION,
221      DTLS1_BAD_VER, DTLS1_2_VERSION,
222      SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
223      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
224      112,
225      168,
226      },
227 #endif
228     {
229      1,
230      TLS1_TXT_RSA_WITH_AES_128_SHA,
231      TLS1_RFC_RSA_WITH_AES_128_SHA,
232      TLS1_CK_RSA_WITH_AES_128_SHA,
233      SSL_kRSA,
234      SSL_aRSA,
235      SSL_AES128,
236      SSL_SHA1,
237      SSL3_VERSION, TLS1_2_VERSION,
238      DTLS1_BAD_VER, DTLS1_2_VERSION,
239      SSL_HIGH | SSL_FIPS,
240      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
241      128,
242      128,
243      },
244     {
245      1,
246      TLS1_TXT_DHE_DSS_WITH_AES_128_SHA,
247      TLS1_RFC_DHE_DSS_WITH_AES_128_SHA,
248      TLS1_CK_DHE_DSS_WITH_AES_128_SHA,
249      SSL_kDHE,
250      SSL_aDSS,
251      SSL_AES128,
252      SSL_SHA1,
253      SSL3_VERSION, TLS1_2_VERSION,
254      DTLS1_BAD_VER, DTLS1_2_VERSION,
255      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
256      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
257      128,
258      128,
259      },
260     {
261      1,
262      TLS1_TXT_DHE_RSA_WITH_AES_128_SHA,
263      TLS1_RFC_DHE_RSA_WITH_AES_128_SHA,
264      TLS1_CK_DHE_RSA_WITH_AES_128_SHA,
265      SSL_kDHE,
266      SSL_aRSA,
267      SSL_AES128,
268      SSL_SHA1,
269      SSL3_VERSION, TLS1_2_VERSION,
270      DTLS1_BAD_VER, DTLS1_2_VERSION,
271      SSL_HIGH | SSL_FIPS,
272      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
273      128,
274      128,
275      },
276     {
277      1,
278      TLS1_TXT_ADH_WITH_AES_128_SHA,
279      TLS1_RFC_ADH_WITH_AES_128_SHA,
280      TLS1_CK_ADH_WITH_AES_128_SHA,
281      SSL_kDHE,
282      SSL_aNULL,
283      SSL_AES128,
284      SSL_SHA1,
285      SSL3_VERSION, TLS1_2_VERSION,
286      DTLS1_BAD_VER, DTLS1_2_VERSION,
287      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
288      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
289      128,
290      128,
291      },
292     {
293      1,
294      TLS1_TXT_RSA_WITH_AES_256_SHA,
295      TLS1_RFC_RSA_WITH_AES_256_SHA,
296      TLS1_CK_RSA_WITH_AES_256_SHA,
297      SSL_kRSA,
298      SSL_aRSA,
299      SSL_AES256,
300      SSL_SHA1,
301      SSL3_VERSION, TLS1_2_VERSION,
302      DTLS1_BAD_VER, DTLS1_2_VERSION,
303      SSL_HIGH | SSL_FIPS,
304      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
305      256,
306      256,
307      },
308     {
309      1,
310      TLS1_TXT_DHE_DSS_WITH_AES_256_SHA,
311      TLS1_RFC_DHE_DSS_WITH_AES_256_SHA,
312      TLS1_CK_DHE_DSS_WITH_AES_256_SHA,
313      SSL_kDHE,
314      SSL_aDSS,
315      SSL_AES256,
316      SSL_SHA1,
317      SSL3_VERSION, TLS1_2_VERSION,
318      DTLS1_BAD_VER, DTLS1_2_VERSION,
319      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
320      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
321      256,
322      256,
323      },
324     {
325      1,
326      TLS1_TXT_DHE_RSA_WITH_AES_256_SHA,
327      TLS1_RFC_DHE_RSA_WITH_AES_256_SHA,
328      TLS1_CK_DHE_RSA_WITH_AES_256_SHA,
329      SSL_kDHE,
330      SSL_aRSA,
331      SSL_AES256,
332      SSL_SHA1,
333      SSL3_VERSION, TLS1_2_VERSION,
334      DTLS1_BAD_VER, DTLS1_2_VERSION,
335      SSL_HIGH | SSL_FIPS,
336      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
337      256,
338      256,
339      },
340     {
341      1,
342      TLS1_TXT_ADH_WITH_AES_256_SHA,
343      TLS1_RFC_ADH_WITH_AES_256_SHA,
344      TLS1_CK_ADH_WITH_AES_256_SHA,
345      SSL_kDHE,
346      SSL_aNULL,
347      SSL_AES256,
348      SSL_SHA1,
349      SSL3_VERSION, TLS1_2_VERSION,
350      DTLS1_BAD_VER, DTLS1_2_VERSION,
351      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
352      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
353      256,
354      256,
355      },
356     {
357      1,
358      TLS1_TXT_RSA_WITH_NULL_SHA256,
359      TLS1_RFC_RSA_WITH_NULL_SHA256,
360      TLS1_CK_RSA_WITH_NULL_SHA256,
361      SSL_kRSA,
362      SSL_aRSA,
363      SSL_eNULL,
364      SSL_SHA256,
365      TLS1_2_VERSION, TLS1_2_VERSION,
366      DTLS1_2_VERSION, DTLS1_2_VERSION,
367      SSL_STRONG_NONE | SSL_FIPS,
368      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
369      0,
370      0,
371      },
372     {
373      1,
374      TLS1_TXT_RSA_WITH_AES_128_SHA256,
375      TLS1_RFC_RSA_WITH_AES_128_SHA256,
376      TLS1_CK_RSA_WITH_AES_128_SHA256,
377      SSL_kRSA,
378      SSL_aRSA,
379      SSL_AES128,
380      SSL_SHA256,
381      TLS1_2_VERSION, TLS1_2_VERSION,
382      DTLS1_2_VERSION, DTLS1_2_VERSION,
383      SSL_HIGH | SSL_FIPS,
384      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
385      128,
386      128,
387      },
388     {
389      1,
390      TLS1_TXT_RSA_WITH_AES_256_SHA256,
391      TLS1_RFC_RSA_WITH_AES_256_SHA256,
392      TLS1_CK_RSA_WITH_AES_256_SHA256,
393      SSL_kRSA,
394      SSL_aRSA,
395      SSL_AES256,
396      SSL_SHA256,
397      TLS1_2_VERSION, TLS1_2_VERSION,
398      DTLS1_2_VERSION, DTLS1_2_VERSION,
399      SSL_HIGH | SSL_FIPS,
400      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
401      256,
402      256,
403      },
404     {
405      1,
406      TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256,
407      TLS1_RFC_DHE_DSS_WITH_AES_128_SHA256,
408      TLS1_CK_DHE_DSS_WITH_AES_128_SHA256,
409      SSL_kDHE,
410      SSL_aDSS,
411      SSL_AES128,
412      SSL_SHA256,
413      TLS1_2_VERSION, TLS1_2_VERSION,
414      DTLS1_2_VERSION, DTLS1_2_VERSION,
415      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
416      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
417      128,
418      128,
419      },
420     {
421      1,
422      TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256,
423      TLS1_RFC_DHE_RSA_WITH_AES_128_SHA256,
424      TLS1_CK_DHE_RSA_WITH_AES_128_SHA256,
425      SSL_kDHE,
426      SSL_aRSA,
427      SSL_AES128,
428      SSL_SHA256,
429      TLS1_2_VERSION, TLS1_2_VERSION,
430      DTLS1_2_VERSION, DTLS1_2_VERSION,
431      SSL_HIGH | SSL_FIPS,
432      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
433      128,
434      128,
435      },
436     {
437      1,
438      TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256,
439      TLS1_RFC_DHE_DSS_WITH_AES_256_SHA256,
440      TLS1_CK_DHE_DSS_WITH_AES_256_SHA256,
441      SSL_kDHE,
442      SSL_aDSS,
443      SSL_AES256,
444      SSL_SHA256,
445      TLS1_2_VERSION, TLS1_2_VERSION,
446      DTLS1_2_VERSION, DTLS1_2_VERSION,
447      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
448      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
449      256,
450      256,
451      },
452     {
453      1,
454      TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256,
455      TLS1_RFC_DHE_RSA_WITH_AES_256_SHA256,
456      TLS1_CK_DHE_RSA_WITH_AES_256_SHA256,
457      SSL_kDHE,
458      SSL_aRSA,
459      SSL_AES256,
460      SSL_SHA256,
461      TLS1_2_VERSION, TLS1_2_VERSION,
462      DTLS1_2_VERSION, DTLS1_2_VERSION,
463      SSL_HIGH | SSL_FIPS,
464      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
465      256,
466      256,
467      },
468     {
469      1,
470      TLS1_TXT_ADH_WITH_AES_128_SHA256,
471      TLS1_RFC_ADH_WITH_AES_128_SHA256,
472      TLS1_CK_ADH_WITH_AES_128_SHA256,
473      SSL_kDHE,
474      SSL_aNULL,
475      SSL_AES128,
476      SSL_SHA256,
477      TLS1_2_VERSION, TLS1_2_VERSION,
478      DTLS1_2_VERSION, DTLS1_2_VERSION,
479      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
480      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
481      128,
482      128,
483      },
484     {
485      1,
486      TLS1_TXT_ADH_WITH_AES_256_SHA256,
487      TLS1_RFC_ADH_WITH_AES_256_SHA256,
488      TLS1_CK_ADH_WITH_AES_256_SHA256,
489      SSL_kDHE,
490      SSL_aNULL,
491      SSL_AES256,
492      SSL_SHA256,
493      TLS1_2_VERSION, TLS1_2_VERSION,
494      DTLS1_2_VERSION, DTLS1_2_VERSION,
495      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
496      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
497      256,
498      256,
499      },
500     {
501      1,
502      TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256,
503      TLS1_RFC_RSA_WITH_AES_128_GCM_SHA256,
504      TLS1_CK_RSA_WITH_AES_128_GCM_SHA256,
505      SSL_kRSA,
506      SSL_aRSA,
507      SSL_AES128GCM,
508      SSL_AEAD,
509      TLS1_2_VERSION, TLS1_2_VERSION,
510      DTLS1_2_VERSION, DTLS1_2_VERSION,
511      SSL_HIGH | SSL_FIPS,
512      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
513      128,
514      128,
515      },
516     {
517      1,
518      TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384,
519      TLS1_RFC_RSA_WITH_AES_256_GCM_SHA384,
520      TLS1_CK_RSA_WITH_AES_256_GCM_SHA384,
521      SSL_kRSA,
522      SSL_aRSA,
523      SSL_AES256GCM,
524      SSL_AEAD,
525      TLS1_2_VERSION, TLS1_2_VERSION,
526      DTLS1_2_VERSION, DTLS1_2_VERSION,
527      SSL_HIGH | SSL_FIPS,
528      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
529      256,
530      256,
531      },
532     {
533      1,
534      TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256,
535      TLS1_RFC_DHE_RSA_WITH_AES_128_GCM_SHA256,
536      TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256,
537      SSL_kDHE,
538      SSL_aRSA,
539      SSL_AES128GCM,
540      SSL_AEAD,
541      TLS1_2_VERSION, TLS1_2_VERSION,
542      DTLS1_2_VERSION, DTLS1_2_VERSION,
543      SSL_HIGH | SSL_FIPS,
544      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
545      128,
546      128,
547      },
548     {
549      1,
550      TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384,
551      TLS1_RFC_DHE_RSA_WITH_AES_256_GCM_SHA384,
552      TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384,
553      SSL_kDHE,
554      SSL_aRSA,
555      SSL_AES256GCM,
556      SSL_AEAD,
557      TLS1_2_VERSION, TLS1_2_VERSION,
558      DTLS1_2_VERSION, DTLS1_2_VERSION,
559      SSL_HIGH | SSL_FIPS,
560      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
561      256,
562      256,
563      },
564     {
565      1,
566      TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256,
567      TLS1_RFC_DHE_DSS_WITH_AES_128_GCM_SHA256,
568      TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256,
569      SSL_kDHE,
570      SSL_aDSS,
571      SSL_AES128GCM,
572      SSL_AEAD,
573      TLS1_2_VERSION, TLS1_2_VERSION,
574      DTLS1_2_VERSION, DTLS1_2_VERSION,
575      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
576      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
577      128,
578      128,
579      },
580     {
581      1,
582      TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384,
583      TLS1_RFC_DHE_DSS_WITH_AES_256_GCM_SHA384,
584      TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384,
585      SSL_kDHE,
586      SSL_aDSS,
587      SSL_AES256GCM,
588      SSL_AEAD,
589      TLS1_2_VERSION, TLS1_2_VERSION,
590      DTLS1_2_VERSION, DTLS1_2_VERSION,
591      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
592      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
593      256,
594      256,
595      },
596     {
597      1,
598      TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256,
599      TLS1_RFC_ADH_WITH_AES_128_GCM_SHA256,
600      TLS1_CK_ADH_WITH_AES_128_GCM_SHA256,
601      SSL_kDHE,
602      SSL_aNULL,
603      SSL_AES128GCM,
604      SSL_AEAD,
605      TLS1_2_VERSION, TLS1_2_VERSION,
606      DTLS1_2_VERSION, DTLS1_2_VERSION,
607      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
608      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
609      128,
610      128,
611      },
612     {
613      1,
614      TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384,
615      TLS1_RFC_ADH_WITH_AES_256_GCM_SHA384,
616      TLS1_CK_ADH_WITH_AES_256_GCM_SHA384,
617      SSL_kDHE,
618      SSL_aNULL,
619      SSL_AES256GCM,
620      SSL_AEAD,
621      TLS1_2_VERSION, TLS1_2_VERSION,
622      DTLS1_2_VERSION, DTLS1_2_VERSION,
623      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
624      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
625      256,
626      256,
627      },
628     {
629      1,
630      TLS1_TXT_RSA_WITH_AES_128_CCM,
631      TLS1_RFC_RSA_WITH_AES_128_CCM,
632      TLS1_CK_RSA_WITH_AES_128_CCM,
633      SSL_kRSA,
634      SSL_aRSA,
635      SSL_AES128CCM,
636      SSL_AEAD,
637      TLS1_2_VERSION, TLS1_2_VERSION,
638      DTLS1_2_VERSION, DTLS1_2_VERSION,
639      SSL_NOT_DEFAULT | SSL_HIGH,
640      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
641      128,
642      128,
643      },
644     {
645      1,
646      TLS1_TXT_RSA_WITH_AES_256_CCM,
647      TLS1_RFC_RSA_WITH_AES_256_CCM,
648      TLS1_CK_RSA_WITH_AES_256_CCM,
649      SSL_kRSA,
650      SSL_aRSA,
651      SSL_AES256CCM,
652      SSL_AEAD,
653      TLS1_2_VERSION, TLS1_2_VERSION,
654      DTLS1_2_VERSION, DTLS1_2_VERSION,
655      SSL_NOT_DEFAULT | SSL_HIGH,
656      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
657      256,
658      256,
659      },
660     {
661      1,
662      TLS1_TXT_DHE_RSA_WITH_AES_128_CCM,
663      TLS1_RFC_DHE_RSA_WITH_AES_128_CCM,
664      TLS1_CK_DHE_RSA_WITH_AES_128_CCM,
665      SSL_kDHE,
666      SSL_aRSA,
667      SSL_AES128CCM,
668      SSL_AEAD,
669      TLS1_2_VERSION, TLS1_2_VERSION,
670      DTLS1_2_VERSION, DTLS1_2_VERSION,
671      SSL_NOT_DEFAULT | SSL_HIGH,
672      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
673      128,
674      128,
675      },
676     {
677      1,
678      TLS1_TXT_DHE_RSA_WITH_AES_256_CCM,
679      TLS1_RFC_DHE_RSA_WITH_AES_256_CCM,
680      TLS1_CK_DHE_RSA_WITH_AES_256_CCM,
681      SSL_kDHE,
682      SSL_aRSA,
683      SSL_AES256CCM,
684      SSL_AEAD,
685      TLS1_2_VERSION, TLS1_2_VERSION,
686      DTLS1_2_VERSION, DTLS1_2_VERSION,
687      SSL_NOT_DEFAULT | SSL_HIGH,
688      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
689      256,
690      256,
691      },
692     {
693      1,
694      TLS1_TXT_RSA_WITH_AES_128_CCM_8,
695      TLS1_RFC_RSA_WITH_AES_128_CCM_8,
696      TLS1_CK_RSA_WITH_AES_128_CCM_8,
697      SSL_kRSA,
698      SSL_aRSA,
699      SSL_AES128CCM8,
700      SSL_AEAD,
701      TLS1_2_VERSION, TLS1_2_VERSION,
702      DTLS1_2_VERSION, DTLS1_2_VERSION,
703      SSL_NOT_DEFAULT | SSL_HIGH,
704      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
705      128,
706      128,
707      },
708     {
709      1,
710      TLS1_TXT_RSA_WITH_AES_256_CCM_8,
711      TLS1_RFC_RSA_WITH_AES_256_CCM_8,
712      TLS1_CK_RSA_WITH_AES_256_CCM_8,
713      SSL_kRSA,
714      SSL_aRSA,
715      SSL_AES256CCM8,
716      SSL_AEAD,
717      TLS1_2_VERSION, TLS1_2_VERSION,
718      DTLS1_2_VERSION, DTLS1_2_VERSION,
719      SSL_NOT_DEFAULT | SSL_HIGH,
720      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
721      256,
722      256,
723      },
724     {
725      1,
726      TLS1_TXT_DHE_RSA_WITH_AES_128_CCM_8,
727      TLS1_RFC_DHE_RSA_WITH_AES_128_CCM_8,
728      TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8,
729      SSL_kDHE,
730      SSL_aRSA,
731      SSL_AES128CCM8,
732      SSL_AEAD,
733      TLS1_2_VERSION, TLS1_2_VERSION,
734      DTLS1_2_VERSION, DTLS1_2_VERSION,
735      SSL_NOT_DEFAULT | SSL_HIGH,
736      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
737      128,
738      128,
739      },
740     {
741      1,
742      TLS1_TXT_DHE_RSA_WITH_AES_256_CCM_8,
743      TLS1_RFC_DHE_RSA_WITH_AES_256_CCM_8,
744      TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8,
745      SSL_kDHE,
746      SSL_aRSA,
747      SSL_AES256CCM8,
748      SSL_AEAD,
749      TLS1_2_VERSION, TLS1_2_VERSION,
750      DTLS1_2_VERSION, DTLS1_2_VERSION,
751      SSL_NOT_DEFAULT | SSL_HIGH,
752      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
753      256,
754      256,
755      },
756     {
757      1,
758      TLS1_TXT_PSK_WITH_AES_128_CCM,
759      TLS1_RFC_PSK_WITH_AES_128_CCM,
760      TLS1_CK_PSK_WITH_AES_128_CCM,
761      SSL_kPSK,
762      SSL_aPSK,
763      SSL_AES128CCM,
764      SSL_AEAD,
765      TLS1_2_VERSION, TLS1_2_VERSION,
766      DTLS1_2_VERSION, DTLS1_2_VERSION,
767      SSL_NOT_DEFAULT | SSL_HIGH,
768      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
769      128,
770      128,
771      },
772     {
773      1,
774      TLS1_TXT_PSK_WITH_AES_256_CCM,
775      TLS1_RFC_PSK_WITH_AES_256_CCM,
776      TLS1_CK_PSK_WITH_AES_256_CCM,
777      SSL_kPSK,
778      SSL_aPSK,
779      SSL_AES256CCM,
780      SSL_AEAD,
781      TLS1_2_VERSION, TLS1_2_VERSION,
782      DTLS1_2_VERSION, DTLS1_2_VERSION,
783      SSL_NOT_DEFAULT | SSL_HIGH,
784      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
785      256,
786      256,
787      },
788     {
789      1,
790      TLS1_TXT_DHE_PSK_WITH_AES_128_CCM,
791      TLS1_RFC_DHE_PSK_WITH_AES_128_CCM,
792      TLS1_CK_DHE_PSK_WITH_AES_128_CCM,
793      SSL_kDHEPSK,
794      SSL_aPSK,
795      SSL_AES128CCM,
796      SSL_AEAD,
797      TLS1_2_VERSION, TLS1_2_VERSION,
798      DTLS1_2_VERSION, DTLS1_2_VERSION,
799      SSL_NOT_DEFAULT | SSL_HIGH,
800      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
801      128,
802      128,
803      },
804     {
805      1,
806      TLS1_TXT_DHE_PSK_WITH_AES_256_CCM,
807      TLS1_RFC_DHE_PSK_WITH_AES_256_CCM,
808      TLS1_CK_DHE_PSK_WITH_AES_256_CCM,
809      SSL_kDHEPSK,
810      SSL_aPSK,
811      SSL_AES256CCM,
812      SSL_AEAD,
813      TLS1_2_VERSION, TLS1_2_VERSION,
814      DTLS1_2_VERSION, DTLS1_2_VERSION,
815      SSL_NOT_DEFAULT | SSL_HIGH,
816      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
817      256,
818      256,
819      },
820     {
821      1,
822      TLS1_TXT_PSK_WITH_AES_128_CCM_8,
823      TLS1_RFC_PSK_WITH_AES_128_CCM_8,
824      TLS1_CK_PSK_WITH_AES_128_CCM_8,
825      SSL_kPSK,
826      SSL_aPSK,
827      SSL_AES128CCM8,
828      SSL_AEAD,
829      TLS1_2_VERSION, TLS1_2_VERSION,
830      DTLS1_2_VERSION, DTLS1_2_VERSION,
831      SSL_NOT_DEFAULT | SSL_HIGH,
832      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
833      128,
834      128,
835      },
836     {
837      1,
838      TLS1_TXT_PSK_WITH_AES_256_CCM_8,
839      TLS1_RFC_PSK_WITH_AES_256_CCM_8,
840      TLS1_CK_PSK_WITH_AES_256_CCM_8,
841      SSL_kPSK,
842      SSL_aPSK,
843      SSL_AES256CCM8,
844      SSL_AEAD,
845      TLS1_2_VERSION, TLS1_2_VERSION,
846      DTLS1_2_VERSION, DTLS1_2_VERSION,
847      SSL_NOT_DEFAULT | SSL_HIGH,
848      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
849      256,
850      256,
851      },
852     {
853      1,
854      TLS1_TXT_DHE_PSK_WITH_AES_128_CCM_8,
855      TLS1_RFC_DHE_PSK_WITH_AES_128_CCM_8,
856      TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8,
857      SSL_kDHEPSK,
858      SSL_aPSK,
859      SSL_AES128CCM8,
860      SSL_AEAD,
861      TLS1_2_VERSION, TLS1_2_VERSION,
862      DTLS1_2_VERSION, DTLS1_2_VERSION,
863      SSL_NOT_DEFAULT | SSL_HIGH,
864      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
865      128,
866      128,
867      },
868     {
869      1,
870      TLS1_TXT_DHE_PSK_WITH_AES_256_CCM_8,
871      TLS1_RFC_DHE_PSK_WITH_AES_256_CCM_8,
872      TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8,
873      SSL_kDHEPSK,
874      SSL_aPSK,
875      SSL_AES256CCM8,
876      SSL_AEAD,
877      TLS1_2_VERSION, TLS1_2_VERSION,
878      DTLS1_2_VERSION, DTLS1_2_VERSION,
879      SSL_NOT_DEFAULT | SSL_HIGH,
880      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
881      256,
882      256,
883      },
884     {
885      1,
886      TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM,
887      TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM,
888      TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM,
889      SSL_kECDHE,
890      SSL_aECDSA,
891      SSL_AES128CCM,
892      SSL_AEAD,
893      TLS1_2_VERSION, TLS1_2_VERSION,
894      DTLS1_2_VERSION, DTLS1_2_VERSION,
895      SSL_NOT_DEFAULT | SSL_HIGH,
896      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
897      128,
898      128,
899      },
900     {
901      1,
902      TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM,
903      TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM,
904      TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM,
905      SSL_kECDHE,
906      SSL_aECDSA,
907      SSL_AES256CCM,
908      SSL_AEAD,
909      TLS1_2_VERSION, TLS1_2_VERSION,
910      DTLS1_2_VERSION, DTLS1_2_VERSION,
911      SSL_NOT_DEFAULT | SSL_HIGH,
912      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
913      256,
914      256,
915      },
916     {
917      1,
918      TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM_8,
919      TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM_8,
920      TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8,
921      SSL_kECDHE,
922      SSL_aECDSA,
923      SSL_AES128CCM8,
924      SSL_AEAD,
925      TLS1_2_VERSION, TLS1_2_VERSION,
926      DTLS1_2_VERSION, DTLS1_2_VERSION,
927      SSL_NOT_DEFAULT | SSL_HIGH,
928      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
929      128,
930      128,
931      },
932     {
933      1,
934      TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8,
935      TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM_8,
936      TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8,
937      SSL_kECDHE,
938      SSL_aECDSA,
939      SSL_AES256CCM8,
940      SSL_AEAD,
941      TLS1_2_VERSION, TLS1_2_VERSION,
942      DTLS1_2_VERSION, DTLS1_2_VERSION,
943      SSL_NOT_DEFAULT | SSL_HIGH,
944      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
945      256,
946      256,
947      },
948     {
949      1,
950      TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA,
951      TLS1_RFC_ECDHE_ECDSA_WITH_NULL_SHA,
952      TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA,
953      SSL_kECDHE,
954      SSL_aECDSA,
955      SSL_eNULL,
956      SSL_SHA1,
957      TLS1_VERSION, TLS1_2_VERSION,
958      DTLS1_BAD_VER, DTLS1_2_VERSION,
959      SSL_STRONG_NONE | SSL_FIPS,
960      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
961      0,
962      0,
963      },
964 # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
965     {
966      1,
967      TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
968      TLS1_RFC_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
969      TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
970      SSL_kECDHE,
971      SSL_aECDSA,
972      SSL_3DES,
973      SSL_SHA1,
974      TLS1_VERSION, TLS1_2_VERSION,
975      DTLS1_BAD_VER, DTLS1_2_VERSION,
976      SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
977      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
978      112,
979      168,
980      },
981 # endif
982     {
983      1,
984      TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
985      TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
986      TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
987      SSL_kECDHE,
988      SSL_aECDSA,
989      SSL_AES128,
990      SSL_SHA1,
991      TLS1_VERSION, TLS1_2_VERSION,
992      DTLS1_BAD_VER, DTLS1_2_VERSION,
993      SSL_HIGH | SSL_FIPS,
994      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
995      128,
996      128,
997      },
998     {
999      1,
1000      TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
1001      TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
1002      TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
1003      SSL_kECDHE,
1004      SSL_aECDSA,
1005      SSL_AES256,
1006      SSL_SHA1,
1007      TLS1_VERSION, TLS1_2_VERSION,
1008      DTLS1_BAD_VER, DTLS1_2_VERSION,
1009      SSL_HIGH | SSL_FIPS,
1010      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1011      256,
1012      256,
1013      },
1014     {
1015      1,
1016      TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA,
1017      TLS1_RFC_ECDHE_RSA_WITH_NULL_SHA,
1018      TLS1_CK_ECDHE_RSA_WITH_NULL_SHA,
1019      SSL_kECDHE,
1020      SSL_aRSA,
1021      SSL_eNULL,
1022      SSL_SHA1,
1023      TLS1_VERSION, TLS1_2_VERSION,
1024      DTLS1_BAD_VER, DTLS1_2_VERSION,
1025      SSL_STRONG_NONE | SSL_FIPS,
1026      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1027      0,
1028      0,
1029      },
1030 # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
1031     {
1032      1,
1033      TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
1034      TLS1_RFC_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
1035      TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
1036      SSL_kECDHE,
1037      SSL_aRSA,
1038      SSL_3DES,
1039      SSL_SHA1,
1040      TLS1_VERSION, TLS1_2_VERSION,
1041      DTLS1_BAD_VER, DTLS1_2_VERSION,
1042      SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
1043      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1044      112,
1045      168,
1046      },
1047 # endif
1048     {
1049      1,
1050      TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA,
1051      TLS1_RFC_ECDHE_RSA_WITH_AES_128_CBC_SHA,
1052      TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA,
1053      SSL_kECDHE,
1054      SSL_aRSA,
1055      SSL_AES128,
1056      SSL_SHA1,
1057      TLS1_VERSION, TLS1_2_VERSION,
1058      DTLS1_BAD_VER, DTLS1_2_VERSION,
1059      SSL_HIGH | SSL_FIPS,
1060      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1061      128,
1062      128,
1063      },
1064     {
1065      1,
1066      TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA,
1067      TLS1_RFC_ECDHE_RSA_WITH_AES_256_CBC_SHA,
1068      TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA,
1069      SSL_kECDHE,
1070      SSL_aRSA,
1071      SSL_AES256,
1072      SSL_SHA1,
1073      TLS1_VERSION, TLS1_2_VERSION,
1074      DTLS1_BAD_VER, DTLS1_2_VERSION,
1075      SSL_HIGH | SSL_FIPS,
1076      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1077      256,
1078      256,
1079      },
1080     {
1081      1,
1082      TLS1_TXT_ECDH_anon_WITH_NULL_SHA,
1083      TLS1_RFC_ECDH_anon_WITH_NULL_SHA,
1084      TLS1_CK_ECDH_anon_WITH_NULL_SHA,
1085      SSL_kECDHE,
1086      SSL_aNULL,
1087      SSL_eNULL,
1088      SSL_SHA1,
1089      TLS1_VERSION, TLS1_2_VERSION,
1090      DTLS1_BAD_VER, DTLS1_2_VERSION,
1091      SSL_STRONG_NONE | SSL_FIPS,
1092      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1093      0,
1094      0,
1095      },
1096 # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
1097     {
1098      1,
1099      TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA,
1100      TLS1_RFC_ECDH_anon_WITH_DES_192_CBC3_SHA,
1101      TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA,
1102      SSL_kECDHE,
1103      SSL_aNULL,
1104      SSL_3DES,
1105      SSL_SHA1,
1106      TLS1_VERSION, TLS1_2_VERSION,
1107      DTLS1_BAD_VER, DTLS1_2_VERSION,
1108      SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
1109      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1110      112,
1111      168,
1112      },
1113 # endif
1114     {
1115      1,
1116      TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA,
1117      TLS1_RFC_ECDH_anon_WITH_AES_128_CBC_SHA,
1118      TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA,
1119      SSL_kECDHE,
1120      SSL_aNULL,
1121      SSL_AES128,
1122      SSL_SHA1,
1123      TLS1_VERSION, TLS1_2_VERSION,
1124      DTLS1_BAD_VER, DTLS1_2_VERSION,
1125      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
1126      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1127      128,
1128      128,
1129      },
1130     {
1131      1,
1132      TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA,
1133      TLS1_RFC_ECDH_anon_WITH_AES_256_CBC_SHA,
1134      TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA,
1135      SSL_kECDHE,
1136      SSL_aNULL,
1137      SSL_AES256,
1138      SSL_SHA1,
1139      TLS1_VERSION, TLS1_2_VERSION,
1140      DTLS1_BAD_VER, DTLS1_2_VERSION,
1141      SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
1142      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1143      256,
1144      256,
1145      },
1146     {
1147      1,
1148      TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256,
1149      TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_SHA256,
1150      TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256,
1151      SSL_kECDHE,
1152      SSL_aECDSA,
1153      SSL_AES128,
1154      SSL_SHA256,
1155      TLS1_2_VERSION, TLS1_2_VERSION,
1156      DTLS1_2_VERSION, DTLS1_2_VERSION,
1157      SSL_HIGH | SSL_FIPS,
1158      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1159      128,
1160      128,
1161      },
1162     {
1163      1,
1164      TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384,
1165      TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_SHA384,
1166      TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384,
1167      SSL_kECDHE,
1168      SSL_aECDSA,
1169      SSL_AES256,
1170      SSL_SHA384,
1171      TLS1_2_VERSION, TLS1_2_VERSION,
1172      DTLS1_2_VERSION, DTLS1_2_VERSION,
1173      SSL_HIGH | SSL_FIPS,
1174      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1175      256,
1176      256,
1177      },
1178     {
1179      1,
1180      TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256,
1181      TLS1_RFC_ECDHE_RSA_WITH_AES_128_SHA256,
1182      TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256,
1183      SSL_kECDHE,
1184      SSL_aRSA,
1185      SSL_AES128,
1186      SSL_SHA256,
1187      TLS1_2_VERSION, TLS1_2_VERSION,
1188      DTLS1_2_VERSION, DTLS1_2_VERSION,
1189      SSL_HIGH | SSL_FIPS,
1190      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1191      128,
1192      128,
1193      },
1194     {
1195      1,
1196      TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384,
1197      TLS1_RFC_ECDHE_RSA_WITH_AES_256_SHA384,
1198      TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384,
1199      SSL_kECDHE,
1200      SSL_aRSA,
1201      SSL_AES256,
1202      SSL_SHA384,
1203      TLS1_2_VERSION, TLS1_2_VERSION,
1204      DTLS1_2_VERSION, DTLS1_2_VERSION,
1205      SSL_HIGH | SSL_FIPS,
1206      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1207      256,
1208      256,
1209      },
1210     {
1211      1,
1212      TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
1213      TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
1214      TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
1215      SSL_kECDHE,
1216      SSL_aECDSA,
1217      SSL_AES128GCM,
1218      SSL_AEAD,
1219      TLS1_2_VERSION, TLS1_2_VERSION,
1220      DTLS1_2_VERSION, DTLS1_2_VERSION,
1221      SSL_HIGH | SSL_FIPS,
1222      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1223      128,
1224      128,
1225      },
1226     {
1227      1,
1228      TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
1229      TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
1230      TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
1231      SSL_kECDHE,
1232      SSL_aECDSA,
1233      SSL_AES256GCM,
1234      SSL_AEAD,
1235      TLS1_2_VERSION, TLS1_2_VERSION,
1236      DTLS1_2_VERSION, DTLS1_2_VERSION,
1237      SSL_HIGH | SSL_FIPS,
1238      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1239      256,
1240      256,
1241      },
1242     {
1243      1,
1244      TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
1245      TLS1_RFC_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
1246      TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
1247      SSL_kECDHE,
1248      SSL_aRSA,
1249      SSL_AES128GCM,
1250      SSL_AEAD,
1251      TLS1_2_VERSION, TLS1_2_VERSION,
1252      DTLS1_2_VERSION, DTLS1_2_VERSION,
1253      SSL_HIGH | SSL_FIPS,
1254      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1255      128,
1256      128,
1257      },
1258     {
1259      1,
1260      TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
1261      TLS1_RFC_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
1262      TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
1263      SSL_kECDHE,
1264      SSL_aRSA,
1265      SSL_AES256GCM,
1266      SSL_AEAD,
1267      TLS1_2_VERSION, TLS1_2_VERSION,
1268      DTLS1_2_VERSION, DTLS1_2_VERSION,
1269      SSL_HIGH | SSL_FIPS,
1270      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1271      256,
1272      256,
1273      },
1274     {
1275      1,
1276      TLS1_TXT_PSK_WITH_NULL_SHA,
1277      TLS1_RFC_PSK_WITH_NULL_SHA,
1278      TLS1_CK_PSK_WITH_NULL_SHA,
1279      SSL_kPSK,
1280      SSL_aPSK,
1281      SSL_eNULL,
1282      SSL_SHA1,
1283      SSL3_VERSION, TLS1_2_VERSION,
1284      DTLS1_BAD_VER, DTLS1_2_VERSION,
1285      SSL_STRONG_NONE | SSL_FIPS,
1286      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1287      0,
1288      0,
1289      },
1290     {
1291      1,
1292      TLS1_TXT_DHE_PSK_WITH_NULL_SHA,
1293      TLS1_RFC_DHE_PSK_WITH_NULL_SHA,
1294      TLS1_CK_DHE_PSK_WITH_NULL_SHA,
1295      SSL_kDHEPSK,
1296      SSL_aPSK,
1297      SSL_eNULL,
1298      SSL_SHA1,
1299      SSL3_VERSION, TLS1_2_VERSION,
1300      DTLS1_BAD_VER, DTLS1_2_VERSION,
1301      SSL_STRONG_NONE | SSL_FIPS,
1302      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1303      0,
1304      0,
1305      },
1306     {
1307      1,
1308      TLS1_TXT_RSA_PSK_WITH_NULL_SHA,
1309      TLS1_RFC_RSA_PSK_WITH_NULL_SHA,
1310      TLS1_CK_RSA_PSK_WITH_NULL_SHA,
1311      SSL_kRSAPSK,
1312      SSL_aRSA,
1313      SSL_eNULL,
1314      SSL_SHA1,
1315      SSL3_VERSION, TLS1_2_VERSION,
1316      DTLS1_BAD_VER, DTLS1_2_VERSION,
1317      SSL_STRONG_NONE | SSL_FIPS,
1318      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1319      0,
1320      0,
1321      },
1322 # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
1323     {
1324      1,
1325      TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA,
1326      TLS1_RFC_PSK_WITH_3DES_EDE_CBC_SHA,
1327      TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA,
1328      SSL_kPSK,
1329      SSL_aPSK,
1330      SSL_3DES,
1331      SSL_SHA1,
1332      SSL3_VERSION, TLS1_2_VERSION,
1333      DTLS1_BAD_VER, DTLS1_2_VERSION,
1334      SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
1335      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1336      112,
1337      168,
1338      },
1339 # endif
1340     {
1341      1,
1342      TLS1_TXT_PSK_WITH_AES_128_CBC_SHA,
1343      TLS1_RFC_PSK_WITH_AES_128_CBC_SHA,
1344      TLS1_CK_PSK_WITH_AES_128_CBC_SHA,
1345      SSL_kPSK,
1346      SSL_aPSK,
1347      SSL_AES128,
1348      SSL_SHA1,
1349      SSL3_VERSION, TLS1_2_VERSION,
1350      DTLS1_BAD_VER, DTLS1_2_VERSION,
1351      SSL_HIGH | SSL_FIPS,
1352      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1353      128,
1354      128,
1355      },
1356     {
1357      1,
1358      TLS1_TXT_PSK_WITH_AES_256_CBC_SHA,
1359      TLS1_RFC_PSK_WITH_AES_256_CBC_SHA,
1360      TLS1_CK_PSK_WITH_AES_256_CBC_SHA,
1361      SSL_kPSK,
1362      SSL_aPSK,
1363      SSL_AES256,
1364      SSL_SHA1,
1365      SSL3_VERSION, TLS1_2_VERSION,
1366      DTLS1_BAD_VER, DTLS1_2_VERSION,
1367      SSL_HIGH | SSL_FIPS,
1368      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1369      256,
1370      256,
1371      },
1372 # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
1373     {
1374      1,
1375      TLS1_TXT_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
1376      TLS1_RFC_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
1377      TLS1_CK_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
1378      SSL_kDHEPSK,
1379      SSL_aPSK,
1380      SSL_3DES,
1381      SSL_SHA1,
1382      SSL3_VERSION, TLS1_2_VERSION,
1383      DTLS1_BAD_VER, DTLS1_2_VERSION,
1384      SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
1385      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1386      112,
1387      168,
1388      },
1389 # endif
1390     {
1391      1,
1392      TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA,
1393      TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA,
1394      TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA,
1395      SSL_kDHEPSK,
1396      SSL_aPSK,
1397      SSL_AES128,
1398      SSL_SHA1,
1399      SSL3_VERSION, TLS1_2_VERSION,
1400      DTLS1_BAD_VER, DTLS1_2_VERSION,
1401      SSL_HIGH | SSL_FIPS,
1402      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1403      128,
1404      128,
1405      },
1406     {
1407      1,
1408      TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA,
1409      TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA,
1410      TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA,
1411      SSL_kDHEPSK,
1412      SSL_aPSK,
1413      SSL_AES256,
1414      SSL_SHA1,
1415      SSL3_VERSION, TLS1_2_VERSION,
1416      DTLS1_BAD_VER, DTLS1_2_VERSION,
1417      SSL_HIGH | SSL_FIPS,
1418      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1419      256,
1420      256,
1421      },
1422 # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
1423     {
1424      1,
1425      TLS1_TXT_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
1426      TLS1_RFC_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
1427      TLS1_CK_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
1428      SSL_kRSAPSK,
1429      SSL_aRSA,
1430      SSL_3DES,
1431      SSL_SHA1,
1432      SSL3_VERSION, TLS1_2_VERSION,
1433      DTLS1_BAD_VER, DTLS1_2_VERSION,
1434      SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
1435      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1436      112,
1437      168,
1438      },
1439 # endif
1440     {
1441      1,
1442      TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA,
1443      TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA,
1444      TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA,
1445      SSL_kRSAPSK,
1446      SSL_aRSA,
1447      SSL_AES128,
1448      SSL_SHA1,
1449      SSL3_VERSION, TLS1_2_VERSION,
1450      DTLS1_BAD_VER, DTLS1_2_VERSION,
1451      SSL_HIGH | SSL_FIPS,
1452      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1453      128,
1454      128,
1455      },
1456     {
1457      1,
1458      TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA,
1459      TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA,
1460      TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA,
1461      SSL_kRSAPSK,
1462      SSL_aRSA,
1463      SSL_AES256,
1464      SSL_SHA1,
1465      SSL3_VERSION, TLS1_2_VERSION,
1466      DTLS1_BAD_VER, DTLS1_2_VERSION,
1467      SSL_HIGH | SSL_FIPS,
1468      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1469      256,
1470      256,
1471      },
1472     {
1473      1,
1474      TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256,
1475      TLS1_RFC_PSK_WITH_AES_128_GCM_SHA256,
1476      TLS1_CK_PSK_WITH_AES_128_GCM_SHA256,
1477      SSL_kPSK,
1478      SSL_aPSK,
1479      SSL_AES128GCM,
1480      SSL_AEAD,
1481      TLS1_2_VERSION, TLS1_2_VERSION,
1482      DTLS1_2_VERSION, DTLS1_2_VERSION,
1483      SSL_HIGH | SSL_FIPS,
1484      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1485      128,
1486      128,
1487      },
1488     {
1489      1,
1490      TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384,
1491      TLS1_RFC_PSK_WITH_AES_256_GCM_SHA384,
1492      TLS1_CK_PSK_WITH_AES_256_GCM_SHA384,
1493      SSL_kPSK,
1494      SSL_aPSK,
1495      SSL_AES256GCM,
1496      SSL_AEAD,
1497      TLS1_2_VERSION, TLS1_2_VERSION,
1498      DTLS1_2_VERSION, DTLS1_2_VERSION,
1499      SSL_HIGH | SSL_FIPS,
1500      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1501      256,
1502      256,
1503      },
1504     {
1505      1,
1506      TLS1_TXT_DHE_PSK_WITH_AES_128_GCM_SHA256,
1507      TLS1_RFC_DHE_PSK_WITH_AES_128_GCM_SHA256,
1508      TLS1_CK_DHE_PSK_WITH_AES_128_GCM_SHA256,
1509      SSL_kDHEPSK,
1510      SSL_aPSK,
1511      SSL_AES128GCM,
1512      SSL_AEAD,
1513      TLS1_2_VERSION, TLS1_2_VERSION,
1514      DTLS1_2_VERSION, DTLS1_2_VERSION,
1515      SSL_HIGH | SSL_FIPS,
1516      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1517      128,
1518      128,
1519      },
1520     {
1521      1,
1522      TLS1_TXT_DHE_PSK_WITH_AES_256_GCM_SHA384,
1523      TLS1_RFC_DHE_PSK_WITH_AES_256_GCM_SHA384,
1524      TLS1_CK_DHE_PSK_WITH_AES_256_GCM_SHA384,
1525      SSL_kDHEPSK,
1526      SSL_aPSK,
1527      SSL_AES256GCM,
1528      SSL_AEAD,
1529      TLS1_2_VERSION, TLS1_2_VERSION,
1530      DTLS1_2_VERSION, DTLS1_2_VERSION,
1531      SSL_HIGH | SSL_FIPS,
1532      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1533      256,
1534      256,
1535      },
1536     {
1537      1,
1538      TLS1_TXT_RSA_PSK_WITH_AES_128_GCM_SHA256,
1539      TLS1_RFC_RSA_PSK_WITH_AES_128_GCM_SHA256,
1540      TLS1_CK_RSA_PSK_WITH_AES_128_GCM_SHA256,
1541      SSL_kRSAPSK,
1542      SSL_aRSA,
1543      SSL_AES128GCM,
1544      SSL_AEAD,
1545      TLS1_2_VERSION, TLS1_2_VERSION,
1546      DTLS1_2_VERSION, DTLS1_2_VERSION,
1547      SSL_HIGH | SSL_FIPS,
1548      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1549      128,
1550      128,
1551      },
1552     {
1553      1,
1554      TLS1_TXT_RSA_PSK_WITH_AES_256_GCM_SHA384,
1555      TLS1_RFC_RSA_PSK_WITH_AES_256_GCM_SHA384,
1556      TLS1_CK_RSA_PSK_WITH_AES_256_GCM_SHA384,
1557      SSL_kRSAPSK,
1558      SSL_aRSA,
1559      SSL_AES256GCM,
1560      SSL_AEAD,
1561      TLS1_2_VERSION, TLS1_2_VERSION,
1562      DTLS1_2_VERSION, DTLS1_2_VERSION,
1563      SSL_HIGH | SSL_FIPS,
1564      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1565      256,
1566      256,
1567      },
1568     {
1569      1,
1570      TLS1_TXT_PSK_WITH_AES_128_CBC_SHA256,
1571      TLS1_RFC_PSK_WITH_AES_128_CBC_SHA256,
1572      TLS1_CK_PSK_WITH_AES_128_CBC_SHA256,
1573      SSL_kPSK,
1574      SSL_aPSK,
1575      SSL_AES128,
1576      SSL_SHA256,
1577      TLS1_VERSION, TLS1_2_VERSION,
1578      DTLS1_BAD_VER, DTLS1_2_VERSION,
1579      SSL_HIGH | SSL_FIPS,
1580      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1581      128,
1582      128,
1583      },
1584     {
1585      1,
1586      TLS1_TXT_PSK_WITH_AES_256_CBC_SHA384,
1587      TLS1_RFC_PSK_WITH_AES_256_CBC_SHA384,
1588      TLS1_CK_PSK_WITH_AES_256_CBC_SHA384,
1589      SSL_kPSK,
1590      SSL_aPSK,
1591      SSL_AES256,
1592      SSL_SHA384,
1593      TLS1_VERSION, TLS1_2_VERSION,
1594      DTLS1_BAD_VER, DTLS1_2_VERSION,
1595      SSL_HIGH | SSL_FIPS,
1596      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1597      256,
1598      256,
1599      },
1600     {
1601      1,
1602      TLS1_TXT_PSK_WITH_NULL_SHA256,
1603      TLS1_RFC_PSK_WITH_NULL_SHA256,
1604      TLS1_CK_PSK_WITH_NULL_SHA256,
1605      SSL_kPSK,
1606      SSL_aPSK,
1607      SSL_eNULL,
1608      SSL_SHA256,
1609      TLS1_VERSION, TLS1_2_VERSION,
1610      DTLS1_BAD_VER, DTLS1_2_VERSION,
1611      SSL_STRONG_NONE | SSL_FIPS,
1612      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1613      0,
1614      0,
1615      },
1616     {
1617      1,
1618      TLS1_TXT_PSK_WITH_NULL_SHA384,
1619      TLS1_RFC_PSK_WITH_NULL_SHA384,
1620      TLS1_CK_PSK_WITH_NULL_SHA384,
1621      SSL_kPSK,
1622      SSL_aPSK,
1623      SSL_eNULL,
1624      SSL_SHA384,
1625      TLS1_VERSION, TLS1_2_VERSION,
1626      DTLS1_BAD_VER, DTLS1_2_VERSION,
1627      SSL_STRONG_NONE | SSL_FIPS,
1628      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1629      0,
1630      0,
1631      },
1632     {
1633      1,
1634      TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA256,
1635      TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA256,
1636      TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA256,
1637      SSL_kDHEPSK,
1638      SSL_aPSK,
1639      SSL_AES128,
1640      SSL_SHA256,
1641      TLS1_VERSION, TLS1_2_VERSION,
1642      DTLS1_BAD_VER, DTLS1_2_VERSION,
1643      SSL_HIGH | SSL_FIPS,
1644      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1645      128,
1646      128,
1647      },
1648     {
1649      1,
1650      TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA384,
1651      TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA384,
1652      TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA384,
1653      SSL_kDHEPSK,
1654      SSL_aPSK,
1655      SSL_AES256,
1656      SSL_SHA384,
1657      TLS1_VERSION, TLS1_2_VERSION,
1658      DTLS1_BAD_VER, DTLS1_2_VERSION,
1659      SSL_HIGH | SSL_FIPS,
1660      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1661      256,
1662      256,
1663      },
1664     {
1665      1,
1666      TLS1_TXT_DHE_PSK_WITH_NULL_SHA256,
1667      TLS1_RFC_DHE_PSK_WITH_NULL_SHA256,
1668      TLS1_CK_DHE_PSK_WITH_NULL_SHA256,
1669      SSL_kDHEPSK,
1670      SSL_aPSK,
1671      SSL_eNULL,
1672      SSL_SHA256,
1673      TLS1_VERSION, TLS1_2_VERSION,
1674      DTLS1_BAD_VER, DTLS1_2_VERSION,
1675      SSL_STRONG_NONE | SSL_FIPS,
1676      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1677      0,
1678      0,
1679      },
1680     {
1681      1,
1682      TLS1_TXT_DHE_PSK_WITH_NULL_SHA384,
1683      TLS1_RFC_DHE_PSK_WITH_NULL_SHA384,
1684      TLS1_CK_DHE_PSK_WITH_NULL_SHA384,
1685      SSL_kDHEPSK,
1686      SSL_aPSK,
1687      SSL_eNULL,
1688      SSL_SHA384,
1689      TLS1_VERSION, TLS1_2_VERSION,
1690      DTLS1_BAD_VER, DTLS1_2_VERSION,
1691      SSL_STRONG_NONE | SSL_FIPS,
1692      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1693      0,
1694      0,
1695      },
1696     {
1697      1,
1698      TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA256,
1699      TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA256,
1700      TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA256,
1701      SSL_kRSAPSK,
1702      SSL_aRSA,
1703      SSL_AES128,
1704      SSL_SHA256,
1705      TLS1_VERSION, TLS1_2_VERSION,
1706      DTLS1_BAD_VER, DTLS1_2_VERSION,
1707      SSL_HIGH | SSL_FIPS,
1708      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1709      128,
1710      128,
1711      },
1712     {
1713      1,
1714      TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA384,
1715      TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA384,
1716      TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA384,
1717      SSL_kRSAPSK,
1718      SSL_aRSA,
1719      SSL_AES256,
1720      SSL_SHA384,
1721      TLS1_VERSION, TLS1_2_VERSION,
1722      DTLS1_BAD_VER, DTLS1_2_VERSION,
1723      SSL_HIGH | SSL_FIPS,
1724      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1725      256,
1726      256,
1727      },
1728     {
1729      1,
1730      TLS1_TXT_RSA_PSK_WITH_NULL_SHA256,
1731      TLS1_RFC_RSA_PSK_WITH_NULL_SHA256,
1732      TLS1_CK_RSA_PSK_WITH_NULL_SHA256,
1733      SSL_kRSAPSK,
1734      SSL_aRSA,
1735      SSL_eNULL,
1736      SSL_SHA256,
1737      TLS1_VERSION, TLS1_2_VERSION,
1738      DTLS1_BAD_VER, DTLS1_2_VERSION,
1739      SSL_STRONG_NONE | SSL_FIPS,
1740      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1741      0,
1742      0,
1743      },
1744     {
1745      1,
1746      TLS1_TXT_RSA_PSK_WITH_NULL_SHA384,
1747      TLS1_RFC_RSA_PSK_WITH_NULL_SHA384,
1748      TLS1_CK_RSA_PSK_WITH_NULL_SHA384,
1749      SSL_kRSAPSK,
1750      SSL_aRSA,
1751      SSL_eNULL,
1752      SSL_SHA384,
1753      TLS1_VERSION, TLS1_2_VERSION,
1754      DTLS1_BAD_VER, DTLS1_2_VERSION,
1755      SSL_STRONG_NONE | SSL_FIPS,
1756      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1757      0,
1758      0,
1759      },
1760 #  ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
1761     {
1762      1,
1763      TLS1_TXT_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
1764      TLS1_RFC_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
1765      TLS1_CK_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
1766      SSL_kECDHEPSK,
1767      SSL_aPSK,
1768      SSL_3DES,
1769      SSL_SHA1,
1770      TLS1_VERSION, TLS1_2_VERSION,
1771      DTLS1_BAD_VER, DTLS1_2_VERSION,
1772      SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
1773      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1774      112,
1775      168,
1776      },
1777 #  endif
1778     {
1779      1,
1780      TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA,
1781      TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA,
1782      TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA,
1783      SSL_kECDHEPSK,
1784      SSL_aPSK,
1785      SSL_AES128,
1786      SSL_SHA1,
1787      TLS1_VERSION, TLS1_2_VERSION,
1788      DTLS1_BAD_VER, DTLS1_2_VERSION,
1789      SSL_HIGH | SSL_FIPS,
1790      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1791      128,
1792      128,
1793      },
1794     {
1795      1,
1796      TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA,
1797      TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA,
1798      TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA,
1799      SSL_kECDHEPSK,
1800      SSL_aPSK,
1801      SSL_AES256,
1802      SSL_SHA1,
1803      TLS1_VERSION, TLS1_2_VERSION,
1804      DTLS1_BAD_VER, DTLS1_2_VERSION,
1805      SSL_HIGH | SSL_FIPS,
1806      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1807      256,
1808      256,
1809      },
1810     {
1811      1,
1812      TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
1813      TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
1814      TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
1815      SSL_kECDHEPSK,
1816      SSL_aPSK,
1817      SSL_AES128,
1818      SSL_SHA256,
1819      TLS1_VERSION, TLS1_2_VERSION,
1820      DTLS1_BAD_VER, DTLS1_2_VERSION,
1821      SSL_HIGH | SSL_FIPS,
1822      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1823      128,
1824      128,
1825      },
1826     {
1827      1,
1828      TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
1829      TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
1830      TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
1831      SSL_kECDHEPSK,
1832      SSL_aPSK,
1833      SSL_AES256,
1834      SSL_SHA384,
1835      TLS1_VERSION, TLS1_2_VERSION,
1836      DTLS1_BAD_VER, DTLS1_2_VERSION,
1837      SSL_HIGH | SSL_FIPS,
1838      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1839      256,
1840      256,
1841      },
1842     {
1843      1,
1844      TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA,
1845      TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA,
1846      TLS1_CK_ECDHE_PSK_WITH_NULL_SHA,
1847      SSL_kECDHEPSK,
1848      SSL_aPSK,
1849      SSL_eNULL,
1850      SSL_SHA1,
1851      TLS1_VERSION, TLS1_2_VERSION,
1852      DTLS1_BAD_VER, DTLS1_2_VERSION,
1853      SSL_STRONG_NONE | SSL_FIPS,
1854      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1855      0,
1856      0,
1857      },
1858     {
1859      1,
1860      TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA256,
1861      TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA256,
1862      TLS1_CK_ECDHE_PSK_WITH_NULL_SHA256,
1863      SSL_kECDHEPSK,
1864      SSL_aPSK,
1865      SSL_eNULL,
1866      SSL_SHA256,
1867      TLS1_VERSION, TLS1_2_VERSION,
1868      DTLS1_BAD_VER, DTLS1_2_VERSION,
1869      SSL_STRONG_NONE | SSL_FIPS,
1870      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1871      0,
1872      0,
1873      },
1874     {
1875      1,
1876      TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA384,
1877      TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA384,
1878      TLS1_CK_ECDHE_PSK_WITH_NULL_SHA384,
1879      SSL_kECDHEPSK,
1880      SSL_aPSK,
1881      SSL_eNULL,
1882      SSL_SHA384,
1883      TLS1_VERSION, TLS1_2_VERSION,
1884      DTLS1_BAD_VER, DTLS1_2_VERSION,
1885      SSL_STRONG_NONE | SSL_FIPS,
1886      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1887      0,
1888      0,
1889      },
1890
1891 # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
1892     {
1893      1,
1894      TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
1895      TLS1_RFC_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
1896      TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
1897      SSL_kSRP,
1898      SSL_aSRP,
1899      SSL_3DES,
1900      SSL_SHA1,
1901      SSL3_VERSION, TLS1_2_VERSION,
1902      DTLS1_BAD_VER, DTLS1_2_VERSION,
1903      SSL_NOT_DEFAULT | SSL_MEDIUM,
1904      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1905      112,
1906      168,
1907      },
1908     {
1909      1,
1910      TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
1911      TLS1_RFC_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
1912      TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
1913      SSL_kSRP,
1914      SSL_aRSA,
1915      SSL_3DES,
1916      SSL_SHA1,
1917      SSL3_VERSION, TLS1_2_VERSION,
1918      DTLS1_BAD_VER, DTLS1_2_VERSION,
1919      SSL_NOT_DEFAULT | SSL_MEDIUM,
1920      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1921      112,
1922      168,
1923      },
1924     {
1925      1,
1926      TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
1927      TLS1_RFC_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
1928      TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
1929      SSL_kSRP,
1930      SSL_aDSS,
1931      SSL_3DES,
1932      SSL_SHA1,
1933      SSL3_VERSION, TLS1_2_VERSION,
1934      DTLS1_BAD_VER, DTLS1_2_VERSION,
1935      SSL_NOT_DEFAULT | SSL_MEDIUM,
1936      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1937      112,
1938      168,
1939      },
1940 # endif
1941     {
1942      1,
1943      TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA,
1944      TLS1_RFC_SRP_SHA_WITH_AES_128_CBC_SHA,
1945      TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA,
1946      SSL_kSRP,
1947      SSL_aSRP,
1948      SSL_AES128,
1949      SSL_SHA1,
1950      SSL3_VERSION, TLS1_2_VERSION,
1951      DTLS1_BAD_VER, DTLS1_2_VERSION,
1952      SSL_HIGH,
1953      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1954      128,
1955      128,
1956      },
1957     {
1958      1,
1959      TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
1960      TLS1_RFC_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
1961      TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
1962      SSL_kSRP,
1963      SSL_aRSA,
1964      SSL_AES128,
1965      SSL_SHA1,
1966      SSL3_VERSION, TLS1_2_VERSION,
1967      DTLS1_BAD_VER, DTLS1_2_VERSION,
1968      SSL_HIGH,
1969      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1970      128,
1971      128,
1972      },
1973     {
1974      1,
1975      TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
1976      TLS1_RFC_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
1977      TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
1978      SSL_kSRP,
1979      SSL_aDSS,
1980      SSL_AES128,
1981      SSL_SHA1,
1982      SSL3_VERSION, TLS1_2_VERSION,
1983      DTLS1_BAD_VER, DTLS1_2_VERSION,
1984      SSL_NOT_DEFAULT | SSL_HIGH,
1985      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1986      128,
1987      128,
1988      },
1989     {
1990      1,
1991      TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA,
1992      TLS1_RFC_SRP_SHA_WITH_AES_256_CBC_SHA,
1993      TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA,
1994      SSL_kSRP,
1995      SSL_aSRP,
1996      SSL_AES256,
1997      SSL_SHA1,
1998      SSL3_VERSION, TLS1_2_VERSION,
1999      DTLS1_BAD_VER, DTLS1_2_VERSION,
2000      SSL_HIGH,
2001      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2002      256,
2003      256,
2004      },
2005     {
2006      1,
2007      TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
2008      TLS1_RFC_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
2009      TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
2010      SSL_kSRP,
2011      SSL_aRSA,
2012      SSL_AES256,
2013      SSL_SHA1,
2014      SSL3_VERSION, TLS1_2_VERSION,
2015      DTLS1_BAD_VER, DTLS1_2_VERSION,
2016      SSL_HIGH,
2017      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2018      256,
2019      256,
2020      },
2021     {
2022      1,
2023      TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
2024      TLS1_RFC_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
2025      TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
2026      SSL_kSRP,
2027      SSL_aDSS,
2028      SSL_AES256,
2029      SSL_SHA1,
2030      SSL3_VERSION, TLS1_2_VERSION,
2031      DTLS1_BAD_VER, DTLS1_2_VERSION,
2032      SSL_NOT_DEFAULT | SSL_HIGH,
2033      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2034      256,
2035      256,
2036      },
2037
2038 #if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
2039     {
2040      1,
2041      TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305,
2042      TLS1_RFC_DHE_RSA_WITH_CHACHA20_POLY1305,
2043      TLS1_CK_DHE_RSA_WITH_CHACHA20_POLY1305,
2044      SSL_kDHE,
2045      SSL_aRSA,
2046      SSL_CHACHA20POLY1305,
2047      SSL_AEAD,
2048      TLS1_2_VERSION, TLS1_2_VERSION,
2049      DTLS1_2_VERSION, DTLS1_2_VERSION,
2050      SSL_HIGH,
2051      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2052      256,
2053      256,
2054      },
2055     {
2056      1,
2057      TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305,
2058      TLS1_RFC_ECDHE_RSA_WITH_CHACHA20_POLY1305,
2059      TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305,
2060      SSL_kECDHE,
2061      SSL_aRSA,
2062      SSL_CHACHA20POLY1305,
2063      SSL_AEAD,
2064      TLS1_2_VERSION, TLS1_2_VERSION,
2065      DTLS1_2_VERSION, DTLS1_2_VERSION,
2066      SSL_HIGH,
2067      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2068      256,
2069      256,
2070      },
2071     {
2072      1,
2073      TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
2074      TLS1_RFC_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
2075      TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
2076      SSL_kECDHE,
2077      SSL_aECDSA,
2078      SSL_CHACHA20POLY1305,
2079      SSL_AEAD,
2080      TLS1_2_VERSION, TLS1_2_VERSION,
2081      DTLS1_2_VERSION, DTLS1_2_VERSION,
2082      SSL_HIGH,
2083      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2084      256,
2085      256,
2086      },
2087     {
2088      1,
2089      TLS1_TXT_PSK_WITH_CHACHA20_POLY1305,
2090      TLS1_RFC_PSK_WITH_CHACHA20_POLY1305,
2091      TLS1_CK_PSK_WITH_CHACHA20_POLY1305,
2092      SSL_kPSK,
2093      SSL_aPSK,
2094      SSL_CHACHA20POLY1305,
2095      SSL_AEAD,
2096      TLS1_2_VERSION, TLS1_2_VERSION,
2097      DTLS1_2_VERSION, DTLS1_2_VERSION,
2098      SSL_HIGH,
2099      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2100      256,
2101      256,
2102      },
2103     {
2104      1,
2105      TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305,
2106      TLS1_RFC_ECDHE_PSK_WITH_CHACHA20_POLY1305,
2107      TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305,
2108      SSL_kECDHEPSK,
2109      SSL_aPSK,
2110      SSL_CHACHA20POLY1305,
2111      SSL_AEAD,
2112      TLS1_2_VERSION, TLS1_2_VERSION,
2113      DTLS1_2_VERSION, DTLS1_2_VERSION,
2114      SSL_HIGH,
2115      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2116      256,
2117      256,
2118      },
2119     {
2120      1,
2121      TLS1_TXT_DHE_PSK_WITH_CHACHA20_POLY1305,
2122      TLS1_RFC_DHE_PSK_WITH_CHACHA20_POLY1305,
2123      TLS1_CK_DHE_PSK_WITH_CHACHA20_POLY1305,
2124      SSL_kDHEPSK,
2125      SSL_aPSK,
2126      SSL_CHACHA20POLY1305,
2127      SSL_AEAD,
2128      TLS1_2_VERSION, TLS1_2_VERSION,
2129      DTLS1_2_VERSION, DTLS1_2_VERSION,
2130      SSL_HIGH,
2131      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2132      256,
2133      256,
2134      },
2135     {
2136      1,
2137      TLS1_TXT_RSA_PSK_WITH_CHACHA20_POLY1305,
2138      TLS1_RFC_RSA_PSK_WITH_CHACHA20_POLY1305,
2139      TLS1_CK_RSA_PSK_WITH_CHACHA20_POLY1305,
2140      SSL_kRSAPSK,
2141      SSL_aRSA,
2142      SSL_CHACHA20POLY1305,
2143      SSL_AEAD,
2144      TLS1_2_VERSION, TLS1_2_VERSION,
2145      DTLS1_2_VERSION, DTLS1_2_VERSION,
2146      SSL_HIGH,
2147      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2148      256,
2149      256,
2150      },
2151 #endif                          /* !defined(OPENSSL_NO_CHACHA) &&
2152                                  * !defined(OPENSSL_NO_POLY1305) */
2153
2154 #ifndef OPENSSL_NO_CAMELLIA
2155     {
2156      1,
2157      TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2158      TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2159      TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2160      SSL_kRSA,
2161      SSL_aRSA,
2162      SSL_CAMELLIA128,
2163      SSL_SHA256,
2164      TLS1_2_VERSION, TLS1_2_VERSION,
2165      DTLS1_2_VERSION, DTLS1_2_VERSION,
2166      SSL_NOT_DEFAULT | SSL_HIGH,
2167      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2168      128,
2169      128,
2170      },
2171     {
2172      1,
2173      TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
2174      TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
2175      TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
2176      SSL_kEDH,
2177      SSL_aDSS,
2178      SSL_CAMELLIA128,
2179      SSL_SHA256,
2180      TLS1_2_VERSION, TLS1_2_VERSION,
2181      DTLS1_2_VERSION, DTLS1_2_VERSION,
2182      SSL_NOT_DEFAULT | SSL_HIGH,
2183      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2184      128,
2185      128,
2186      },
2187     {
2188      1,
2189      TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2190      TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2191      TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2192      SSL_kEDH,
2193      SSL_aRSA,
2194      SSL_CAMELLIA128,
2195      SSL_SHA256,
2196      TLS1_2_VERSION, TLS1_2_VERSION,
2197      DTLS1_2_VERSION, DTLS1_2_VERSION,
2198      SSL_NOT_DEFAULT | SSL_HIGH,
2199      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2200      128,
2201      128,
2202      },
2203     {
2204      1,
2205      TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA256,
2206      TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA256,
2207      TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA256,
2208      SSL_kEDH,
2209      SSL_aNULL,
2210      SSL_CAMELLIA128,
2211      SSL_SHA256,
2212      TLS1_2_VERSION, TLS1_2_VERSION,
2213      DTLS1_2_VERSION, DTLS1_2_VERSION,
2214      SSL_NOT_DEFAULT | SSL_HIGH,
2215      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2216      128,
2217      128,
2218      },
2219     {
2220      1,
2221      TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA256,
2222      TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA256,
2223      TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA256,
2224      SSL_kRSA,
2225      SSL_aRSA,
2226      SSL_CAMELLIA256,
2227      SSL_SHA256,
2228      TLS1_2_VERSION, TLS1_2_VERSION,
2229      DTLS1_2_VERSION, DTLS1_2_VERSION,
2230      SSL_NOT_DEFAULT | SSL_HIGH,
2231      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2232      256,
2233      256,
2234      },
2235     {
2236      1,
2237      TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
2238      TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
2239      TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
2240      SSL_kEDH,
2241      SSL_aDSS,
2242      SSL_CAMELLIA256,
2243      SSL_SHA256,
2244      TLS1_2_VERSION, TLS1_2_VERSION,
2245      DTLS1_2_VERSION, DTLS1_2_VERSION,
2246      SSL_NOT_DEFAULT | SSL_HIGH,
2247      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2248      256,
2249      256,
2250      },
2251     {
2252      1,
2253      TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
2254      TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
2255      TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
2256      SSL_kEDH,
2257      SSL_aRSA,
2258      SSL_CAMELLIA256,
2259      SSL_SHA256,
2260      TLS1_2_VERSION, TLS1_2_VERSION,
2261      DTLS1_2_VERSION, DTLS1_2_VERSION,
2262      SSL_NOT_DEFAULT | SSL_HIGH,
2263      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2264      256,
2265      256,
2266      },
2267     {
2268      1,
2269      TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA256,
2270      TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA256,
2271      TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256,
2272      SSL_kEDH,
2273      SSL_aNULL,
2274      SSL_CAMELLIA256,
2275      SSL_SHA256,
2276      TLS1_2_VERSION, TLS1_2_VERSION,
2277      DTLS1_2_VERSION, DTLS1_2_VERSION,
2278      SSL_NOT_DEFAULT | SSL_HIGH,
2279      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2280      256,
2281      256,
2282      },
2283     {
2284      1,
2285      TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA,
2286      TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA,
2287      TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA,
2288      SSL_kRSA,
2289      SSL_aRSA,
2290      SSL_CAMELLIA256,
2291      SSL_SHA1,
2292      SSL3_VERSION, TLS1_2_VERSION,
2293      DTLS1_BAD_VER, DTLS1_2_VERSION,
2294      SSL_NOT_DEFAULT | SSL_HIGH,
2295      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2296      256,
2297      256,
2298      },
2299     {
2300      1,
2301      TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
2302      TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
2303      TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
2304      SSL_kDHE,
2305      SSL_aDSS,
2306      SSL_CAMELLIA256,
2307      SSL_SHA1,
2308      SSL3_VERSION, TLS1_2_VERSION,
2309      DTLS1_BAD_VER, DTLS1_2_VERSION,
2310      SSL_NOT_DEFAULT | SSL_HIGH,
2311      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2312      256,
2313      256,
2314      },
2315     {
2316      1,
2317      TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
2318      TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
2319      TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
2320      SSL_kDHE,
2321      SSL_aRSA,
2322      SSL_CAMELLIA256,
2323      SSL_SHA1,
2324      SSL3_VERSION, TLS1_2_VERSION,
2325      DTLS1_BAD_VER, DTLS1_2_VERSION,
2326      SSL_NOT_DEFAULT | SSL_HIGH,
2327      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2328      256,
2329      256,
2330      },
2331     {
2332      1,
2333      TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA,
2334      TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA,
2335      TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA,
2336      SSL_kDHE,
2337      SSL_aNULL,
2338      SSL_CAMELLIA256,
2339      SSL_SHA1,
2340      SSL3_VERSION, TLS1_2_VERSION,
2341      DTLS1_BAD_VER, DTLS1_2_VERSION,
2342      SSL_NOT_DEFAULT | SSL_HIGH,
2343      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2344      256,
2345      256,
2346      },
2347     {
2348      1,
2349      TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA,
2350      TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA,
2351      TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA,
2352      SSL_kRSA,
2353      SSL_aRSA,
2354      SSL_CAMELLIA128,
2355      SSL_SHA1,
2356      SSL3_VERSION, TLS1_2_VERSION,
2357      DTLS1_BAD_VER, DTLS1_2_VERSION,
2358      SSL_NOT_DEFAULT | SSL_HIGH,
2359      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2360      128,
2361      128,
2362      },
2363     {
2364      1,
2365      TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
2366      TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
2367      TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
2368      SSL_kDHE,
2369      SSL_aDSS,
2370      SSL_CAMELLIA128,
2371      SSL_SHA1,
2372      SSL3_VERSION, TLS1_2_VERSION,
2373      DTLS1_BAD_VER, DTLS1_2_VERSION,
2374      SSL_NOT_DEFAULT | SSL_HIGH,
2375      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2376      128,
2377      128,
2378      },
2379     {
2380      1,
2381      TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
2382      TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
2383      TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
2384      SSL_kDHE,
2385      SSL_aRSA,
2386      SSL_CAMELLIA128,
2387      SSL_SHA1,
2388      SSL3_VERSION, TLS1_2_VERSION,
2389      DTLS1_BAD_VER, DTLS1_2_VERSION,
2390      SSL_NOT_DEFAULT | SSL_HIGH,
2391      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2392      128,
2393      128,
2394      },
2395     {
2396      1,
2397      TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA,
2398      TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA,
2399      TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA,
2400      SSL_kDHE,
2401      SSL_aNULL,
2402      SSL_CAMELLIA128,
2403      SSL_SHA1,
2404      SSL3_VERSION, TLS1_2_VERSION,
2405      DTLS1_BAD_VER, DTLS1_2_VERSION,
2406      SSL_NOT_DEFAULT | SSL_HIGH,
2407      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2408      128,
2409      128,
2410      },
2411     {
2412      1,
2413      TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
2414      TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
2415      TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
2416      SSL_kECDHE,
2417      SSL_aECDSA,
2418      SSL_CAMELLIA128,
2419      SSL_SHA256,
2420      TLS1_2_VERSION, TLS1_2_VERSION,
2421      DTLS1_2_VERSION, DTLS1_2_VERSION,
2422      SSL_NOT_DEFAULT | SSL_HIGH,
2423      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2424      128,
2425      128,
2426      },
2427     {
2428      1,
2429      TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
2430      TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
2431      TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
2432      SSL_kECDHE,
2433      SSL_aECDSA,
2434      SSL_CAMELLIA256,
2435      SSL_SHA384,
2436      TLS1_2_VERSION, TLS1_2_VERSION,
2437      DTLS1_2_VERSION, DTLS1_2_VERSION,
2438      SSL_NOT_DEFAULT | SSL_HIGH,
2439      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2440      256,
2441      256,
2442      },
2443     {
2444      1,
2445      TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2446      TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2447      TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2448      SSL_kECDHE,
2449      SSL_aRSA,
2450      SSL_CAMELLIA128,
2451      SSL_SHA256,
2452      TLS1_2_VERSION, TLS1_2_VERSION,
2453      DTLS1_2_VERSION, DTLS1_2_VERSION,
2454      SSL_NOT_DEFAULT | SSL_HIGH,
2455      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2456      128,
2457      128,
2458      },
2459     {
2460      1,
2461      TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
2462      TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
2463      TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
2464      SSL_kECDHE,
2465      SSL_aRSA,
2466      SSL_CAMELLIA256,
2467      SSL_SHA384,
2468      TLS1_2_VERSION, TLS1_2_VERSION,
2469      DTLS1_2_VERSION, DTLS1_2_VERSION,
2470      SSL_NOT_DEFAULT | SSL_HIGH,
2471      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2472      256,
2473      256,
2474      },
2475     {
2476      1,
2477      TLS1_TXT_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2478      TLS1_RFC_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2479      TLS1_CK_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2480      SSL_kPSK,
2481      SSL_aPSK,
2482      SSL_CAMELLIA128,
2483      SSL_SHA256,
2484      TLS1_VERSION, TLS1_2_VERSION,
2485      DTLS1_BAD_VER, DTLS1_2_VERSION,
2486      SSL_NOT_DEFAULT | SSL_HIGH,
2487      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2488      128,
2489      128,
2490      },
2491     {
2492      1,
2493      TLS1_TXT_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2494      TLS1_RFC_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2495      TLS1_CK_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2496      SSL_kPSK,
2497      SSL_aPSK,
2498      SSL_CAMELLIA256,
2499      SSL_SHA384,
2500      TLS1_VERSION, TLS1_2_VERSION,
2501      DTLS1_BAD_VER, DTLS1_2_VERSION,
2502      SSL_NOT_DEFAULT | SSL_HIGH,
2503      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2504      256,
2505      256,
2506      },
2507     {
2508      1,
2509      TLS1_TXT_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2510      TLS1_RFC_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2511      TLS1_CK_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2512      SSL_kDHEPSK,
2513      SSL_aPSK,
2514      SSL_CAMELLIA128,
2515      SSL_SHA256,
2516      TLS1_VERSION, TLS1_2_VERSION,
2517      DTLS1_BAD_VER, DTLS1_2_VERSION,
2518      SSL_NOT_DEFAULT | SSL_HIGH,
2519      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2520      128,
2521      128,
2522      },
2523     {
2524      1,
2525      TLS1_TXT_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2526      TLS1_RFC_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2527      TLS1_CK_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2528      SSL_kDHEPSK,
2529      SSL_aPSK,
2530      SSL_CAMELLIA256,
2531      SSL_SHA384,
2532      TLS1_VERSION, TLS1_2_VERSION,
2533      DTLS1_BAD_VER, DTLS1_2_VERSION,
2534      SSL_NOT_DEFAULT | SSL_HIGH,
2535      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2536      256,
2537      256,
2538      },
2539     {
2540      1,
2541      TLS1_TXT_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2542      TLS1_RFC_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2543      TLS1_CK_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2544      SSL_kRSAPSK,
2545      SSL_aRSA,
2546      SSL_CAMELLIA128,
2547      SSL_SHA256,
2548      TLS1_VERSION, TLS1_2_VERSION,
2549      DTLS1_BAD_VER, DTLS1_2_VERSION,
2550      SSL_NOT_DEFAULT | SSL_HIGH,
2551      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2552      128,
2553      128,
2554      },
2555     {
2556      1,
2557      TLS1_TXT_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2558      TLS1_RFC_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2559      TLS1_CK_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2560      SSL_kRSAPSK,
2561      SSL_aRSA,
2562      SSL_CAMELLIA256,
2563      SSL_SHA384,
2564      TLS1_VERSION, TLS1_2_VERSION,
2565      DTLS1_BAD_VER, DTLS1_2_VERSION,
2566      SSL_NOT_DEFAULT | SSL_HIGH,
2567      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2568      256,
2569      256,
2570      },
2571     {
2572      1,
2573      TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2574      TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2575      TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2576      SSL_kECDHEPSK,
2577      SSL_aPSK,
2578      SSL_CAMELLIA128,
2579      SSL_SHA256,
2580      TLS1_VERSION, TLS1_2_VERSION,
2581      DTLS1_BAD_VER, DTLS1_2_VERSION,
2582      SSL_NOT_DEFAULT | SSL_HIGH,
2583      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2584      128,
2585      128,
2586      },
2587     {
2588      1,
2589      TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2590      TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2591      TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2592      SSL_kECDHEPSK,
2593      SSL_aPSK,
2594      SSL_CAMELLIA256,
2595      SSL_SHA384,
2596      TLS1_VERSION, TLS1_2_VERSION,
2597      DTLS1_BAD_VER, DTLS1_2_VERSION,
2598      SSL_NOT_DEFAULT | SSL_HIGH,
2599      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2600      256,
2601      256,
2602      },
2603 #endif                          /* OPENSSL_NO_CAMELLIA */
2604
2605 #ifndef OPENSSL_NO_GOST
2606     {
2607      1,
2608      "GOST2001-GOST89-GOST89",
2609      "TLS_GOSTR341001_WITH_28147_CNT_IMIT",
2610      0x3000081,
2611      SSL_kGOST,
2612      SSL_aGOST01,
2613      SSL_eGOST2814789CNT,
2614      SSL_GOST89MAC,
2615      TLS1_VERSION, TLS1_2_VERSION,
2616      0, 0,
2617      SSL_HIGH,
2618      SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94 | TLS1_STREAM_MAC,
2619      256,
2620      256,
2621      },
2622     {
2623      1,
2624      "GOST2001-NULL-GOST94",
2625      "TLS_GOSTR341001_WITH_NULL_GOSTR3411",
2626      0x3000083,
2627      SSL_kGOST,
2628      SSL_aGOST01,
2629      SSL_eNULL,
2630      SSL_GOST94,
2631      TLS1_VERSION, TLS1_2_VERSION,
2632      0, 0,
2633      SSL_STRONG_NONE,
2634      SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94,
2635      0,
2636      0,
2637      },
2638     {
2639      1,
2640      "GOST2012-GOST8912-GOST8912",
2641      NULL,
2642      0x0300ff85,
2643      SSL_kGOST,
2644      SSL_aGOST12 | SSL_aGOST01,
2645      SSL_eGOST2814789CNT12,
2646      SSL_GOST89MAC12,
2647      TLS1_VERSION, TLS1_2_VERSION,
2648      0, 0,
2649      SSL_HIGH,
2650      SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_STREAM_MAC,
2651      256,
2652      256,
2653      },
2654     {
2655      1,
2656      "GOST2012-NULL-GOST12",
2657      NULL,
2658      0x0300ff87,
2659      SSL_kGOST,
2660      SSL_aGOST12 | SSL_aGOST01,
2661      SSL_eNULL,
2662      SSL_GOST12_256,
2663      TLS1_VERSION, TLS1_2_VERSION,
2664      0, 0,
2665      SSL_STRONG_NONE,
2666      SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_STREAM_MAC,
2667      0,
2668      0,
2669      },
2670 #endif                          /* OPENSSL_NO_GOST */
2671
2672 #ifndef OPENSSL_NO_IDEA
2673     {
2674      1,
2675      SSL3_TXT_RSA_IDEA_128_SHA,
2676      SSL3_RFC_RSA_IDEA_128_SHA,
2677      SSL3_CK_RSA_IDEA_128_SHA,
2678      SSL_kRSA,
2679      SSL_aRSA,
2680      SSL_IDEA,
2681      SSL_SHA1,
2682      SSL3_VERSION, TLS1_1_VERSION,
2683      DTLS1_BAD_VER, DTLS1_VERSION,
2684      SSL_NOT_DEFAULT | SSL_MEDIUM,
2685      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2686      128,
2687      128,
2688      },
2689 #endif
2690
2691 #ifndef OPENSSL_NO_SEED
2692     {
2693      1,
2694      TLS1_TXT_RSA_WITH_SEED_SHA,
2695      TLS1_RFC_RSA_WITH_SEED_SHA,
2696      TLS1_CK_RSA_WITH_SEED_SHA,
2697      SSL_kRSA,
2698      SSL_aRSA,
2699      SSL_SEED,
2700      SSL_SHA1,
2701      SSL3_VERSION, TLS1_2_VERSION,
2702      DTLS1_BAD_VER, DTLS1_2_VERSION,
2703      SSL_NOT_DEFAULT | SSL_MEDIUM,
2704      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2705      128,
2706      128,
2707      },
2708     {
2709      1,
2710      TLS1_TXT_DHE_DSS_WITH_SEED_SHA,
2711      TLS1_RFC_DHE_DSS_WITH_SEED_SHA,
2712      TLS1_CK_DHE_DSS_WITH_SEED_SHA,
2713      SSL_kDHE,
2714      SSL_aDSS,
2715      SSL_SEED,
2716      SSL_SHA1,
2717      SSL3_VERSION, TLS1_2_VERSION,
2718      DTLS1_BAD_VER, DTLS1_2_VERSION,
2719      SSL_NOT_DEFAULT | SSL_MEDIUM,
2720      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2721      128,
2722      128,
2723      },
2724     {
2725      1,
2726      TLS1_TXT_DHE_RSA_WITH_SEED_SHA,
2727      TLS1_RFC_DHE_RSA_WITH_SEED_SHA,
2728      TLS1_CK_DHE_RSA_WITH_SEED_SHA,
2729      SSL_kDHE,
2730      SSL_aRSA,
2731      SSL_SEED,
2732      SSL_SHA1,
2733      SSL3_VERSION, TLS1_2_VERSION,
2734      DTLS1_BAD_VER, DTLS1_2_VERSION,
2735      SSL_NOT_DEFAULT | SSL_MEDIUM,
2736      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2737      128,
2738      128,
2739      },
2740     {
2741      1,
2742      TLS1_TXT_ADH_WITH_SEED_SHA,
2743      TLS1_RFC_ADH_WITH_SEED_SHA,
2744      TLS1_CK_ADH_WITH_SEED_SHA,
2745      SSL_kDHE,
2746      SSL_aNULL,
2747      SSL_SEED,
2748      SSL_SHA1,
2749      SSL3_VERSION, TLS1_2_VERSION,
2750      DTLS1_BAD_VER, DTLS1_2_VERSION,
2751      SSL_NOT_DEFAULT | SSL_MEDIUM,
2752      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2753      128,
2754      128,
2755      },
2756 #endif                          /* OPENSSL_NO_SEED */
2757
2758 #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
2759     {
2760      1,
2761      SSL3_TXT_RSA_RC4_128_MD5,
2762      SSL3_RFC_RSA_RC4_128_MD5,
2763      SSL3_CK_RSA_RC4_128_MD5,
2764      SSL_kRSA,
2765      SSL_aRSA,
2766      SSL_RC4,
2767      SSL_MD5,
2768      SSL3_VERSION, TLS1_2_VERSION,
2769      0, 0,
2770      SSL_NOT_DEFAULT | SSL_MEDIUM,
2771      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2772      128,
2773      128,
2774      },
2775     {
2776      1,
2777      SSL3_TXT_RSA_RC4_128_SHA,
2778      SSL3_RFC_RSA_RC4_128_SHA,
2779      SSL3_CK_RSA_RC4_128_SHA,
2780      SSL_kRSA,
2781      SSL_aRSA,
2782      SSL_RC4,
2783      SSL_SHA1,
2784      SSL3_VERSION, TLS1_2_VERSION,
2785      0, 0,
2786      SSL_NOT_DEFAULT | SSL_MEDIUM,
2787      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2788      128,
2789      128,
2790      },
2791     {
2792      1,
2793      SSL3_TXT_ADH_RC4_128_MD5,
2794      SSL3_RFC_ADH_RC4_128_MD5,
2795      SSL3_CK_ADH_RC4_128_MD5,
2796      SSL_kDHE,
2797      SSL_aNULL,
2798      SSL_RC4,
2799      SSL_MD5,
2800      SSL3_VERSION, TLS1_2_VERSION,
2801      0, 0,
2802      SSL_NOT_DEFAULT | SSL_MEDIUM,
2803      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2804      128,
2805      128,
2806      },
2807     {
2808      1,
2809      TLS1_TXT_ECDHE_PSK_WITH_RC4_128_SHA,
2810      TLS1_RFC_ECDHE_PSK_WITH_RC4_128_SHA,
2811      TLS1_CK_ECDHE_PSK_WITH_RC4_128_SHA,
2812      SSL_kECDHEPSK,
2813      SSL_aPSK,
2814      SSL_RC4,
2815      SSL_SHA1,
2816      TLS1_VERSION, TLS1_2_VERSION,
2817      0, 0,
2818      SSL_NOT_DEFAULT | SSL_MEDIUM,
2819      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2820      128,
2821      128,
2822      },
2823     {
2824      1,
2825      TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA,
2826      TLS1_RFC_ECDH_anon_WITH_RC4_128_SHA,
2827      TLS1_CK_ECDH_anon_WITH_RC4_128_SHA,
2828      SSL_kECDHE,
2829      SSL_aNULL,
2830      SSL_RC4,
2831      SSL_SHA1,
2832      TLS1_VERSION, TLS1_2_VERSION,
2833      0, 0,
2834      SSL_NOT_DEFAULT | SSL_MEDIUM,
2835      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2836      128,
2837      128,
2838      },
2839     {
2840      1,
2841      TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA,
2842      TLS1_RFC_ECDHE_ECDSA_WITH_RC4_128_SHA,
2843      TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA,
2844      SSL_kECDHE,
2845      SSL_aECDSA,
2846      SSL_RC4,
2847      SSL_SHA1,
2848      TLS1_VERSION, TLS1_2_VERSION,
2849      0, 0,
2850      SSL_NOT_DEFAULT | SSL_MEDIUM,
2851      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2852      128,
2853      128,
2854      },
2855     {
2856      1,
2857      TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA,
2858      TLS1_RFC_ECDHE_RSA_WITH_RC4_128_SHA,
2859      TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA,
2860      SSL_kECDHE,
2861      SSL_aRSA,
2862      SSL_RC4,
2863      SSL_SHA1,
2864      TLS1_VERSION, TLS1_2_VERSION,
2865      0, 0,
2866      SSL_NOT_DEFAULT | SSL_MEDIUM,
2867      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2868      128,
2869      128,
2870      },
2871     {
2872      1,
2873      TLS1_TXT_PSK_WITH_RC4_128_SHA,
2874      TLS1_RFC_PSK_WITH_RC4_128_SHA,
2875      TLS1_CK_PSK_WITH_RC4_128_SHA,
2876      SSL_kPSK,
2877      SSL_aPSK,
2878      SSL_RC4,
2879      SSL_SHA1,
2880      SSL3_VERSION, TLS1_2_VERSION,
2881      0, 0,
2882      SSL_NOT_DEFAULT | SSL_MEDIUM,
2883      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2884      128,
2885      128,
2886      },
2887     {
2888      1,
2889      TLS1_TXT_RSA_PSK_WITH_RC4_128_SHA,
2890      TLS1_RFC_RSA_PSK_WITH_RC4_128_SHA,
2891      TLS1_CK_RSA_PSK_WITH_RC4_128_SHA,
2892      SSL_kRSAPSK,
2893      SSL_aRSA,
2894      SSL_RC4,
2895      SSL_SHA1,
2896      SSL3_VERSION, TLS1_2_VERSION,
2897      0, 0,
2898      SSL_NOT_DEFAULT | SSL_MEDIUM,
2899      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2900      128,
2901      128,
2902      },
2903     {
2904      1,
2905      TLS1_TXT_DHE_PSK_WITH_RC4_128_SHA,
2906      TLS1_RFC_DHE_PSK_WITH_RC4_128_SHA,
2907      TLS1_CK_DHE_PSK_WITH_RC4_128_SHA,
2908      SSL_kDHEPSK,
2909      SSL_aPSK,
2910      SSL_RC4,
2911      SSL_SHA1,
2912      SSL3_VERSION, TLS1_2_VERSION,
2913      0, 0,
2914      SSL_NOT_DEFAULT | SSL_MEDIUM,
2915      SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2916      128,
2917      128,
2918      },
2919 #endif                          /* OPENSSL_NO_WEAK_SSL_CIPHERS */
2920
2921 #ifndef OPENSSL_NO_ARIA
2922     {
2923      1,
2924      TLS1_TXT_RSA_WITH_ARIA_128_GCM_SHA256,
2925      TLS1_RFC_RSA_WITH_ARIA_128_GCM_SHA256,
2926      TLS1_CK_RSA_WITH_ARIA_128_GCM_SHA256,
2927      SSL_kRSA,
2928      SSL_aRSA,
2929      SSL_ARIA128GCM,
2930      SSL_AEAD,
2931      TLS1_2_VERSION, TLS1_2_VERSION,
2932      DTLS1_2_VERSION, DTLS1_2_VERSION,
2933      SSL_NOT_DEFAULT | SSL_HIGH,
2934      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2935      128,
2936      128,
2937      },
2938     {
2939      1,
2940      TLS1_TXT_RSA_WITH_ARIA_256_GCM_SHA384,
2941      TLS1_RFC_RSA_WITH_ARIA_256_GCM_SHA384,
2942      TLS1_CK_RSA_WITH_ARIA_256_GCM_SHA384,
2943      SSL_kRSA,
2944      SSL_aRSA,
2945      SSL_ARIA256GCM,
2946      SSL_AEAD,
2947      TLS1_2_VERSION, TLS1_2_VERSION,
2948      DTLS1_2_VERSION, DTLS1_2_VERSION,
2949      SSL_NOT_DEFAULT | SSL_HIGH,
2950      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2951      256,
2952      256,
2953      },
2954     {
2955      1,
2956      TLS1_TXT_DHE_RSA_WITH_ARIA_128_GCM_SHA256,
2957      TLS1_RFC_DHE_RSA_WITH_ARIA_128_GCM_SHA256,
2958      TLS1_CK_DHE_RSA_WITH_ARIA_128_GCM_SHA256,
2959      SSL_kDHE,
2960      SSL_aRSA,
2961      SSL_ARIA128GCM,
2962      SSL_AEAD,
2963      TLS1_2_VERSION, TLS1_2_VERSION,
2964      DTLS1_2_VERSION, DTLS1_2_VERSION,
2965      SSL_NOT_DEFAULT | SSL_HIGH,
2966      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2967      128,
2968      128,
2969      },
2970     {
2971      1,
2972      TLS1_TXT_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
2973      TLS1_RFC_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
2974      TLS1_CK_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
2975      SSL_kDHE,
2976      SSL_aRSA,
2977      SSL_ARIA256GCM,
2978      SSL_AEAD,
2979      TLS1_2_VERSION, TLS1_2_VERSION,
2980      DTLS1_2_VERSION, DTLS1_2_VERSION,
2981      SSL_NOT_DEFAULT | SSL_HIGH,
2982      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2983      256,
2984      256,
2985      },
2986     {
2987      1,
2988      TLS1_TXT_DHE_DSS_WITH_ARIA_128_GCM_SHA256,
2989      TLS1_RFC_DHE_DSS_WITH_ARIA_128_GCM_SHA256,
2990      TLS1_CK_DHE_DSS_WITH_ARIA_128_GCM_SHA256,
2991      SSL_kDHE,
2992      SSL_aDSS,
2993      SSL_ARIA128GCM,
2994      SSL_AEAD,
2995      TLS1_2_VERSION, TLS1_2_VERSION,
2996      DTLS1_2_VERSION, DTLS1_2_VERSION,
2997      SSL_NOT_DEFAULT | SSL_HIGH,
2998      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2999      128,
3000      128,
3001      },
3002     {
3003      1,
3004      TLS1_TXT_DHE_DSS_WITH_ARIA_256_GCM_SHA384,
3005      TLS1_RFC_DHE_DSS_WITH_ARIA_256_GCM_SHA384,
3006      TLS1_CK_DHE_DSS_WITH_ARIA_256_GCM_SHA384,
3007      SSL_kDHE,
3008      SSL_aDSS,
3009      SSL_ARIA256GCM,
3010      SSL_AEAD,
3011      TLS1_2_VERSION, TLS1_2_VERSION,
3012      DTLS1_2_VERSION, DTLS1_2_VERSION,
3013      SSL_NOT_DEFAULT | SSL_HIGH,
3014      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3015      256,
3016      256,
3017      },
3018     {
3019      1,
3020      TLS1_TXT_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256,
3021      TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256,
3022      TLS1_CK_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256,
3023      SSL_kECDHE,
3024      SSL_aECDSA,
3025      SSL_ARIA128GCM,
3026      SSL_AEAD,
3027      TLS1_2_VERSION, TLS1_2_VERSION,
3028      DTLS1_2_VERSION, DTLS1_2_VERSION,
3029      SSL_NOT_DEFAULT | SSL_HIGH,
3030      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3031      128,
3032      128,
3033      },
3034     {
3035      1,
3036      TLS1_TXT_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384,
3037      TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384,
3038      TLS1_CK_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384,
3039      SSL_kECDHE,
3040      SSL_aECDSA,
3041      SSL_ARIA256GCM,
3042      SSL_AEAD,
3043      TLS1_2_VERSION, TLS1_2_VERSION,
3044      DTLS1_2_VERSION, DTLS1_2_VERSION,
3045      SSL_NOT_DEFAULT | SSL_HIGH,
3046      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3047      256,
3048      256,
3049      },
3050     {
3051      1,
3052      TLS1_TXT_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256,
3053      TLS1_RFC_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256,
3054      TLS1_CK_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256,
3055      SSL_kECDHE,
3056      SSL_aRSA,
3057      SSL_ARIA128GCM,
3058      SSL_AEAD,
3059      TLS1_2_VERSION, TLS1_2_VERSION,
3060      DTLS1_2_VERSION, DTLS1_2_VERSION,
3061      SSL_NOT_DEFAULT | SSL_HIGH,
3062      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3063      128,
3064      128,
3065      },
3066     {
3067      1,
3068      TLS1_TXT_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
3069      TLS1_RFC_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
3070      TLS1_CK_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
3071      SSL_kECDHE,
3072      SSL_aRSA,
3073      SSL_ARIA256GCM,
3074      SSL_AEAD,
3075      TLS1_2_VERSION, TLS1_2_VERSION,
3076      DTLS1_2_VERSION, DTLS1_2_VERSION,
3077      SSL_NOT_DEFAULT | SSL_HIGH,
3078      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3079      256,
3080      256,
3081      },
3082     {
3083      1,
3084      TLS1_TXT_PSK_WITH_ARIA_128_GCM_SHA256,
3085      TLS1_RFC_PSK_WITH_ARIA_128_GCM_SHA256,
3086      TLS1_CK_PSK_WITH_ARIA_128_GCM_SHA256,
3087      SSL_kPSK,
3088      SSL_aPSK,
3089      SSL_ARIA128GCM,
3090      SSL_AEAD,
3091      TLS1_2_VERSION, TLS1_2_VERSION,
3092      DTLS1_2_VERSION, DTLS1_2_VERSION,
3093      SSL_NOT_DEFAULT | SSL_HIGH,
3094      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3095      128,
3096      128,
3097      },
3098     {
3099      1,
3100      TLS1_TXT_PSK_WITH_ARIA_256_GCM_SHA384,
3101      TLS1_RFC_PSK_WITH_ARIA_256_GCM_SHA384,
3102      TLS1_CK_PSK_WITH_ARIA_256_GCM_SHA384,
3103      SSL_kPSK,
3104      SSL_aPSK,
3105      SSL_ARIA256GCM,
3106      SSL_AEAD,
3107      TLS1_2_VERSION, TLS1_2_VERSION,
3108      DTLS1_2_VERSION, DTLS1_2_VERSION,
3109      SSL_NOT_DEFAULT | SSL_HIGH,
3110      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3111      256,
3112      256,
3113      },
3114     {
3115      1,
3116      TLS1_TXT_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
3117      TLS1_RFC_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
3118      TLS1_CK_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
3119      SSL_kDHEPSK,
3120      SSL_aPSK,
3121      SSL_ARIA128GCM,
3122      SSL_AEAD,
3123      TLS1_2_VERSION, TLS1_2_VERSION,
3124      DTLS1_2_VERSION, DTLS1_2_VERSION,
3125      SSL_NOT_DEFAULT | SSL_HIGH,
3126      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3127      128,
3128      128,
3129      },
3130     {
3131      1,
3132      TLS1_TXT_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
3133      TLS1_RFC_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
3134      TLS1_CK_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
3135      SSL_kDHEPSK,
3136      SSL_aPSK,
3137      SSL_ARIA256GCM,
3138      SSL_AEAD,
3139      TLS1_2_VERSION, TLS1_2_VERSION,
3140      DTLS1_2_VERSION, DTLS1_2_VERSION,
3141      SSL_NOT_DEFAULT | SSL_HIGH,
3142      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3143      256,
3144      256,
3145      },
3146     {
3147      1,
3148      TLS1_TXT_RSA_PSK_WITH_ARIA_128_GCM_SHA256,
3149      TLS1_RFC_RSA_PSK_WITH_ARIA_128_GCM_SHA256,
3150      TLS1_CK_RSA_PSK_WITH_ARIA_128_GCM_SHA256,
3151      SSL_kRSAPSK,
3152      SSL_aRSA,
3153      SSL_ARIA128GCM,
3154      SSL_AEAD,
3155      TLS1_2_VERSION, TLS1_2_VERSION,
3156      DTLS1_2_VERSION, DTLS1_2_VERSION,
3157      SSL_NOT_DEFAULT | SSL_HIGH,
3158      SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3159      128,
3160      128,
3161      },
3162     {
3163      1,
3164      TLS1_TXT_RSA_PSK_WITH_ARIA_256_GCM_SHA384,
3165      TLS1_RFC_RSA_PSK_WITH_ARIA_256_GCM_SHA384,
3166      TLS1_CK_RSA_PSK_WITH_ARIA_256_GCM_SHA384,
3167      SSL_kRSAPSK,
3168      SSL_aRSA,
3169      SSL_ARIA256GCM,
3170      SSL_AEAD,
3171      TLS1_2_VERSION, TLS1_2_VERSION,
3172      DTLS1_2_VERSION, DTLS1_2_VERSION,
3173      SSL_NOT_DEFAULT | SSL_HIGH,
3174      SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3175      256,
3176      256,
3177      },
3178 #endif /* OPENSSL_NO_ARIA */
3179 };
3180
3181 /*
3182  * The list of known Signalling Cipher-Suite Value "ciphers", non-valid
3183  * values stuffed into the ciphers field of the wire protocol for signalling
3184  * purposes.
3185  */
3186 static SSL_CIPHER ssl3_scsvs[] = {
3187     {
3188      0,
3189      "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
3190      "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
3191      SSL3_CK_SCSV,
3192      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3193     },
3194     {
3195      0,
3196      "TLS_FALLBACK_SCSV",
3197      "TLS_FALLBACK_SCSV",
3198      SSL3_CK_FALLBACK_SCSV,
3199      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3200     },
3201 };
3202
3203 static int cipher_compare(const void *a, const void *b)
3204 {
3205     const SSL_CIPHER *ap = (const SSL_CIPHER *)a;
3206     const SSL_CIPHER *bp = (const SSL_CIPHER *)b;
3207
3208     if (ap->id == bp->id)
3209         return 0;
3210     return ap->id < bp->id ? -1 : 1;
3211 }
3212
3213 void ssl_sort_cipher_list(void)
3214 {
3215     qsort(tls13_ciphers, TLS13_NUM_CIPHERS, sizeof(tls13_ciphers[0]),
3216           cipher_compare);
3217     qsort(ssl3_ciphers, SSL3_NUM_CIPHERS, sizeof(ssl3_ciphers[0]),
3218           cipher_compare);
3219     qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
3220 }
3221
3222 static int ssl_undefined_function_1(SSL *ssl, unsigned char *r, size_t s,
3223                                     const char * t, size_t u,
3224                                     const unsigned char * v, size_t w, int x)
3225 {
3226     (void)r;
3227     (void)s;
3228     (void)t;
3229     (void)u;
3230     (void)v;
3231     (void)w;
3232     (void)x;
3233     return ssl_undefined_function(ssl);
3234 }
3235
3236 const SSL3_ENC_METHOD SSLv3_enc_data = {
3237     ssl3_enc,
3238     n_ssl3_mac,
3239     ssl3_setup_key_block,
3240     ssl3_generate_master_secret,
3241     ssl3_change_cipher_state,
3242     ssl3_final_finish_mac,
3243     SSL3_MD_CLIENT_FINISHED_CONST, 4,
3244     SSL3_MD_SERVER_FINISHED_CONST, 4,
3245     ssl3_alert_code,
3246     ssl_undefined_function_1,
3247     0,
3248     ssl3_set_handshake_header,
3249     tls_close_construct_packet,
3250     ssl3_handshake_write
3251 };
3252
3253 long ssl3_default_timeout(void)
3254 {
3255     /*
3256      * 2 hours, the 24 hours mentioned in the SSLv3 spec is way too long for
3257      * http, the cache would over fill
3258      */
3259     return (60 * 60 * 2);
3260 }
3261
3262 int ssl3_num_ciphers(void)
3263 {
3264     return SSL3_NUM_CIPHERS;
3265 }
3266
3267 const SSL_CIPHER *ssl3_get_cipher(unsigned int u)
3268 {
3269     if (u < SSL3_NUM_CIPHERS)
3270         return &(ssl3_ciphers[SSL3_NUM_CIPHERS - 1 - u]);
3271     else
3272         return NULL;
3273 }
3274
3275 int ssl3_set_handshake_header(SSL *s, WPACKET *pkt, int htype)
3276 {
3277     /* No header in the event of a CCS */
3278     if (htype == SSL3_MT_CHANGE_CIPHER_SPEC)
3279         return 1;
3280
3281     /* Set the content type and 3 bytes for the message len */
3282     if (!WPACKET_put_bytes_u8(pkt, htype)
3283             || !WPACKET_start_sub_packet_u24(pkt))
3284         return 0;
3285
3286     return 1;
3287 }
3288
3289 int ssl3_handshake_write(SSL *s)
3290 {
3291     return ssl3_do_write(s, SSL3_RT_HANDSHAKE);
3292 }
3293
3294 int ssl3_new(SSL *s)
3295 {
3296 #ifndef OPENSSL_NO_SRP
3297     if (!SSL_SRP_CTX_init(s))
3298         return 0;
3299 #endif
3300
3301     if (!s->method->ssl_clear(s))
3302         return 0;
3303
3304     return 1;
3305 }
3306
3307 void ssl3_free(SSL *s)
3308 {
3309     if (s == NULL)
3310         return;
3311
3312     ssl3_cleanup_key_block(s);
3313
3314 #if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH)
3315     EVP_PKEY_free(s->s3.peer_tmp);
3316     s->s3.peer_tmp = NULL;
3317     EVP_PKEY_free(s->s3.tmp.pkey);
3318     s->s3.tmp.pkey = NULL;
3319 #endif
3320
3321     ssl_evp_cipher_free(s->s3.tmp.new_sym_enc);
3322     ssl_evp_md_free(s->s3.tmp.new_hash);
3323
3324     OPENSSL_free(s->s3.tmp.ctype);
3325     sk_X509_NAME_pop_free(s->s3.tmp.peer_ca_names, X509_NAME_free);
3326     OPENSSL_free(s->s3.tmp.ciphers_raw);
3327     OPENSSL_clear_free(s->s3.tmp.pms, s->s3.tmp.pmslen);
3328     OPENSSL_free(s->s3.tmp.peer_sigalgs);
3329     OPENSSL_free(s->s3.tmp.peer_cert_sigalgs);
3330     ssl3_free_digest_list(s);
3331     OPENSSL_free(s->s3.alpn_selected);
3332     OPENSSL_free(s->s3.alpn_proposed);
3333
3334 #ifndef OPENSSL_NO_SRP
3335     SSL_SRP_CTX_free(s);
3336 #endif
3337     memset(&s->s3, 0, sizeof(s->s3));
3338 }
3339
3340 int ssl3_clear(SSL *s)
3341 {
3342     ssl3_cleanup_key_block(s);
3343     OPENSSL_free(s->s3.tmp.ctype);
3344     sk_X509_NAME_pop_free(s->s3.tmp.peer_ca_names, X509_NAME_free);
3345     OPENSSL_free(s->s3.tmp.ciphers_raw);
3346     OPENSSL_clear_free(s->s3.tmp.pms, s->s3.tmp.pmslen);
3347     OPENSSL_free(s->s3.tmp.peer_sigalgs);
3348     OPENSSL_free(s->s3.tmp.peer_cert_sigalgs);
3349
3350 #if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH)
3351     EVP_PKEY_free(s->s3.tmp.pkey);
3352     EVP_PKEY_free(s->s3.peer_tmp);
3353 #endif                          /* !OPENSSL_NO_EC */
3354
3355     ssl3_free_digest_list(s);
3356
3357     OPENSSL_free(s->s3.alpn_selected);
3358     OPENSSL_free(s->s3.alpn_proposed);
3359
3360     /* NULL/zero-out everything in the s3 struct */
3361     memset(&s->s3, 0, sizeof(s->s3));
3362
3363     if (!ssl_free_wbio_buffer(s))
3364         return 0;
3365
3366     s->version = SSL3_VERSION;
3367
3368 #if !defined(OPENSSL_NO_NEXTPROTONEG)
3369     OPENSSL_free(s->ext.npn);
3370     s->ext.npn = NULL;
3371     s->ext.npn_len = 0;
3372 #endif
3373
3374     return 1;
3375 }
3376
3377 #ifndef OPENSSL_NO_SRP
3378 static char *srp_password_from_info_cb(SSL *s, void *arg)
3379 {
3380     return OPENSSL_strdup(s->srp_ctx.info);
3381 }
3382 #endif
3383
3384 static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p, size_t len);
3385
3386 long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
3387 {
3388     int ret = 0;
3389
3390     switch (cmd) {
3391     case SSL_CTRL_GET_CLIENT_CERT_REQUEST:
3392         break;
3393     case SSL_CTRL_GET_NUM_RENEGOTIATIONS:
3394         ret = s->s3.num_renegotiations;
3395         break;
3396     case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS:
3397         ret = s->s3.num_renegotiations;
3398         s->s3.num_renegotiations = 0;
3399         break;
3400     case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS:
3401         ret = s->s3.total_renegotiations;
3402         break;
3403     case SSL_CTRL_GET_FLAGS:
3404         ret = (int)(s->s3.flags);
3405         break;
3406 #ifndef OPENSSL_NO_DH
3407     case SSL_CTRL_SET_TMP_DH:
3408         {
3409             DH *dh = (DH *)parg;
3410             EVP_PKEY *pkdh = NULL;
3411             if (dh == NULL) {
3412                 SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3413                 return 0;
3414             }
3415             pkdh = ssl_dh_to_pkey(dh);
3416             if (pkdh == NULL) {
3417                 SSLerr(SSL_F_SSL3_CTRL, ERR_R_MALLOC_FAILURE);
3418                 return 0;
3419             }
3420             if (!ssl_security(s, SSL_SECOP_TMP_DH,
3421                               EVP_PKEY_security_bits(pkdh), 0, pkdh)) {
3422                 SSLerr(SSL_F_SSL3_CTRL, SSL_R_DH_KEY_TOO_SMALL);
3423                 EVP_PKEY_free(pkdh);
3424                 return 0;
3425             }
3426             EVP_PKEY_free(s->cert->dh_tmp);
3427             s->cert->dh_tmp = pkdh;
3428             return 1;
3429         }
3430         break;
3431     case SSL_CTRL_SET_TMP_DH_CB:
3432         {
3433             SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
3434             return ret;
3435         }
3436     case SSL_CTRL_SET_DH_AUTO:
3437         s->cert->dh_tmp_auto = larg;
3438         return 1;
3439 #endif
3440 #ifndef OPENSSL_NO_EC
3441     case SSL_CTRL_SET_TMP_ECDH:
3442         {
3443             const EC_GROUP *group = NULL;
3444             int nid;
3445
3446             if (parg == NULL) {
3447                 SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3448                 return 0;
3449             }
3450             group = EC_KEY_get0_group((const EC_KEY *)parg);
3451             if (group == NULL) {
3452                 SSLerr(SSL_F_SSL3_CTRL, EC_R_MISSING_PARAMETERS);
3453                 return 0;
3454             }
3455             nid = EC_GROUP_get_curve_name(group);
3456             if (nid == NID_undef)
3457                 return 0;
3458             return tls1_set_groups(&s->ext.supportedgroups,
3459                                    &s->ext.supportedgroups_len,
3460                                    &nid, 1);
3461         }
3462         break;
3463 #endif                          /* !OPENSSL_NO_EC */
3464     case SSL_CTRL_SET_TLSEXT_HOSTNAME:
3465         /*
3466          * TODO(OpenSSL1.2)
3467          * This API is only used for a client to set what SNI it will request
3468          * from the server, but we currently allow it to be used on servers
3469          * as well, which is a programming error.  Currently we just clear
3470          * the field in SSL_do_handshake() for server SSLs, but when we can
3471          * make ABI-breaking changes, we may want to make use of this API
3472          * an error on server SSLs.
3473          */
3474         if (larg == TLSEXT_NAMETYPE_host_name) {
3475             size_t len;
3476
3477             OPENSSL_free(s->ext.hostname);
3478             s->ext.hostname = NULL;
3479
3480             ret = 1;
3481             if (parg == NULL)
3482                 break;
3483             len = strlen((char *)parg);
3484             if (len == 0 || len > TLSEXT_MAXLEN_host_name) {
3485                 SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME);
3486                 return 0;
3487             }
3488             if ((s->ext.hostname = OPENSSL_strdup((char *)parg)) == NULL) {
3489                 SSLerr(SSL_F_SSL3_CTRL, ERR_R_INTERNAL_ERROR);
3490                 return 0;
3491             }
3492         } else {
3493             SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE);
3494             return 0;
3495         }
3496         break;
3497     case SSL_CTRL_SET_TLSEXT_DEBUG_ARG:
3498         s->ext.debug_arg = parg;
3499         ret = 1;
3500         break;
3501
3502     case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
3503         ret = s->ext.status_type;
3504         break;
3505
3506     case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
3507         s->ext.status_type = larg;
3508         ret = 1;
3509         break;
3510
3511     case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS:
3512         *(STACK_OF(X509_EXTENSION) **)parg = s->ext.ocsp.exts;
3513         ret = 1;
3514         break;
3515
3516     case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS:
3517         s->ext.ocsp.exts = parg;
3518         ret = 1;
3519         break;
3520
3521     case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS:
3522         *(STACK_OF(OCSP_RESPID) **)parg = s->ext.ocsp.ids;
3523         ret = 1;
3524         break;
3525
3526     case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS:
3527         s->ext.ocsp.ids = parg;
3528         ret = 1;
3529         break;
3530
3531     case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP:
3532         *(unsigned char **)parg = s->ext.ocsp.resp;
3533         if (s->ext.ocsp.resp_len == 0
3534                 || s->ext.ocsp.resp_len > LONG_MAX)
3535             return -1;
3536         return (long)s->ext.ocsp.resp_len;
3537
3538     case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
3539         OPENSSL_free(s->ext.ocsp.resp);
3540         s->ext.ocsp.resp = parg;
3541         s->ext.ocsp.resp_len = larg;
3542         ret = 1;
3543         break;
3544
3545     case SSL_CTRL_CHAIN:
3546         if (larg)
3547             return ssl_cert_set1_chain(s, NULL, (STACK_OF(X509) *)parg);
3548         else
3549             return ssl_cert_set0_chain(s, NULL, (STACK_OF(X509) *)parg);
3550
3551     case SSL_CTRL_CHAIN_CERT:
3552         if (larg)
3553             return ssl_cert_add1_chain_cert(s, NULL, (X509 *)parg);
3554         else
3555             return ssl_cert_add0_chain_cert(s, NULL, (X509 *)parg);
3556
3557     case SSL_CTRL_GET_CHAIN_CERTS:
3558         *(STACK_OF(X509) **)parg = s->cert->key->chain;
3559         ret = 1;
3560         break;
3561
3562     case SSL_CTRL_SELECT_CURRENT_CERT:
3563         return ssl_cert_select_current(s->cert, (X509 *)parg);
3564
3565     case SSL_CTRL_SET_CURRENT_CERT:
3566         if (larg == SSL_CERT_SET_SERVER) {
3567             const SSL_CIPHER *cipher;
3568             if (!s->server)
3569                 return 0;
3570             cipher = s->s3.tmp.new_cipher;
3571             if (cipher == NULL)
3572                 return 0;
3573             /*
3574              * No certificate for unauthenticated ciphersuites or using SRP
3575              * authentication
3576              */
3577             if (cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP))
3578                 return 2;
3579             if (s->s3.tmp.cert == NULL)
3580                 return 0;
3581             s->cert->key = s->s3.tmp.cert;
3582             return 1;
3583         }
3584         return ssl_cert_set_current(s->cert, larg);
3585
3586 #if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH)
3587     case SSL_CTRL_GET_GROUPS:
3588         {
3589             uint16_t *clist;
3590             size_t clistlen;
3591
3592             if (!s->session)
3593                 return 0;
3594             clist = s->ext.peer_supportedgroups;
3595             clistlen = s->ext.peer_supportedgroups_len;
3596             if (parg) {
3597                 size_t i;
3598                 int *cptr = parg;
3599
3600                 for (i = 0; i < clistlen; i++) {
3601                     const TLS_GROUP_INFO *cinf = tls1_group_id_lookup(clist[i]);
3602
3603                     if (cinf != NULL)
3604                         cptr[i] = cinf->nid;
3605                     else
3606                         cptr[i] = TLSEXT_nid_unknown | clist[i];
3607                 }
3608             }
3609             return (int)clistlen;
3610         }
3611
3612     case SSL_CTRL_SET_GROUPS:
3613         return tls1_set_groups(&s->ext.supportedgroups,
3614                                &s->ext.supportedgroups_len, parg, larg);
3615
3616     case SSL_CTRL_SET_GROUPS_LIST:
3617         return tls1_set_groups_list(&s->ext.supportedgroups,
3618                                     &s->ext.supportedgroups_len, parg);
3619
3620     case SSL_CTRL_GET_SHARED_GROUP:
3621         {
3622             uint16_t id = tls1_shared_group(s, larg);
3623
3624             if (larg != -1)
3625                 return tls1_group_id2nid(id);
3626             return id;
3627         }
3628     case SSL_CTRL_GET_NEGOTIATED_GROUP:
3629         ret = tls1_group_id2nid(s->s3.group_id);
3630         break;
3631 #endif /* !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH) */
3632
3633     case SSL_CTRL_SET_SIGALGS:
3634         return tls1_set_sigalgs(s->cert, parg, larg, 0);
3635
3636     case SSL_CTRL_SET_SIGALGS_LIST:
3637         return tls1_set_sigalgs_list(s->cert, parg, 0);
3638
3639     case SSL_CTRL_SET_CLIENT_SIGALGS:
3640         return tls1_set_sigalgs(s->cert, parg, larg, 1);
3641
3642     case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
3643         return tls1_set_sigalgs_list(s->cert, parg, 1);
3644
3645     case SSL_CTRL_GET_CLIENT_CERT_TYPES:
3646         {
3647             const unsigned char **pctype = parg;
3648             if (s->server || !s->s3.tmp.cert_req)
3649                 return 0;
3650             if (pctype)
3651                 *pctype = s->s3.tmp.ctype;
3652             return s->s3.tmp.ctype_len;
3653         }
3654
3655     case SSL_CTRL_SET_CLIENT_CERT_TYPES:
3656         if (!s->server)
3657             return 0;
3658         return ssl3_set_req_cert_type(s->cert, parg, larg);
3659
3660     case SSL_CTRL_BUILD_CERT_CHAIN:
3661         return ssl_build_cert_chain(s, NULL, larg);
3662
3663     case SSL_CTRL_SET_VERIFY_CERT_STORE:
3664         return ssl_cert_set_cert_store(s->cert, parg, 0, larg);
3665
3666     case SSL_CTRL_SET_CHAIN_CERT_STORE:
3667         return ssl_cert_set_cert_store(s->cert, parg, 1, larg);
3668
3669     case SSL_CTRL_GET_PEER_SIGNATURE_NID:
3670         if (s->s3.tmp.peer_sigalg == NULL)
3671             return 0;
3672         *(int *)parg = s->s3.tmp.peer_sigalg->hash;
3673         return 1;
3674
3675     case SSL_CTRL_GET_SIGNATURE_NID:
3676         if (s->s3.tmp.sigalg == NULL)
3677             return 0;
3678         *(int *)parg = s->s3.tmp.sigalg->hash;
3679         return 1;
3680
3681     case SSL_CTRL_GET_PEER_TMP_KEY:
3682 #if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC)
3683         if (s->session == NULL || s->s3.peer_tmp == NULL) {
3684             return 0;
3685         } else {
3686             EVP_PKEY_up_ref(s->s3.peer_tmp);
3687             *(EVP_PKEY **)parg = s->s3.peer_tmp;
3688             return 1;
3689         }
3690 #else
3691         return 0;
3692 #endif
3693
3694     case SSL_CTRL_GET_TMP_KEY:
3695 #if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC)
3696         if (s->session == NULL || s->s3.tmp.pkey == NULL) {
3697             return 0;
3698         } else {
3699             EVP_PKEY_up_ref(s->s3.tmp.pkey);
3700             *(EVP_PKEY **)parg = s->s3.tmp.pkey;
3701             return 1;
3702         }
3703 #else
3704         return 0;
3705 #endif
3706
3707 #ifndef OPENSSL_NO_EC
3708     case SSL_CTRL_GET_EC_POINT_FORMATS:
3709         {
3710             const unsigned char **pformat = parg;
3711
3712             if (s->ext.peer_ecpointformats == NULL)
3713                 return 0;
3714             *pformat = s->ext.peer_ecpointformats;
3715             return (int)s->ext.peer_ecpointformats_len;
3716         }
3717 #endif
3718
3719     default:
3720         break;
3721     }
3722     return ret;
3723 }
3724
3725 long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp) (void))
3726 {
3727     int ret = 0;
3728
3729     switch (cmd) {
3730 #ifndef OPENSSL_NO_DH
3731     case SSL_CTRL_SET_TMP_DH_CB:
3732         {
3733             s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
3734         }
3735         break;
3736 #endif
3737     case SSL_CTRL_SET_TLSEXT_DEBUG_CB:
3738         s->ext.debug_cb = (void (*)(SSL *, int, int,
3739                                     const unsigned char *, int, void *))fp;
3740         break;
3741
3742     case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
3743         {
3744             s->not_resumable_session_cb = (int (*)(SSL *, int))fp;
3745         }
3746         break;
3747     default:
3748         break;
3749     }
3750     return ret;
3751 }
3752
3753 long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
3754 {
3755     switch (cmd) {
3756 #ifndef OPENSSL_NO_DH
3757     case SSL_CTRL_SET_TMP_DH:
3758         {
3759             DH *dh = (DH *)parg;
3760             EVP_PKEY *pkdh = NULL;
3761             if (dh == NULL) {
3762                 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3763                 return 0;
3764             }
3765             pkdh = ssl_dh_to_pkey(dh);
3766             if (pkdh == NULL) {
3767                 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_MALLOC_FAILURE);
3768                 return 0;
3769             }
3770             if (!ssl_ctx_security(ctx, SSL_SECOP_TMP_DH,
3771                                   EVP_PKEY_security_bits(pkdh), 0, pkdh)) {
3772                 SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_DH_KEY_TOO_SMALL);
3773                 EVP_PKEY_free(pkdh);
3774                 return 0;
3775             }
3776             EVP_PKEY_free(ctx->cert->dh_tmp);
3777             ctx->cert->dh_tmp = pkdh;
3778             return 1;
3779         }
3780     case SSL_CTRL_SET_TMP_DH_CB:
3781         {
3782             SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
3783             return 0;
3784         }
3785     case SSL_CTRL_SET_DH_AUTO:
3786         ctx->cert->dh_tmp_auto = larg;
3787         return 1;
3788 #endif
3789 #ifndef OPENSSL_NO_EC
3790     case SSL_CTRL_SET_TMP_ECDH:
3791         {
3792             const EC_GROUP *group = NULL;
3793             int nid;
3794
3795             if (parg == NULL) {
3796                 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3797                 return 0;
3798             }
3799             group = EC_KEY_get0_group((const EC_KEY *)parg);
3800             if (group == NULL) {
3801                 SSLerr(SSL_F_SSL3_CTX_CTRL, EC_R_MISSING_PARAMETERS);
3802                 return 0;
3803             }
3804             nid = EC_GROUP_get_curve_name(group);
3805             if (nid == NID_undef)
3806                 return 0;
3807             return tls1_set_groups(&ctx->ext.supportedgroups,
3808                                    &ctx->ext.supportedgroups_len,
3809                                    &nid, 1);
3810         }
3811 #endif                          /* !OPENSSL_NO_EC */
3812     case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG:
3813         ctx->ext.servername_arg = parg;
3814         break;
3815     case SSL_CTRL_SET_TLSEXT_TICKET_KEYS:
3816     case SSL_CTRL_GET_TLSEXT_TICKET_KEYS:
3817         {
3818             unsigned char *keys = parg;
3819             long tick_keylen = (sizeof(ctx->ext.tick_key_name) +
3820                                 sizeof(ctx->ext.secure->tick_hmac_key) +
3821                                 sizeof(ctx->ext.secure->tick_aes_key));
3822             if (keys == NULL)
3823                 return tick_keylen;
3824             if (larg != tick_keylen) {
3825                 SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_TICKET_KEYS_LENGTH);
3826                 return 0;
3827             }
3828             if (cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEYS) {
3829                 memcpy(ctx->ext.tick_key_name, keys,
3830                        sizeof(ctx->ext.tick_key_name));
3831                 memcpy(ctx->ext.secure->tick_hmac_key,
3832                        keys + sizeof(ctx->ext.tick_key_name),
3833                        sizeof(ctx->ext.secure->tick_hmac_key));
3834                 memcpy(ctx->ext.secure->tick_aes_key,
3835                        keys + sizeof(ctx->ext.tick_key_name) +
3836                        sizeof(ctx->ext.secure->tick_hmac_key),
3837                        sizeof(ctx->ext.secure->tick_aes_key));
3838             } else {
3839                 memcpy(keys, ctx->ext.tick_key_name,
3840                        sizeof(ctx->ext.tick_key_name));
3841                 memcpy(keys + sizeof(ctx->ext.tick_key_name),
3842                        ctx->ext.secure->tick_hmac_key,
3843                        sizeof(ctx->ext.secure->tick_hmac_key));
3844                 memcpy(keys + sizeof(ctx->ext.tick_key_name) +
3845                        sizeof(ctx->ext.secure->tick_hmac_key),
3846                        ctx->ext.secure->tick_aes_key,
3847                        sizeof(ctx->ext.secure->tick_aes_key));
3848             }
3849             return 1;
3850         }
3851
3852     case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
3853         return ctx->ext.status_type;
3854
3855     case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
3856         ctx->ext.status_type = larg;
3857         break;
3858
3859     case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
3860         ctx->ext.status_arg = parg;
3861         return 1;
3862
3863     case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG:
3864         *(void**)parg = ctx->ext.status_arg;
3865         break;
3866
3867     case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB:
3868         *(int (**)(SSL*, void*))parg = ctx->ext.status_cb;
3869         break;
3870
3871 #ifndef OPENSSL_NO_SRP
3872     case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
3873         ctx->srp_ctx.srp_Mask |= SSL_kSRP;
3874         OPENSSL_free(ctx->srp_ctx.login);
3875         ctx->srp_ctx.login = NULL;
3876         if (parg == NULL)
3877             break;
3878         if (strlen((const char *)parg) > 255 || strlen((const char *)parg) < 1) {
3879             SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_SRP_USERNAME);
3880             return 0;
3881         }
3882         if ((ctx->srp_ctx.login = OPENSSL_strdup((char *)parg)) == NULL) {
3883             SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_INTERNAL_ERROR);
3884             return 0;
3885         }
3886         break;
3887     case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD:
3888         ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
3889             srp_password_from_info_cb;
3890         if (ctx->srp_ctx.info != NULL)
3891             OPENSSL_free(ctx->srp_ctx.info);
3892         if ((ctx->srp_ctx.info = OPENSSL_strdup((char *)parg)) == NULL) {
3893             SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_INTERNAL_ERROR);
3894             return 0;
3895         }
3896         break;
3897     case SSL_CTRL_SET_SRP_ARG:
3898         ctx->srp_ctx.srp_Mask |= SSL_kSRP;
3899         ctx->srp_ctx.SRP_cb_arg = parg;
3900         break;
3901
3902     case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH:
3903         ctx->srp_ctx.strength = larg;
3904         break;
3905 #endif
3906
3907 #if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH)
3908     case SSL_CTRL_SET_GROUPS:
3909         return tls1_set_groups(&ctx->ext.supportedgroups,
3910                                &ctx->ext.supportedgroups_len,
3911                                parg, larg);
3912
3913     case SSL_CTRL_SET_GROUPS_LIST:
3914         return tls1_set_groups_list(&ctx->ext.supportedgroups,
3915                                     &ctx->ext.supportedgroups_len,
3916                                     parg);
3917 #endif /* !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH) */
3918
3919     case SSL_CTRL_SET_SIGALGS:
3920         return tls1_set_sigalgs(ctx->cert, parg, larg, 0);
3921
3922     case SSL_CTRL_SET_SIGALGS_LIST:
3923         return tls1_set_sigalgs_list(ctx->cert, parg, 0);
3924
3925     case SSL_CTRL_SET_CLIENT_SIGALGS:
3926         return tls1_set_sigalgs(ctx->cert, parg, larg, 1);
3927
3928     case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
3929         return tls1_set_sigalgs_list(ctx->cert, parg, 1);
3930
3931     case SSL_CTRL_SET_CLIENT_CERT_TYPES:
3932         return ssl3_set_req_cert_type(ctx->cert, parg, larg);
3933
3934     case SSL_CTRL_BUILD_CERT_CHAIN:
3935         return ssl_build_cert_chain(NULL, ctx, larg);
3936
3937     case SSL_CTRL_SET_VERIFY_CERT_STORE:
3938         return ssl_cert_set_cert_store(ctx->cert, parg, 0, larg);
3939
3940     case SSL_CTRL_SET_CHAIN_CERT_STORE:
3941         return ssl_cert_set_cert_store(ctx->cert, parg, 1, larg);
3942
3943         /* A Thawte special :-) */
3944     case SSL_CTRL_EXTRA_CHAIN_CERT:
3945         if (ctx->extra_certs == NULL) {
3946             if ((ctx->extra_certs = sk_X509_new_null()) == NULL) {
3947                 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_MALLOC_FAILURE);
3948                 return 0;
3949             }
3950         }
3951         if (!X509v3_cache_extensions((X509 *)parg, ctx->libctx, ctx->propq)) {
3952             SSLerr(0, ERR_LIB_X509);
3953             return 0;
3954         }
3955         if (!sk_X509_push(ctx->extra_certs, (X509 *)parg)) {
3956             SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_MALLOC_FAILURE);
3957             return 0;
3958         }
3959         break;
3960
3961     case SSL_CTRL_GET_EXTRA_CHAIN_CERTS:
3962         if (ctx->extra_certs == NULL && larg == 0)
3963             *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
3964         else
3965             *(STACK_OF(X509) **)parg = ctx->extra_certs;
3966         break;
3967
3968     case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS:
3969         sk_X509_pop_free(ctx->extra_certs, X509_free);
3970         ctx->extra_certs = NULL;
3971         break;
3972
3973     case SSL_CTRL_CHAIN:
3974         if (larg)
3975             return ssl_cert_set1_chain(NULL, ctx, (STACK_OF(X509) *)parg);
3976         else
3977             return ssl_cert_set0_chain(NULL, ctx, (STACK_OF(X509) *)parg);
3978
3979     case SSL_CTRL_CHAIN_CERT:
3980         if (larg)
3981             return ssl_cert_add1_chain_cert(NULL, ctx, (X509 *)parg);
3982         else
3983             return ssl_cert_add0_chain_cert(NULL, ctx, (X509 *)parg);
3984
3985     case SSL_CTRL_GET_CHAIN_CERTS:
3986         *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
3987         break;
3988
3989     case SSL_CTRL_SELECT_CURRENT_CERT:
3990         return ssl_cert_select_current(ctx->cert, (X509 *)parg);
3991
3992     case SSL_CTRL_SET_CURRENT_CERT:
3993         return ssl_cert_set_current(ctx->cert, larg);
3994
3995     default:
3996         return 0;
3997     }
3998     return 1;
3999 }
4000
4001 long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp) (void))
4002 {
4003     switch (cmd) {
4004 #ifndef OPENSSL_NO_DH
4005     case SSL_CTRL_SET_TMP_DH_CB:
4006         {
4007             ctx->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
4008         }
4009         break;
4010 #endif
4011     case SSL_CTRL_SET_TLSEXT_SERVERNAME_CB:
4012         ctx->ext.servername_cb = (int (*)(SSL *, int *, void *))fp;
4013         break;
4014
4015     case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB:
4016         ctx->ext.status_cb = (int (*)(SSL *, void *))fp;
4017         break;
4018
4019 # ifndef OPENSSL_NO_DEPRECATED_3_0
4020     case SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB:
4021         ctx->ext.ticket_key_cb = (int (*)(SSL *, unsigned char *,
4022                                              unsigned char *,
4023                                              EVP_CIPHER_CTX *,
4024                                              HMAC_CTX *, int))fp;
4025         break;
4026 #endif
4027
4028 #ifndef OPENSSL_NO_SRP
4029     case SSL_CTRL_SET_SRP_VERIFY_PARAM_CB:
4030         ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4031         ctx->srp_ctx.SRP_verify_param_callback = (int (*)(SSL *, void *))fp;
4032         break;
4033     case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB:
4034         ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4035         ctx->srp_ctx.TLS_ext_srp_username_callback =
4036             (int (*)(SSL *, int *, void *))fp;
4037         break;
4038     case SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB:
4039         ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4040         ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
4041             (char *(*)(SSL *, void *))fp;
4042         break;
4043 #endif
4044     case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
4045         {
4046             ctx->not_resumable_session_cb = (int (*)(SSL *, int))fp;
4047         }
4048         break;
4049     default:
4050         return 0;
4051     }
4052     return 1;
4053 }
4054
4055 int SSL_CTX_set_tlsext_ticket_key_evp_cb
4056     (SSL_CTX *ctx, int (*fp)(SSL *, unsigned char *, unsigned char *,
4057                              EVP_CIPHER_CTX *, EVP_MAC_CTX *, int))
4058 {
4059     ctx->ext.ticket_key_evp_cb = fp;
4060     return 1;
4061 }
4062
4063 const SSL_CIPHER *ssl3_get_cipher_by_id(uint32_t id)
4064 {
4065     SSL_CIPHER c;
4066     const SSL_CIPHER *cp;
4067
4068     c.id = id;
4069     cp = OBJ_bsearch_ssl_cipher_id(&c, tls13_ciphers, TLS13_NUM_CIPHERS);
4070     if (cp != NULL)
4071         return cp;
4072     cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS);
4073     if (cp != NULL)
4074         return cp;
4075     return OBJ_bsearch_ssl_cipher_id(&c, ssl3_scsvs, SSL3_NUM_SCSVS);
4076 }
4077
4078 const SSL_CIPHER *ssl3_get_cipher_by_std_name(const char *stdname)
4079 {
4080     SSL_CIPHER *c = NULL, *tbl;
4081     SSL_CIPHER *alltabs[] = {tls13_ciphers, ssl3_ciphers};
4082     size_t i, j, tblsize[] = {TLS13_NUM_CIPHERS, SSL3_NUM_CIPHERS};
4083
4084     /* this is not efficient, necessary to optimize this? */
4085     for (j = 0; j < OSSL_NELEM(alltabs); j++) {
4086         for (i = 0, tbl = alltabs[j]; i < tblsize[j]; i++, tbl++) {
4087             if (tbl->stdname == NULL)
4088                 continue;
4089             if (strcmp(stdname, tbl->stdname) == 0) {
4090                 c = tbl;
4091                 break;
4092             }
4093         }
4094     }
4095     if (c == NULL) {
4096         tbl = ssl3_scsvs;
4097         for (i = 0; i < SSL3_NUM_SCSVS; i++, tbl++) {
4098             if (strcmp(stdname, tbl->stdname) == 0) {