]> git.ipfire.org Git - thirdparty/openssl.git/blob - ssl/s3_lib.c
Rename some BUF_xxx to OPENSSL_xxx
[thirdparty/openssl.git] / ssl / s3_lib.c
1 /* ssl/s3_lib.c */
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58 /* ====================================================================
59 * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 *
65 * 1. Redistributions of source code must retain the above copyright
66 * notice, this list of conditions and the following disclaimer.
67 *
68 * 2. Redistributions in binary form must reproduce the above copyright
69 * notice, this list of conditions and the following disclaimer in
70 * the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3. All advertising materials mentioning features or use of this
74 * software must display the following acknowledgment:
75 * "This product includes software developed by the OpenSSL Project
76 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77 *
78 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79 * endorse or promote products derived from this software without
80 * prior written permission. For written permission, please contact
81 * openssl-core@openssl.org.
82 *
83 * 5. Products derived from this software may not be called "OpenSSL"
84 * nor may "OpenSSL" appear in their names without prior written
85 * permission of the OpenSSL Project.
86 *
87 * 6. Redistributions of any form whatsoever must retain the following
88 * acknowledgment:
89 * "This product includes software developed by the OpenSSL Project
90 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91 *
92 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
96 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103 * OF THE POSSIBILITY OF SUCH DAMAGE.
104 * ====================================================================
105 *
106 * This product includes cryptographic software written by Eric Young
107 * (eay@cryptsoft.com). This product includes software written by Tim
108 * Hudson (tjh@cryptsoft.com).
109 *
110 */
111 /* ====================================================================
112 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
113 *
114 * Portions of the attached software ("Contribution") are developed by
115 * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
116 *
117 * The Contribution is licensed pursuant to the OpenSSL open source
118 * license provided above.
119 *
120 * ECC cipher suite support in OpenSSL originally written by
121 * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories.
122 *
123 */
124 /* ====================================================================
125 * Copyright 2005 Nokia. All rights reserved.
126 *
127 * The portions of the attached software ("Contribution") is developed by
128 * Nokia Corporation and is licensed pursuant to the OpenSSL open source
129 * license.
130 *
131 * The Contribution, originally written by Mika Kousa and Pasi Eronen of
132 * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
133 * support (see RFC 4279) to OpenSSL.
134 *
135 * No patent licenses or other rights except those expressly stated in
136 * the OpenSSL open source license shall be deemed granted or received
137 * expressly, by implication, estoppel, or otherwise.
138 *
139 * No assurances are provided by Nokia that the Contribution does not
140 * infringe the patent or other intellectual property rights of any third
141 * party or that the license provides you with all the necessary rights
142 * to make use of the Contribution.
143 *
144 * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
145 * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
146 * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
147 * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
148 * OTHERWISE.
149 */
150
151 #include <stdio.h>
152 #include <openssl/objects.h>
153 #include "ssl_locl.h"
154 #include <openssl/md5.h>
155 #ifndef OPENSSL_NO_DH
156 # include <openssl/dh.h>
157 #endif
158 #include <openssl/rand.h>
159
160 #define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers)
161
162 /* list of available SSLv3 ciphers (sorted by id) */
163 OPENSSL_GLOBAL const SSL_CIPHER ssl3_ciphers[] = {
164
165 /* The RSA ciphers */
166 /* Cipher 01 */
167 {
168 1,
169 SSL3_TXT_RSA_NULL_MD5,
170 SSL3_CK_RSA_NULL_MD5,
171 SSL_kRSA,
172 SSL_aRSA,
173 SSL_eNULL,
174 SSL_MD5,
175 SSL_SSLV3,
176 SSL_NOT_DEFAULT | SSL_STRONG_NONE,
177 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
178 0,
179 0,
180 },
181
182 /* Cipher 02 */
183 {
184 1,
185 SSL3_TXT_RSA_NULL_SHA,
186 SSL3_CK_RSA_NULL_SHA,
187 SSL_kRSA,
188 SSL_aRSA,
189 SSL_eNULL,
190 SSL_SHA1,
191 SSL_SSLV3,
192 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
193 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
194 0,
195 0,
196 },
197
198 /* Cipher 04 */
199 {
200 1,
201 SSL3_TXT_RSA_RC4_128_MD5,
202 SSL3_CK_RSA_RC4_128_MD5,
203 SSL_kRSA,
204 SSL_aRSA,
205 SSL_RC4,
206 SSL_MD5,
207 SSL_SSLV3,
208 SSL_NOT_DEFAULT | SSL_MEDIUM,
209 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
210 128,
211 128,
212 },
213
214 /* Cipher 05 */
215 {
216 1,
217 SSL3_TXT_RSA_RC4_128_SHA,
218 SSL3_CK_RSA_RC4_128_SHA,
219 SSL_kRSA,
220 SSL_aRSA,
221 SSL_RC4,
222 SSL_SHA1,
223 SSL_SSLV3,
224 SSL_NOT_DEFAULT | SSL_MEDIUM,
225 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
226 128,
227 128,
228 },
229
230 /* Cipher 07 */
231 #ifndef OPENSSL_NO_IDEA
232 {
233 1,
234 SSL3_TXT_RSA_IDEA_128_SHA,
235 SSL3_CK_RSA_IDEA_128_SHA,
236 SSL_kRSA,
237 SSL_aRSA,
238 SSL_IDEA,
239 SSL_SHA1,
240 SSL_SSLV3,
241 SSL_MEDIUM,
242 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
243 128,
244 128,
245 },
246 #endif
247
248 /* Cipher 0A */
249 {
250 1,
251 SSL3_TXT_RSA_DES_192_CBC3_SHA,
252 SSL3_CK_RSA_DES_192_CBC3_SHA,
253 SSL_kRSA,
254 SSL_aRSA,
255 SSL_3DES,
256 SSL_SHA1,
257 SSL_SSLV3,
258 SSL_HIGH | SSL_FIPS,
259 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
260 112,
261 168,
262 },
263
264 /* Cipher 0D */
265 {
266 1,
267 SSL3_TXT_DH_DSS_DES_192_CBC3_SHA,
268 SSL3_CK_DH_DSS_DES_192_CBC3_SHA,
269 SSL_kDHd,
270 SSL_aDH,
271 SSL_3DES,
272 SSL_SHA1,
273 SSL_SSLV3,
274 SSL_HIGH | SSL_FIPS,
275 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
276 112,
277 168,
278 },
279
280 /* Cipher 10 */
281 {
282 1,
283 SSL3_TXT_DH_RSA_DES_192_CBC3_SHA,
284 SSL3_CK_DH_RSA_DES_192_CBC3_SHA,
285 SSL_kDHr,
286 SSL_aDH,
287 SSL_3DES,
288 SSL_SHA1,
289 SSL_SSLV3,
290 SSL_HIGH | SSL_FIPS,
291 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
292 112,
293 168,
294 },
295
296 /* Cipher 13 */
297 {
298 1,
299 SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA,
300 SSL3_CK_DHE_DSS_DES_192_CBC3_SHA,
301 SSL_kDHE,
302 SSL_aDSS,
303 SSL_3DES,
304 SSL_SHA1,
305 SSL_SSLV3,
306 SSL_HIGH | SSL_FIPS,
307 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
308 112,
309 168,
310 },
311
312 /* Cipher 16 */
313 {
314 1,
315 SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA,
316 SSL3_CK_DHE_RSA_DES_192_CBC3_SHA,
317 SSL_kDHE,
318 SSL_aRSA,
319 SSL_3DES,
320 SSL_SHA1,
321 SSL_SSLV3,
322 SSL_HIGH | SSL_FIPS,
323 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
324 112,
325 168,
326 },
327
328 /* Cipher 18 */
329 {
330 1,
331 SSL3_TXT_ADH_RC4_128_MD5,
332 SSL3_CK_ADH_RC4_128_MD5,
333 SSL_kDHE,
334 SSL_aNULL,
335 SSL_RC4,
336 SSL_MD5,
337 SSL_SSLV3,
338 SSL_NOT_DEFAULT | SSL_MEDIUM,
339 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
340 128,
341 128,
342 },
343
344 /* Cipher 1B */
345 {
346 1,
347 SSL3_TXT_ADH_DES_192_CBC_SHA,
348 SSL3_CK_ADH_DES_192_CBC_SHA,
349 SSL_kDHE,
350 SSL_aNULL,
351 SSL_3DES,
352 SSL_SHA1,
353 SSL_SSLV3,
354 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
355 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
356 112,
357 168,
358 },
359 #ifndef OPENSSL_NO_PSK
360 /* Cipher 2C */
361 {
362 1,
363 TLS1_TXT_PSK_WITH_NULL_SHA,
364 TLS1_CK_PSK_WITH_NULL_SHA,
365 SSL_kPSK,
366 SSL_aPSK,
367 SSL_eNULL,
368 SSL_SHA1,
369 SSL_SSLV3,
370 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
371 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
372 0,
373 0,
374 },
375 /* Cipher 2D */
376 {
377 1,
378 TLS1_TXT_DHE_PSK_WITH_NULL_SHA,
379 TLS1_CK_DHE_PSK_WITH_NULL_SHA,
380 SSL_kDHEPSK,
381 SSL_aPSK,
382 SSL_eNULL,
383 SSL_SHA1,
384 SSL_SSLV3,
385 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
386 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
387 0,
388 0,
389 },
390 /* Cipher 2E */
391 {
392 1,
393 TLS1_TXT_RSA_PSK_WITH_NULL_SHA,
394 TLS1_CK_RSA_PSK_WITH_NULL_SHA,
395 SSL_kRSAPSK,
396 SSL_aRSA,
397 SSL_eNULL,
398 SSL_SHA1,
399 SSL_SSLV3,
400 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
401 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
402 0,
403 0,
404 },
405 #endif
406
407 /* New AES ciphersuites */
408 /* Cipher 2F */
409 {
410 1,
411 TLS1_TXT_RSA_WITH_AES_128_SHA,
412 TLS1_CK_RSA_WITH_AES_128_SHA,
413 SSL_kRSA,
414 SSL_aRSA,
415 SSL_AES128,
416 SSL_SHA1,
417 SSL_SSLV3,
418 SSL_HIGH | SSL_FIPS,
419 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
420 128,
421 128,
422 },
423 /* Cipher 30 */
424 {
425 1,
426 TLS1_TXT_DH_DSS_WITH_AES_128_SHA,
427 TLS1_CK_DH_DSS_WITH_AES_128_SHA,
428 SSL_kDHd,
429 SSL_aDH,
430 SSL_AES128,
431 SSL_SHA1,
432 SSL_SSLV3,
433 SSL_HIGH | SSL_FIPS,
434 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
435 128,
436 128,
437 },
438 /* Cipher 31 */
439 {
440 1,
441 TLS1_TXT_DH_RSA_WITH_AES_128_SHA,
442 TLS1_CK_DH_RSA_WITH_AES_128_SHA,
443 SSL_kDHr,
444 SSL_aDH,
445 SSL_AES128,
446 SSL_SHA1,
447 SSL_SSLV3,
448 SSL_HIGH | SSL_FIPS,
449 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
450 128,
451 128,
452 },
453 /* Cipher 32 */
454 {
455 1,
456 TLS1_TXT_DHE_DSS_WITH_AES_128_SHA,
457 TLS1_CK_DHE_DSS_WITH_AES_128_SHA,
458 SSL_kDHE,
459 SSL_aDSS,
460 SSL_AES128,
461 SSL_SHA1,
462 SSL_SSLV3,
463 SSL_HIGH | SSL_FIPS,
464 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
465 128,
466 128,
467 },
468 /* Cipher 33 */
469 {
470 1,
471 TLS1_TXT_DHE_RSA_WITH_AES_128_SHA,
472 TLS1_CK_DHE_RSA_WITH_AES_128_SHA,
473 SSL_kDHE,
474 SSL_aRSA,
475 SSL_AES128,
476 SSL_SHA1,
477 SSL_SSLV3,
478 SSL_HIGH | SSL_FIPS,
479 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
480 128,
481 128,
482 },
483 /* Cipher 34 */
484 {
485 1,
486 TLS1_TXT_ADH_WITH_AES_128_SHA,
487 TLS1_CK_ADH_WITH_AES_128_SHA,
488 SSL_kDHE,
489 SSL_aNULL,
490 SSL_AES128,
491 SSL_SHA1,
492 SSL_SSLV3,
493 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
494 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
495 128,
496 128,
497 },
498
499 /* Cipher 35 */
500 {
501 1,
502 TLS1_TXT_RSA_WITH_AES_256_SHA,
503 TLS1_CK_RSA_WITH_AES_256_SHA,
504 SSL_kRSA,
505 SSL_aRSA,
506 SSL_AES256,
507 SSL_SHA1,
508 SSL_SSLV3,
509 SSL_HIGH | SSL_FIPS,
510 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
511 256,
512 256,
513 },
514 /* Cipher 36 */
515 {
516 1,
517 TLS1_TXT_DH_DSS_WITH_AES_256_SHA,
518 TLS1_CK_DH_DSS_WITH_AES_256_SHA,
519 SSL_kDHd,
520 SSL_aDH,
521 SSL_AES256,
522 SSL_SHA1,
523 SSL_SSLV3,
524 SSL_HIGH | SSL_FIPS,
525 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
526 256,
527 256,
528 },
529
530 /* Cipher 37 */
531 {
532 1,
533 TLS1_TXT_DH_RSA_WITH_AES_256_SHA,
534 TLS1_CK_DH_RSA_WITH_AES_256_SHA,
535 SSL_kDHr,
536 SSL_aDH,
537 SSL_AES256,
538 SSL_SHA1,
539 SSL_SSLV3,
540 SSL_HIGH | SSL_FIPS,
541 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
542 256,
543 256,
544 },
545
546 /* Cipher 38 */
547 {
548 1,
549 TLS1_TXT_DHE_DSS_WITH_AES_256_SHA,
550 TLS1_CK_DHE_DSS_WITH_AES_256_SHA,
551 SSL_kDHE,
552 SSL_aDSS,
553 SSL_AES256,
554 SSL_SHA1,
555 SSL_SSLV3,
556 SSL_HIGH | SSL_FIPS,
557 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
558 256,
559 256,
560 },
561
562 /* Cipher 39 */
563 {
564 1,
565 TLS1_TXT_DHE_RSA_WITH_AES_256_SHA,
566 TLS1_CK_DHE_RSA_WITH_AES_256_SHA,
567 SSL_kDHE,
568 SSL_aRSA,
569 SSL_AES256,
570 SSL_SHA1,
571 SSL_SSLV3,
572 SSL_HIGH | SSL_FIPS,
573 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
574 256,
575 256,
576 },
577
578 /* Cipher 3A */
579 {
580 1,
581 TLS1_TXT_ADH_WITH_AES_256_SHA,
582 TLS1_CK_ADH_WITH_AES_256_SHA,
583 SSL_kDHE,
584 SSL_aNULL,
585 SSL_AES256,
586 SSL_SHA1,
587 SSL_SSLV3,
588 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
589 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
590 256,
591 256,
592 },
593
594 /* TLS v1.2 ciphersuites */
595 /* Cipher 3B */
596 {
597 1,
598 TLS1_TXT_RSA_WITH_NULL_SHA256,
599 TLS1_CK_RSA_WITH_NULL_SHA256,
600 SSL_kRSA,
601 SSL_aRSA,
602 SSL_eNULL,
603 SSL_SHA256,
604 SSL_TLSV1_2,
605 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
606 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
607 0,
608 0,
609 },
610
611 /* Cipher 3C */
612 {
613 1,
614 TLS1_TXT_RSA_WITH_AES_128_SHA256,
615 TLS1_CK_RSA_WITH_AES_128_SHA256,
616 SSL_kRSA,
617 SSL_aRSA,
618 SSL_AES128,
619 SSL_SHA256,
620 SSL_TLSV1_2,
621 SSL_HIGH | SSL_FIPS,
622 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
623 128,
624 128,
625 },
626
627 /* Cipher 3D */
628 {
629 1,
630 TLS1_TXT_RSA_WITH_AES_256_SHA256,
631 TLS1_CK_RSA_WITH_AES_256_SHA256,
632 SSL_kRSA,
633 SSL_aRSA,
634 SSL_AES256,
635 SSL_SHA256,
636 SSL_TLSV1_2,
637 SSL_HIGH | SSL_FIPS,
638 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
639 256,
640 256,
641 },
642
643 /* Cipher 3E */
644 {
645 1,
646 TLS1_TXT_DH_DSS_WITH_AES_128_SHA256,
647 TLS1_CK_DH_DSS_WITH_AES_128_SHA256,
648 SSL_kDHd,
649 SSL_aDH,
650 SSL_AES128,
651 SSL_SHA256,
652 SSL_TLSV1_2,
653 SSL_HIGH | SSL_FIPS,
654 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
655 128,
656 128,
657 },
658
659 /* Cipher 3F */
660 {
661 1,
662 TLS1_TXT_DH_RSA_WITH_AES_128_SHA256,
663 TLS1_CK_DH_RSA_WITH_AES_128_SHA256,
664 SSL_kDHr,
665 SSL_aDH,
666 SSL_AES128,
667 SSL_SHA256,
668 SSL_TLSV1_2,
669 SSL_HIGH | SSL_FIPS,
670 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
671 128,
672 128,
673 },
674
675 /* Cipher 40 */
676 {
677 1,
678 TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256,
679 TLS1_CK_DHE_DSS_WITH_AES_128_SHA256,
680 SSL_kDHE,
681 SSL_aDSS,
682 SSL_AES128,
683 SSL_SHA256,
684 SSL_TLSV1_2,
685 SSL_HIGH | SSL_FIPS,
686 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
687 128,
688 128,
689 },
690
691 #ifndef OPENSSL_NO_CAMELLIA
692 /* Camellia ciphersuites from RFC4132 (128-bit portion) */
693
694 /* Cipher 41 */
695 {
696 1,
697 TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA,
698 TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA,
699 SSL_kRSA,
700 SSL_aRSA,
701 SSL_CAMELLIA128,
702 SSL_SHA1,
703 SSL_SSLV3,
704 SSL_HIGH,
705 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
706 128,
707 128,
708 },
709
710 /* Cipher 42 */
711 {
712 1,
713 TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA,
714 TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA,
715 SSL_kDHd,
716 SSL_aDH,
717 SSL_CAMELLIA128,
718 SSL_SHA1,
719 SSL_SSLV3,
720 SSL_HIGH,
721 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
722 128,
723 128,
724 },
725
726 /* Cipher 43 */
727 {
728 1,
729 TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA,
730 TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA,
731 SSL_kDHr,
732 SSL_aDH,
733 SSL_CAMELLIA128,
734 SSL_SHA1,
735 SSL_SSLV3,
736 SSL_HIGH,
737 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
738 128,
739 128,
740 },
741
742 /* Cipher 44 */
743 {
744 1,
745 TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
746 TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
747 SSL_kDHE,
748 SSL_aDSS,
749 SSL_CAMELLIA128,
750 SSL_SHA1,
751 SSL_SSLV3,
752 SSL_HIGH,
753 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
754 128,
755 128,
756 },
757
758 /* Cipher 45 */
759 {
760 1,
761 TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
762 TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
763 SSL_kDHE,
764 SSL_aRSA,
765 SSL_CAMELLIA128,
766 SSL_SHA1,
767 SSL_SSLV3,
768 SSL_HIGH,
769 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
770 128,
771 128,
772 },
773
774 /* Cipher 46 */
775 {
776 1,
777 TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA,
778 TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA,
779 SSL_kDHE,
780 SSL_aNULL,
781 SSL_CAMELLIA128,
782 SSL_SHA1,
783 SSL_SSLV3,
784 SSL_NOT_DEFAULT | SSL_HIGH,
785 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
786 128,
787 128,
788 },
789 #endif /* OPENSSL_NO_CAMELLIA */
790
791 /* TLS v1.2 ciphersuites */
792 /* Cipher 67 */
793 {
794 1,
795 TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256,
796 TLS1_CK_DHE_RSA_WITH_AES_128_SHA256,
797 SSL_kDHE,
798 SSL_aRSA,
799 SSL_AES128,
800 SSL_SHA256,
801 SSL_TLSV1_2,
802 SSL_HIGH | SSL_FIPS,
803 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
804 128,
805 128,
806 },
807
808 /* Cipher 68 */
809 {
810 1,
811 TLS1_TXT_DH_DSS_WITH_AES_256_SHA256,
812 TLS1_CK_DH_DSS_WITH_AES_256_SHA256,
813 SSL_kDHd,
814 SSL_aDH,
815 SSL_AES256,
816 SSL_SHA256,
817 SSL_TLSV1_2,
818 SSL_HIGH | SSL_FIPS,
819 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
820 256,
821 256,
822 },
823
824 /* Cipher 69 */
825 {
826 1,
827 TLS1_TXT_DH_RSA_WITH_AES_256_SHA256,
828 TLS1_CK_DH_RSA_WITH_AES_256_SHA256,
829 SSL_kDHr,
830 SSL_aDH,
831 SSL_AES256,
832 SSL_SHA256,
833 SSL_TLSV1_2,
834 SSL_HIGH | SSL_FIPS,
835 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
836 256,
837 256,
838 },
839
840 /* Cipher 6A */
841 {
842 1,
843 TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256,
844 TLS1_CK_DHE_DSS_WITH_AES_256_SHA256,
845 SSL_kDHE,
846 SSL_aDSS,
847 SSL_AES256,
848 SSL_SHA256,
849 SSL_TLSV1_2,
850 SSL_HIGH | SSL_FIPS,
851 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
852 256,
853 256,
854 },
855
856 /* Cipher 6B */
857 {
858 1,
859 TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256,
860 TLS1_CK_DHE_RSA_WITH_AES_256_SHA256,
861 SSL_kDHE,
862 SSL_aRSA,
863 SSL_AES256,
864 SSL_SHA256,
865 SSL_TLSV1_2,
866 SSL_HIGH | SSL_FIPS,
867 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
868 256,
869 256,
870 },
871
872 /* Cipher 6C */
873 {
874 1,
875 TLS1_TXT_ADH_WITH_AES_128_SHA256,
876 TLS1_CK_ADH_WITH_AES_128_SHA256,
877 SSL_kDHE,
878 SSL_aNULL,
879 SSL_AES128,
880 SSL_SHA256,
881 SSL_TLSV1_2,
882 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
883 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
884 128,
885 128,
886 },
887
888 /* Cipher 6D */
889 {
890 1,
891 TLS1_TXT_ADH_WITH_AES_256_SHA256,
892 TLS1_CK_ADH_WITH_AES_256_SHA256,
893 SSL_kDHE,
894 SSL_aNULL,
895 SSL_AES256,
896 SSL_SHA256,
897 SSL_TLSV1_2,
898 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
899 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
900 256,
901 256,
902 },
903
904 /* GOST Ciphersuites */
905 #ifndef OPENSL_NO_GOST
906 {
907 1,
908 "GOST2001-GOST89-GOST89",
909 0x3000081,
910 SSL_kGOST,
911 SSL_aGOST01,
912 SSL_eGOST2814789CNT,
913 SSL_GOST89MAC,
914 SSL_TLSV1,
915 SSL_HIGH,
916 SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94 | TLS1_STREAM_MAC,
917 256,
918 256
919 },
920 {
921 1,
922 "GOST2001-NULL-GOST94",
923 0x3000083,
924 SSL_kGOST,
925 SSL_aGOST01,
926 SSL_eNULL,
927 SSL_GOST94,
928 SSL_TLSV1,
929 SSL_NOT_DEFAULT | SSL_STRONG_NONE,
930 SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94,
931 0,
932 0
933 },
934 #endif
935 #ifndef OPENSSL_NO_CAMELLIA
936 /* Camellia ciphersuites from RFC4132 (256-bit portion) */
937
938 /* Cipher 84 */
939 {
940 1,
941 TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA,
942 TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA,
943 SSL_kRSA,
944 SSL_aRSA,
945 SSL_CAMELLIA256,
946 SSL_SHA1,
947 SSL_SSLV3,
948 SSL_HIGH,
949 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
950 256,
951 256,
952 },
953 /* Cipher 85 */
954 {
955 1,
956 TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA,
957 TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA,
958 SSL_kDHd,
959 SSL_aDH,
960 SSL_CAMELLIA256,
961 SSL_SHA1,
962 SSL_SSLV3,
963 SSL_HIGH,
964 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
965 256,
966 256,
967 },
968
969 /* Cipher 86 */
970 {
971 1,
972 TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA,
973 TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA,
974 SSL_kDHr,
975 SSL_aDH,
976 SSL_CAMELLIA256,
977 SSL_SHA1,
978 SSL_SSLV3,
979 SSL_HIGH,
980 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
981 256,
982 256,
983 },
984
985 /* Cipher 87 */
986 {
987 1,
988 TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
989 TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
990 SSL_kDHE,
991 SSL_aDSS,
992 SSL_CAMELLIA256,
993 SSL_SHA1,
994 SSL_SSLV3,
995 SSL_HIGH,
996 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
997 256,
998 256,
999 },
1000
1001 /* Cipher 88 */
1002 {
1003 1,
1004 TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
1005 TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
1006 SSL_kDHE,
1007 SSL_aRSA,
1008 SSL_CAMELLIA256,
1009 SSL_SHA1,
1010 SSL_SSLV3,
1011 SSL_HIGH,
1012 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1013 256,
1014 256,
1015 },
1016
1017 /* Cipher 89 */
1018 {
1019 1,
1020 TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA,
1021 TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA,
1022 SSL_kDHE,
1023 SSL_aNULL,
1024 SSL_CAMELLIA256,
1025 SSL_SHA1,
1026 SSL_SSLV3,
1027 SSL_NOT_DEFAULT | SSL_HIGH,
1028 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1029 256,
1030 256,
1031 },
1032 #endif /* OPENSSL_NO_CAMELLIA */
1033
1034 #ifndef OPENSSL_NO_PSK
1035 /* PSK ciphersuites from RFC 4279 */
1036 /* Cipher 8A */
1037 {
1038 1,
1039 TLS1_TXT_PSK_WITH_RC4_128_SHA,
1040 TLS1_CK_PSK_WITH_RC4_128_SHA,
1041 SSL_kPSK,
1042 SSL_aPSK,
1043 SSL_RC4,
1044 SSL_SHA1,
1045 SSL_SSLV3,
1046 SSL_NOT_DEFAULT | SSL_MEDIUM,
1047 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1048 128,
1049 128,
1050 },
1051
1052 /* Cipher 8B */
1053 {
1054 1,
1055 TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA,
1056 TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA,
1057 SSL_kPSK,
1058 SSL_aPSK,
1059 SSL_3DES,
1060 SSL_SHA1,
1061 SSL_SSLV3,
1062 SSL_HIGH | SSL_FIPS,
1063 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1064 112,
1065 168,
1066 },
1067
1068 /* Cipher 8C */
1069 {
1070 1,
1071 TLS1_TXT_PSK_WITH_AES_128_CBC_SHA,
1072 TLS1_CK_PSK_WITH_AES_128_CBC_SHA,
1073 SSL_kPSK,
1074 SSL_aPSK,
1075 SSL_AES128,
1076 SSL_SHA1,
1077 SSL_SSLV3,
1078 SSL_HIGH | SSL_FIPS,
1079 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1080 128,
1081 128,
1082 },
1083
1084 /* Cipher 8D */
1085 {
1086 1,
1087 TLS1_TXT_PSK_WITH_AES_256_CBC_SHA,
1088 TLS1_CK_PSK_WITH_AES_256_CBC_SHA,
1089 SSL_kPSK,
1090 SSL_aPSK,
1091 SSL_AES256,
1092 SSL_SHA1,
1093 SSL_SSLV3,
1094 SSL_HIGH | SSL_FIPS,
1095 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1096 256,
1097 256,
1098 },
1099
1100 /* Cipher 8E */
1101 {
1102 1,
1103 TLS1_TXT_DHE_PSK_WITH_RC4_128_SHA,
1104 TLS1_CK_DHE_PSK_WITH_RC4_128_SHA,
1105 SSL_kDHEPSK,
1106 SSL_aPSK,
1107 SSL_RC4,
1108 SSL_SHA1,
1109 SSL_SSLV3,
1110 SSL_NOT_DEFAULT | SSL_MEDIUM,
1111 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1112 128,
1113 128,
1114 },
1115
1116 /* Cipher 8F */
1117 {
1118 1,
1119 TLS1_TXT_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
1120 TLS1_CK_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
1121 SSL_kDHEPSK,
1122 SSL_aPSK,
1123 SSL_3DES,
1124 SSL_SHA1,
1125 SSL_SSLV3,
1126 SSL_HIGH | SSL_FIPS,
1127 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1128 112,
1129 168,
1130 },
1131
1132 /* Cipher 90 */
1133 {
1134 1,
1135 TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA,
1136 TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA,
1137 SSL_kDHEPSK,
1138 SSL_aPSK,
1139 SSL_AES128,
1140 SSL_SHA1,
1141 SSL_SSLV3,
1142 SSL_HIGH | SSL_FIPS,
1143 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1144 128,
1145 128,
1146 },
1147
1148 /* Cipher 91 */
1149 {
1150 1,
1151 TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA,
1152 TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA,
1153 SSL_kDHEPSK,
1154 SSL_aPSK,
1155 SSL_AES256,
1156 SSL_SHA1,
1157 SSL_SSLV3,
1158 SSL_HIGH | SSL_FIPS,
1159 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1160 256,
1161 256,
1162 },
1163
1164 /* Cipher 92 */
1165 {
1166 1,
1167 TLS1_TXT_RSA_PSK_WITH_RC4_128_SHA,
1168 TLS1_CK_RSA_PSK_WITH_RC4_128_SHA,
1169 SSL_kRSAPSK,
1170 SSL_aRSA,
1171 SSL_RC4,
1172 SSL_SHA1,
1173 SSL_SSLV3,
1174 SSL_NOT_DEFAULT | SSL_MEDIUM,
1175 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1176 128,
1177 128,
1178 },
1179
1180 /* Cipher 93 */
1181 {
1182 1,
1183 TLS1_TXT_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
1184 TLS1_CK_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
1185 SSL_kRSAPSK,
1186 SSL_aRSA,
1187 SSL_3DES,
1188 SSL_SHA1,
1189 SSL_SSLV3,
1190 SSL_HIGH | SSL_FIPS,
1191 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1192 112,
1193 168,
1194 },
1195
1196 /* Cipher 94 */
1197 {
1198 1,
1199 TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA,
1200 TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA,
1201 SSL_kRSAPSK,
1202 SSL_aRSA,
1203 SSL_AES128,
1204 SSL_SHA1,
1205 SSL_SSLV3,
1206 SSL_HIGH | SSL_FIPS,
1207 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1208 128,
1209 128,
1210 },
1211
1212 /* Cipher 95 */
1213 {
1214 1,
1215 TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA,
1216 TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA,
1217 SSL_kRSAPSK,
1218 SSL_aRSA,
1219 SSL_AES256,
1220 SSL_SHA1,
1221 SSL_SSLV3,
1222 SSL_HIGH | SSL_FIPS,
1223 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1224 256,
1225 256,
1226 },
1227 #endif /* OPENSSL_NO_PSK */
1228
1229 #ifndef OPENSSL_NO_SEED
1230 /* SEED ciphersuites from RFC4162 */
1231
1232 /* Cipher 96 */
1233 {
1234 1,
1235 TLS1_TXT_RSA_WITH_SEED_SHA,
1236 TLS1_CK_RSA_WITH_SEED_SHA,
1237 SSL_kRSA,
1238 SSL_aRSA,
1239 SSL_SEED,
1240 SSL_SHA1,
1241 SSL_SSLV3,
1242 SSL_MEDIUM,
1243 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1244 128,
1245 128,
1246 },
1247
1248 /* Cipher 97 */
1249 {
1250 1,
1251 TLS1_TXT_DH_DSS_WITH_SEED_SHA,
1252 TLS1_CK_DH_DSS_WITH_SEED_SHA,
1253 SSL_kDHd,
1254 SSL_aDH,
1255 SSL_SEED,
1256 SSL_SHA1,
1257 SSL_SSLV3,
1258 SSL_MEDIUM,
1259 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1260 128,
1261 128,
1262 },
1263
1264 /* Cipher 98 */
1265 {
1266 1,
1267 TLS1_TXT_DH_RSA_WITH_SEED_SHA,
1268 TLS1_CK_DH_RSA_WITH_SEED_SHA,
1269 SSL_kDHr,
1270 SSL_aDH,
1271 SSL_SEED,
1272 SSL_SHA1,
1273 SSL_SSLV3,
1274 SSL_MEDIUM,
1275 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1276 128,
1277 128,
1278 },
1279
1280 /* Cipher 99 */
1281 {
1282 1,
1283 TLS1_TXT_DHE_DSS_WITH_SEED_SHA,
1284 TLS1_CK_DHE_DSS_WITH_SEED_SHA,
1285 SSL_kDHE,
1286 SSL_aDSS,
1287 SSL_SEED,
1288 SSL_SHA1,
1289 SSL_SSLV3,
1290 SSL_MEDIUM,
1291 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1292 128,
1293 128,
1294 },
1295
1296 /* Cipher 9A */
1297 {
1298 1,
1299 TLS1_TXT_DHE_RSA_WITH_SEED_SHA,
1300 TLS1_CK_DHE_RSA_WITH_SEED_SHA,
1301 SSL_kDHE,
1302 SSL_aRSA,
1303 SSL_SEED,
1304 SSL_SHA1,
1305 SSL_SSLV3,
1306 SSL_MEDIUM,
1307 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1308 128,
1309 128,
1310 },
1311
1312 /* Cipher 9B */
1313 {
1314 1,
1315 TLS1_TXT_ADH_WITH_SEED_SHA,
1316 TLS1_CK_ADH_WITH_SEED_SHA,
1317 SSL_kDHE,
1318 SSL_aNULL,
1319 SSL_SEED,
1320 SSL_SHA1,
1321 SSL_SSLV3,
1322 SSL_NOT_DEFAULT | SSL_MEDIUM,
1323 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1324 128,
1325 128,
1326 },
1327
1328 #endif /* OPENSSL_NO_SEED */
1329
1330 /* GCM ciphersuites from RFC5288 */
1331
1332 /* Cipher 9C */
1333 {
1334 1,
1335 TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256,
1336 TLS1_CK_RSA_WITH_AES_128_GCM_SHA256,
1337 SSL_kRSA,
1338 SSL_aRSA,
1339 SSL_AES128GCM,
1340 SSL_AEAD,
1341 SSL_TLSV1_2,
1342 SSL_HIGH | SSL_FIPS,
1343 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1344 128,
1345 128,
1346 },
1347
1348 /* Cipher 9D */
1349 {
1350 1,
1351 TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384,
1352 TLS1_CK_RSA_WITH_AES_256_GCM_SHA384,
1353 SSL_kRSA,
1354 SSL_aRSA,
1355 SSL_AES256GCM,
1356 SSL_AEAD,
1357 SSL_TLSV1_2,
1358 SSL_HIGH | SSL_FIPS,
1359 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1360 256,
1361 256,
1362 },
1363
1364 /* Cipher 9E */
1365 {
1366 1,
1367 TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256,
1368 TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256,
1369 SSL_kDHE,
1370 SSL_aRSA,
1371 SSL_AES128GCM,
1372 SSL_AEAD,
1373 SSL_TLSV1_2,
1374 SSL_HIGH | SSL_FIPS,
1375 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1376 128,
1377 128,
1378 },
1379
1380 /* Cipher 9F */
1381 {
1382 1,
1383 TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384,
1384 TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384,
1385 SSL_kDHE,
1386 SSL_aRSA,
1387 SSL_AES256GCM,
1388 SSL_AEAD,
1389 SSL_TLSV1_2,
1390 SSL_HIGH | SSL_FIPS,
1391 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1392 256,
1393 256,
1394 },
1395
1396 /* Cipher A0 */
1397 {
1398 1,
1399 TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256,
1400 TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256,
1401 SSL_kDHr,
1402 SSL_aDH,
1403 SSL_AES128GCM,
1404 SSL_AEAD,
1405 SSL_TLSV1_2,
1406 SSL_HIGH | SSL_FIPS,
1407 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1408 128,
1409 128,
1410 },
1411
1412 /* Cipher A1 */
1413 {
1414 1,
1415 TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384,
1416 TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384,
1417 SSL_kDHr,
1418 SSL_aDH,
1419 SSL_AES256GCM,
1420 SSL_AEAD,
1421 SSL_TLSV1_2,
1422 SSL_HIGH | SSL_FIPS,
1423 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1424 256,
1425 256,
1426 },
1427
1428 /* Cipher A2 */
1429 {
1430 1,
1431 TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256,
1432 TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256,
1433 SSL_kDHE,
1434 SSL_aDSS,
1435 SSL_AES128GCM,
1436 SSL_AEAD,
1437 SSL_TLSV1_2,
1438 SSL_HIGH | SSL_FIPS,
1439 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1440 128,
1441 128,
1442 },
1443
1444 /* Cipher A3 */
1445 {
1446 1,
1447 TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384,
1448 TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384,
1449 SSL_kDHE,
1450 SSL_aDSS,
1451 SSL_AES256GCM,
1452 SSL_AEAD,
1453 SSL_TLSV1_2,
1454 SSL_HIGH | SSL_FIPS,
1455 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1456 256,
1457 256,
1458 },
1459
1460 /* Cipher A4 */
1461 {
1462 1,
1463 TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256,
1464 TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256,
1465 SSL_kDHd,
1466 SSL_aDH,
1467 SSL_AES128GCM,
1468 SSL_AEAD,
1469 SSL_TLSV1_2,
1470 SSL_HIGH | SSL_FIPS,
1471 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1472 128,
1473 128,
1474 },
1475
1476 /* Cipher A5 */
1477 {
1478 1,
1479 TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384,
1480 TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384,
1481 SSL_kDHd,
1482 SSL_aDH,
1483 SSL_AES256GCM,
1484 SSL_AEAD,
1485 SSL_TLSV1_2,
1486 SSL_HIGH | SSL_FIPS,
1487 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1488 256,
1489 256,
1490 },
1491
1492 /* Cipher A6 */
1493 {
1494 1,
1495 TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256,
1496 TLS1_CK_ADH_WITH_AES_128_GCM_SHA256,
1497 SSL_kDHE,
1498 SSL_aNULL,
1499 SSL_AES128GCM,
1500 SSL_AEAD,
1501 SSL_TLSV1_2,
1502 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
1503 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1504 128,
1505 128,
1506 },
1507
1508 /* Cipher A7 */
1509 {
1510 1,
1511 TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384,
1512 TLS1_CK_ADH_WITH_AES_256_GCM_SHA384,
1513 SSL_kDHE,
1514 SSL_aNULL,
1515 SSL_AES256GCM,
1516 SSL_AEAD,
1517 SSL_TLSV1_2,
1518 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
1519 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1520 256,
1521 256,
1522 },
1523 #ifndef OPENSSL_NO_PSK
1524 /* PSK ciphersuites from RFC5487 */
1525
1526 /* Cipher A8 */
1527 {
1528 1,
1529 TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256,
1530 TLS1_CK_PSK_WITH_AES_128_GCM_SHA256,
1531 SSL_kPSK,
1532 SSL_aPSK,
1533 SSL_AES128GCM,
1534 SSL_AEAD,
1535 SSL_TLSV1_2,
1536 SSL_HIGH | SSL_FIPS,
1537 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1538 128,
1539 128,
1540 },
1541
1542 /* Cipher A9 */
1543 {
1544 1,
1545 TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384,
1546 TLS1_CK_PSK_WITH_AES_256_GCM_SHA384,
1547 SSL_kPSK,
1548 SSL_aPSK,
1549 SSL_AES256GCM,
1550 SSL_AEAD,
1551 SSL_TLSV1_2,
1552 SSL_HIGH | SSL_FIPS,
1553 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1554 256,
1555 256,
1556 },
1557
1558 /* Cipher AA */
1559 {
1560 1,
1561 TLS1_TXT_DHE_PSK_WITH_AES_128_GCM_SHA256,
1562 TLS1_CK_DHE_PSK_WITH_AES_128_GCM_SHA256,
1563 SSL_kDHEPSK,
1564 SSL_aPSK,
1565 SSL_AES128GCM,
1566 SSL_AEAD,
1567 SSL_TLSV1_2,
1568 SSL_HIGH | SSL_FIPS,
1569 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1570 128,
1571 128,
1572 },
1573
1574 /* Cipher AB */
1575 {
1576 1,
1577 TLS1_TXT_DHE_PSK_WITH_AES_256_GCM_SHA384,
1578 TLS1_CK_DHE_PSK_WITH_AES_256_GCM_SHA384,
1579 SSL_kDHEPSK,
1580 SSL_aPSK,
1581 SSL_AES256GCM,
1582 SSL_AEAD,
1583 SSL_TLSV1_2,
1584 SSL_HIGH | SSL_FIPS,
1585 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1586 256,
1587 256,
1588 },
1589
1590 /* Cipher AC */
1591 {
1592 1,
1593 TLS1_TXT_RSA_PSK_WITH_AES_128_GCM_SHA256,
1594 TLS1_CK_RSA_PSK_WITH_AES_128_GCM_SHA256,
1595 SSL_kRSAPSK,
1596 SSL_aRSA,
1597 SSL_AES128GCM,
1598 SSL_AEAD,
1599 SSL_TLSV1_2,
1600 SSL_HIGH | SSL_FIPS,
1601 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1602 128,
1603 128,
1604 },
1605
1606 /* Cipher AD */
1607 {
1608 1,
1609 TLS1_TXT_RSA_PSK_WITH_AES_256_GCM_SHA384,
1610 TLS1_CK_RSA_PSK_WITH_AES_256_GCM_SHA384,
1611 SSL_kRSAPSK,
1612 SSL_aRSA,
1613 SSL_AES256GCM,
1614 SSL_AEAD,
1615 SSL_TLSV1_2,
1616 SSL_HIGH | SSL_FIPS,
1617 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1618 256,
1619 256,
1620 },
1621
1622 /* Cipher AE */
1623 {
1624 1,
1625 TLS1_TXT_PSK_WITH_AES_128_CBC_SHA256,
1626 TLS1_CK_PSK_WITH_AES_128_CBC_SHA256,
1627 SSL_kPSK,
1628 SSL_aPSK,
1629 SSL_AES128,
1630 SSL_SHA256,
1631 SSL_TLSV1,
1632 SSL_HIGH | SSL_FIPS,
1633 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1634 128,
1635 128,
1636 },
1637
1638 /* Cipher AF */
1639 {
1640 1,
1641 TLS1_TXT_PSK_WITH_AES_256_CBC_SHA384,
1642 TLS1_CK_PSK_WITH_AES_256_CBC_SHA384,
1643 SSL_kPSK,
1644 SSL_aPSK,
1645 SSL_AES256,
1646 SSL_SHA384,
1647 SSL_TLSV1,
1648 SSL_HIGH | SSL_FIPS,
1649 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1650 256,
1651 256,
1652 },
1653
1654 /* Cipher B0 */
1655 {
1656 1,
1657 TLS1_TXT_PSK_WITH_NULL_SHA256,
1658 TLS1_CK_PSK_WITH_NULL_SHA256,
1659 SSL_kPSK,
1660 SSL_aPSK,
1661 SSL_eNULL,
1662 SSL_SHA256,
1663 SSL_TLSV1,
1664 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1665 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1666 0,
1667 0,
1668 },
1669
1670 /* Cipher B1 */
1671 {
1672 1,
1673 TLS1_TXT_PSK_WITH_NULL_SHA384,
1674 TLS1_CK_PSK_WITH_NULL_SHA384,
1675 SSL_kPSK,
1676 SSL_aPSK,
1677 SSL_eNULL,
1678 SSL_SHA384,
1679 SSL_TLSV1,
1680 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1681 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1682 0,
1683 0,
1684 },
1685
1686 /* Cipher B2 */
1687 {
1688 1,
1689 TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA256,
1690 TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA256,
1691 SSL_kDHEPSK,
1692 SSL_aPSK,
1693 SSL_AES128,
1694 SSL_SHA256,
1695 SSL_TLSV1,
1696 SSL_HIGH | SSL_FIPS,
1697 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1698 128,
1699 128,
1700 },
1701
1702 /* Cipher B3 */
1703 {
1704 1,
1705 TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA384,
1706 TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA384,
1707 SSL_kDHEPSK,
1708 SSL_aPSK,
1709 SSL_AES256,
1710 SSL_SHA384,
1711 SSL_TLSV1,
1712 SSL_HIGH | SSL_FIPS,
1713 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1714 256,
1715 256,
1716 },
1717
1718 /* Cipher B4 */
1719 {
1720 1,
1721 TLS1_TXT_DHE_PSK_WITH_NULL_SHA256,
1722 TLS1_CK_DHE_PSK_WITH_NULL_SHA256,
1723 SSL_kDHEPSK,
1724 SSL_aPSK,
1725 SSL_eNULL,
1726 SSL_SHA256,
1727 SSL_TLSV1,
1728 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1729 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1730 0,
1731 0,
1732 },
1733
1734 /* Cipher B5 */
1735 {
1736 1,
1737 TLS1_TXT_DHE_PSK_WITH_NULL_SHA384,
1738 TLS1_CK_DHE_PSK_WITH_NULL_SHA384,
1739 SSL_kDHEPSK,
1740 SSL_aPSK,
1741 SSL_eNULL,
1742 SSL_SHA384,
1743 SSL_TLSV1,
1744 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1745 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1746 0,
1747 0,
1748 },
1749
1750 /* Cipher B6 */
1751 {
1752 1,
1753 TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA256,
1754 TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA256,
1755 SSL_kRSAPSK,
1756 SSL_aRSA,
1757 SSL_AES128,
1758 SSL_SHA256,
1759 SSL_TLSV1,
1760 SSL_HIGH | SSL_FIPS,
1761 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1762 128,
1763 128,
1764 },
1765
1766 /* Cipher B7 */
1767 {
1768 1,
1769 TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA384,
1770 TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA384,
1771 SSL_kRSAPSK,
1772 SSL_aRSA,
1773 SSL_AES256,
1774 SSL_SHA384,
1775 SSL_TLSV1,
1776 SSL_HIGH | SSL_FIPS,
1777 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1778 256,
1779 256,
1780 },
1781
1782 /* Cipher B8 */
1783 {
1784 1,
1785 TLS1_TXT_RSA_PSK_WITH_NULL_SHA256,
1786 TLS1_CK_RSA_PSK_WITH_NULL_SHA256,
1787 SSL_kRSAPSK,
1788 SSL_aRSA,
1789 SSL_eNULL,
1790 SSL_SHA256,
1791 SSL_TLSV1,
1792 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1793 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1794 0,
1795 0,
1796 },
1797
1798 /* Cipher B9 */
1799 {
1800 1,
1801 TLS1_TXT_RSA_PSK_WITH_NULL_SHA384,
1802 TLS1_CK_RSA_PSK_WITH_NULL_SHA384,
1803 SSL_kRSAPSK,
1804 SSL_aRSA,
1805 SSL_eNULL,
1806 SSL_SHA384,
1807 SSL_TLSV1,
1808 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1809 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1810 0,
1811 0,
1812 },
1813 #endif /* OPENSSL_NO_PSK */
1814
1815 #ifndef OPENSSL_NO_CAMELLIA
1816 /* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 */
1817
1818 /* Cipher BA */
1819 {
1820 1,
1821 TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1822 TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1823 SSL_kRSA,
1824 SSL_aRSA,
1825 SSL_CAMELLIA128,
1826 SSL_SHA256,
1827 SSL_TLSV1_2,
1828 SSL_HIGH,
1829 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1830 128,
1831 128,
1832 },
1833
1834 /* Cipher BB */
1835 {
1836 1,
1837 TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256,
1838 TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256,
1839 SSL_kDHd,
1840 SSL_aDH,
1841 SSL_CAMELLIA128,
1842 SSL_SHA256,
1843 SSL_TLSV1_2,
1844 SSL_HIGH,
1845 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1846 128,
1847 128,
1848 },
1849
1850 /* Cipher BC */
1851 {
1852 1,
1853 TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1854 TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1855 SSL_kDHr,
1856 SSL_aDH,
1857 SSL_CAMELLIA128,
1858 SSL_SHA256,
1859 SSL_TLSV1_2,
1860 SSL_HIGH,
1861 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1862 128,
1863 128,
1864 },
1865
1866 /* Cipher BD */
1867 {
1868 1,
1869 TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
1870 TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
1871 SSL_kEDH,
1872 SSL_aDSS,
1873 SSL_CAMELLIA128,
1874 SSL_SHA256,
1875 SSL_TLSV1_2,
1876 SSL_HIGH,
1877 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1878 128,
1879 128,
1880 },
1881
1882 /* Cipher BE */
1883 {
1884 1,
1885 TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1886 TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1887 SSL_kEDH,
1888 SSL_aRSA,
1889 SSL_CAMELLIA128,
1890 SSL_SHA256,
1891 SSL_TLSV1_2,
1892 SSL_HIGH,
1893 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1894 128,
1895 128,
1896 },
1897
1898 /* Cipher BF */
1899 {
1900 1,
1901 TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA256,
1902 TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA256,
1903 SSL_kEDH,
1904 SSL_aNULL,
1905 SSL_CAMELLIA128,
1906 SSL_SHA256,
1907 SSL_TLSV1_2,
1908 SSL_NOT_DEFAULT | SSL_HIGH,
1909 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1910 128,
1911 128,
1912 },
1913
1914 /* Cipher C0 */
1915 {
1916 1,
1917 TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1918 TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1919 SSL_kRSA,
1920 SSL_aRSA,
1921 SSL_CAMELLIA256,
1922 SSL_SHA256,
1923 SSL_TLSV1_2,
1924 SSL_HIGH,
1925 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1926 256,
1927 256,
1928 },
1929
1930 /* Cipher C1 */
1931 {
1932 1,
1933 TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256,
1934 TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256,
1935 SSL_kDHd,
1936 SSL_aDH,
1937 SSL_CAMELLIA256,
1938 SSL_SHA256,
1939 SSL_TLSV1_2,
1940 SSL_HIGH,
1941 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1942 256,
1943 256,
1944 },
1945
1946 /* Cipher C2 */
1947 {
1948 1,
1949 TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1950 TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1951 SSL_kDHr,
1952 SSL_aDH,
1953 SSL_CAMELLIA256,
1954 SSL_SHA256,
1955 SSL_TLSV1_2,
1956 SSL_HIGH,
1957 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1958 256,
1959 256,
1960 },
1961
1962 /* Cipher C3 */
1963 {
1964 1,
1965 TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
1966 TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
1967 SSL_kEDH,
1968 SSL_aDSS,
1969 SSL_CAMELLIA256,
1970 SSL_SHA256,
1971 SSL_TLSV1_2,
1972 SSL_HIGH,
1973 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1974 256,
1975 256,
1976 },
1977
1978 /* Cipher C4 */
1979 {
1980 1,
1981 TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1982 TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1983 SSL_kEDH,
1984 SSL_aRSA,
1985 SSL_CAMELLIA256,
1986 SSL_SHA256,
1987 SSL_TLSV1_2,
1988 SSL_HIGH,
1989 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1990 256,
1991 256,
1992 },
1993
1994 /* Cipher C5 */
1995 {
1996 1,
1997 TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA256,
1998 TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256,
1999 SSL_kEDH,
2000 SSL_aNULL,
2001 SSL_CAMELLIA256,
2002 SSL_SHA256,
2003 SSL_TLSV1_2,
2004 SSL_NOT_DEFAULT | SSL_HIGH,
2005 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2006 256,
2007 256,
2008 },
2009 #endif
2010
2011 #ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL
2012 /* Cipher FF */
2013 {
2014 1,
2015 "SCSV",
2016 SSL3_CK_SCSV,
2017 0,
2018 0,
2019 0,
2020 0,
2021 0,
2022 0,
2023 0,
2024 0,
2025 0},
2026 #endif
2027
2028 #ifndef OPENSSL_NO_EC
2029 /* Cipher C001 */
2030 {
2031 1,
2032 TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA,
2033 TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA,
2034 SSL_kECDHe,
2035 SSL_aECDH,
2036 SSL_eNULL,
2037 SSL_SHA1,
2038 SSL_SSLV3,
2039 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2040 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2041 0,
2042 0,
2043 },
2044
2045 /* Cipher C002 */
2046 {
2047 1,
2048 TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA,
2049 TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA,
2050 SSL_kECDHe,
2051 SSL_aECDH,
2052 SSL_RC4,
2053 SSL_SHA1,
2054 SSL_SSLV3,
2055 SSL_NOT_DEFAULT | SSL_MEDIUM,
2056 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2057 128,
2058 128,
2059 },
2060
2061 /* Cipher C003 */
2062 {
2063 1,
2064 TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA,
2065 TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA,
2066 SSL_kECDHe,
2067 SSL_aECDH,
2068 SSL_3DES,
2069 SSL_SHA1,
2070 SSL_SSLV3,
2071 SSL_HIGH | SSL_FIPS,
2072 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2073 112,
2074 168,
2075 },
2076
2077 /* Cipher C004 */
2078 {
2079 1,
2080 TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
2081 TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
2082 SSL_kECDHe,
2083 SSL_aECDH,
2084 SSL_AES128,
2085 SSL_SHA1,
2086 SSL_SSLV3,
2087 SSL_HIGH | SSL_FIPS,
2088 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2089 128,
2090 128,
2091 },
2092
2093 /* Cipher C005 */
2094 {
2095 1,
2096 TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
2097 TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
2098 SSL_kECDHe,
2099 SSL_aECDH,
2100 SSL_AES256,
2101 SSL_SHA1,
2102 SSL_SSLV3,
2103 SSL_HIGH | SSL_FIPS,
2104 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2105 256,
2106 256,
2107 },
2108
2109 /* Cipher C006 */
2110 {
2111 1,
2112 TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA,
2113 TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA,
2114 SSL_kECDHE,
2115 SSL_aECDSA,
2116 SSL_eNULL,
2117 SSL_SHA1,
2118 SSL_SSLV3,
2119 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2120 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2121 0,
2122 0,
2123 },
2124
2125 /* Cipher C007 */
2126 {
2127 1,
2128 TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA,
2129 TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA,
2130 SSL_kECDHE,
2131 SSL_aECDSA,
2132 SSL_RC4,
2133 SSL_SHA1,
2134 SSL_SSLV3,
2135 SSL_NOT_DEFAULT | SSL_MEDIUM,
2136 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2137 128,
2138 128,
2139 },
2140
2141 /* Cipher C008 */
2142 {
2143 1,
2144 TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
2145 TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
2146 SSL_kECDHE,
2147 SSL_aECDSA,
2148 SSL_3DES,
2149 SSL_SHA1,
2150 SSL_SSLV3,
2151 SSL_HIGH | SSL_FIPS,
2152 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2153 112,
2154 168,
2155 },
2156
2157 /* Cipher C009 */
2158 {
2159 1,
2160 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
2161 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
2162 SSL_kECDHE,
2163 SSL_aECDSA,
2164 SSL_AES128,
2165 SSL_SHA1,
2166 SSL_SSLV3,
2167 SSL_HIGH | SSL_FIPS,
2168 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2169 128,
2170 128,
2171 },
2172
2173 /* Cipher C00A */
2174 {
2175 1,
2176 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
2177 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
2178 SSL_kECDHE,
2179 SSL_aECDSA,
2180 SSL_AES256,
2181 SSL_SHA1,
2182 SSL_SSLV3,
2183 SSL_HIGH | SSL_FIPS,
2184 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2185 256,
2186 256,
2187 },
2188
2189 /* Cipher C00B */
2190 {
2191 1,
2192 TLS1_TXT_ECDH_RSA_WITH_NULL_SHA,
2193 TLS1_CK_ECDH_RSA_WITH_NULL_SHA,
2194 SSL_kECDHr,
2195 SSL_aECDH,
2196 SSL_eNULL,
2197 SSL_SHA1,
2198 SSL_SSLV3,
2199 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2200 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2201 0,
2202 0,
2203 },
2204
2205 /* Cipher C00C */
2206 {
2207 1,
2208 TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA,
2209 TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA,
2210 SSL_kECDHr,
2211 SSL_aECDH,
2212 SSL_RC4,
2213 SSL_SHA1,
2214 SSL_SSLV3,
2215 SSL_NOT_DEFAULT | SSL_MEDIUM,
2216 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2217 128,
2218 128,
2219 },
2220
2221 /* Cipher C00D */
2222 {
2223 1,
2224 TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA,
2225 TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA,
2226 SSL_kECDHr,
2227 SSL_aECDH,
2228 SSL_3DES,
2229 SSL_SHA1,
2230 SSL_SSLV3,
2231 SSL_HIGH | SSL_FIPS,
2232 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2233 112,
2234 168,
2235 },
2236
2237 /* Cipher C00E */
2238 {
2239 1,
2240 TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA,
2241 TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA,
2242 SSL_kECDHr,
2243 SSL_aECDH,
2244 SSL_AES128,
2245 SSL_SHA1,
2246 SSL_SSLV3,
2247 SSL_HIGH | SSL_FIPS,
2248 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2249 128,
2250 128,
2251 },
2252
2253 /* Cipher C00F */
2254 {
2255 1,
2256 TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA,
2257 TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA,
2258 SSL_kECDHr,
2259 SSL_aECDH,
2260 SSL_AES256,
2261 SSL_SHA1,
2262 SSL_SSLV3,
2263 SSL_HIGH | SSL_FIPS,
2264 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2265 256,
2266 256,
2267 },
2268
2269 /* Cipher C010 */
2270 {
2271 1,
2272 TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA,
2273 TLS1_CK_ECDHE_RSA_WITH_NULL_SHA,
2274 SSL_kECDHE,
2275 SSL_aRSA,
2276 SSL_eNULL,
2277 SSL_SHA1,
2278 SSL_SSLV3,
2279 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2280 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2281 0,
2282 0,
2283 },
2284
2285 /* Cipher C011 */
2286 {
2287 1,
2288 TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA,
2289 TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA,
2290 SSL_kECDHE,
2291 SSL_aRSA,
2292 SSL_RC4,
2293 SSL_SHA1,
2294 SSL_SSLV3,
2295 SSL_NOT_DEFAULT | SSL_MEDIUM,
2296 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2297 128,
2298 128,
2299 },
2300
2301 /* Cipher C012 */
2302 {
2303 1,
2304 TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
2305 TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
2306 SSL_kECDHE,
2307 SSL_aRSA,
2308 SSL_3DES,
2309 SSL_SHA1,
2310 SSL_SSLV3,
2311 SSL_HIGH | SSL_FIPS,
2312 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2313 112,
2314 168,
2315 },
2316
2317 /* Cipher C013 */
2318 {
2319 1,
2320 TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA,
2321 TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA,
2322 SSL_kECDHE,
2323 SSL_aRSA,
2324 SSL_AES128,
2325 SSL_SHA1,
2326 SSL_SSLV3,
2327 SSL_HIGH | SSL_FIPS,
2328 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2329 128,
2330 128,
2331 },
2332
2333 /* Cipher C014 */
2334 {
2335 1,
2336 TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA,
2337 TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA,
2338 SSL_kECDHE,
2339 SSL_aRSA,
2340 SSL_AES256,
2341 SSL_SHA1,
2342 SSL_SSLV3,
2343 SSL_HIGH | SSL_FIPS,
2344 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2345 256,
2346 256,
2347 },
2348
2349 /* Cipher C015 */
2350 {
2351 1,
2352 TLS1_TXT_ECDH_anon_WITH_NULL_SHA,
2353 TLS1_CK_ECDH_anon_WITH_NULL_SHA,
2354 SSL_kECDHE,
2355 SSL_aNULL,
2356 SSL_eNULL,
2357 SSL_SHA1,
2358 SSL_SSLV3,
2359 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2360 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2361 0,
2362 0,
2363 },
2364
2365 /* Cipher C016 */
2366 {
2367 1,
2368 TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA,
2369 TLS1_CK_ECDH_anon_WITH_RC4_128_SHA,
2370 SSL_kECDHE,
2371 SSL_aNULL,
2372 SSL_RC4,
2373 SSL_SHA1,
2374 SSL_SSLV3,
2375 SSL_NOT_DEFAULT | SSL_MEDIUM,
2376 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2377 128,
2378 128,
2379 },
2380
2381 /* Cipher C017 */
2382 {
2383 1,
2384 TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA,
2385 TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA,
2386 SSL_kECDHE,
2387 SSL_aNULL,
2388 SSL_3DES,
2389 SSL_SHA1,
2390 SSL_SSLV3,
2391 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
2392 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2393 112,
2394 168,
2395 },
2396
2397 /* Cipher C018 */
2398 {
2399 1,
2400 TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA,
2401 TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA,
2402 SSL_kECDHE,
2403 SSL_aNULL,
2404 SSL_AES128,
2405 SSL_SHA1,
2406 SSL_SSLV3,
2407 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
2408 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2409 128,
2410 128,
2411 },
2412
2413 /* Cipher C019 */
2414 {
2415 1,
2416 TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA,
2417 TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA,
2418 SSL_kECDHE,
2419 SSL_aNULL,
2420 SSL_AES256,
2421 SSL_SHA1,
2422 SSL_SSLV3,
2423 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
2424 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2425 256,
2426 256,
2427 },
2428 #endif /* OPENSSL_NO_EC */
2429
2430 #ifndef OPENSSL_NO_SRP
2431 /* Cipher C01A */
2432 {
2433 1,
2434 TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
2435 TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
2436 SSL_kSRP,
2437 SSL_aSRP,
2438 SSL_3DES,
2439 SSL_SHA1,
2440 SSL_SSLV3,
2441 SSL_HIGH,
2442 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2443 112,
2444 168,
2445 },
2446
2447 /* Cipher C01B */
2448 {
2449 1,
2450 TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
2451 TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
2452 SSL_kSRP,
2453 SSL_aRSA,
2454 SSL_3DES,
2455 SSL_SHA1,
2456 SSL_SSLV3,
2457 SSL_HIGH,
2458 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2459 112,
2460 168,
2461 },
2462
2463 /* Cipher C01C */
2464 {
2465 1,
2466 TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
2467 TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
2468 SSL_kSRP,
2469 SSL_aDSS,
2470 SSL_3DES,
2471 SSL_SHA1,
2472 SSL_SSLV3,
2473 SSL_HIGH,
2474 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2475 112,
2476 168,
2477 },
2478
2479 /* Cipher C01D */
2480 {
2481 1,
2482 TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA,
2483 TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA,
2484 SSL_kSRP,
2485 SSL_aSRP,
2486 SSL_AES128,
2487 SSL_SHA1,
2488 SSL_SSLV3,
2489 SSL_HIGH,
2490 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2491 128,
2492 128,
2493 },
2494
2495 /* Cipher C01E */
2496 {
2497 1,
2498 TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
2499 TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
2500 SSL_kSRP,
2501 SSL_aRSA,
2502 SSL_AES128,
2503 SSL_SHA1,
2504 SSL_SSLV3,
2505 SSL_HIGH,
2506 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2507 128,
2508 128,
2509 },
2510
2511 /* Cipher C01F */
2512 {
2513 1,
2514 TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
2515 TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
2516 SSL_kSRP,
2517 SSL_aDSS,
2518 SSL_AES128,
2519 SSL_SHA1,
2520 SSL_SSLV3,
2521 SSL_HIGH,
2522 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2523 128,
2524 128,
2525 },
2526
2527 /* Cipher C020 */
2528 {
2529 1,
2530 TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA,
2531 TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA,
2532 SSL_kSRP,
2533 SSL_aSRP,
2534 SSL_AES256,
2535 SSL_SHA1,
2536 SSL_SSLV3,
2537 SSL_HIGH,
2538 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2539 256,
2540 256,
2541 },
2542
2543 /* Cipher C021 */
2544 {
2545 1,
2546 TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
2547 TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
2548 SSL_kSRP,
2549 SSL_aRSA,
2550 SSL_AES256,
2551 SSL_SHA1,
2552 SSL_SSLV3,
2553 SSL_HIGH,
2554 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2555 256,
2556 256,
2557 },
2558
2559 /* Cipher C022 */
2560 {
2561 1,
2562 TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
2563 TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
2564 SSL_kSRP,
2565 SSL_aDSS,
2566 SSL_AES256,
2567 SSL_SHA1,
2568 SSL_SSLV3,
2569 SSL_HIGH,
2570 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2571 256,
2572 256,
2573 },
2574 #endif /* OPENSSL_NO_SRP */
2575 #ifndef OPENSSL_NO_EC
2576
2577 /* HMAC based TLS v1.2 ciphersuites from RFC5289 */
2578
2579 /* Cipher C023 */
2580 {
2581 1,
2582 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256,
2583 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256,
2584 SSL_kECDHE,
2585 SSL_aECDSA,
2586 SSL_AES128,
2587 SSL_SHA256,
2588 SSL_TLSV1_2,
2589 SSL_HIGH | SSL_FIPS,
2590 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2591 128,
2592 128,
2593 },
2594
2595 /* Cipher C024 */
2596 {
2597 1,
2598 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384,
2599 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384,
2600 SSL_kECDHE,
2601 SSL_aECDSA,
2602 SSL_AES256,
2603 SSL_SHA384,
2604 SSL_TLSV1_2,
2605 SSL_HIGH | SSL_FIPS,
2606 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2607 256,
2608 256,
2609 },
2610
2611 /* Cipher C025 */
2612 {
2613 1,
2614 TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256,
2615 TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256,
2616 SSL_kECDHe,
2617 SSL_aECDH,
2618 SSL_AES128,
2619 SSL_SHA256,
2620 SSL_TLSV1_2,
2621 SSL_HIGH | SSL_FIPS,
2622 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2623 128,
2624 128,
2625 },
2626
2627 /* Cipher C026 */
2628 {
2629 1,
2630 TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384,
2631 TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384,
2632 SSL_kECDHe,
2633 SSL_aECDH,
2634 SSL_AES256,
2635 SSL_SHA384,
2636 SSL_TLSV1_2,
2637 SSL_HIGH | SSL_FIPS,
2638 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2639 256,
2640 256,
2641 },
2642
2643 /* Cipher C027 */
2644 {
2645 1,
2646 TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256,
2647 TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256,
2648 SSL_kECDHE,
2649 SSL_aRSA,
2650 SSL_AES128,
2651 SSL_SHA256,
2652 SSL_TLSV1_2,
2653 SSL_HIGH | SSL_FIPS,
2654 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2655 128,
2656 128,
2657 },
2658
2659 /* Cipher C028 */
2660 {
2661 1,
2662 TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384,
2663 TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384,
2664 SSL_kECDHE,
2665 SSL_aRSA,
2666 SSL_AES256,
2667 SSL_SHA384,
2668 SSL_TLSV1_2,
2669 SSL_HIGH | SSL_FIPS,
2670 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2671 256,
2672 256,
2673 },
2674
2675 /* Cipher C029 */
2676 {
2677 1,
2678 TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256,
2679 TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256,
2680 SSL_kECDHr,
2681 SSL_aECDH,
2682 SSL_AES128,
2683 SSL_SHA256,
2684 SSL_TLSV1_2,
2685 SSL_HIGH | SSL_FIPS,
2686 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2687 128,
2688 128,
2689 },
2690
2691 /* Cipher C02A */
2692 {
2693 1,
2694 TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384,
2695 TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384,
2696 SSL_kECDHr,
2697 SSL_aECDH,
2698 SSL_AES256,
2699 SSL_SHA384,
2700 SSL_TLSV1_2,
2701 SSL_HIGH | SSL_FIPS,
2702 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2703 256,
2704 256,
2705 },
2706
2707 /* GCM based TLS v1.2 ciphersuites from RFC5289 */
2708
2709 /* Cipher C02B */
2710 {
2711 1,
2712 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
2713 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
2714 SSL_kECDHE,
2715 SSL_aECDSA,
2716 SSL_AES128GCM,
2717 SSL_AEAD,
2718 SSL_TLSV1_2,
2719 SSL_HIGH | SSL_FIPS,
2720 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2721 128,
2722 128,
2723 },
2724
2725 /* Cipher C02C */
2726 {
2727 1,
2728 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
2729 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
2730 SSL_kECDHE,
2731 SSL_aECDSA,
2732 SSL_AES256GCM,
2733 SSL_AEAD,
2734 SSL_TLSV1_2,
2735 SSL_HIGH | SSL_FIPS,
2736 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2737 256,
2738 256,
2739 },
2740
2741 /* Cipher C02D */
2742 {
2743 1,
2744 TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
2745 TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
2746 SSL_kECDHe,
2747 SSL_aECDH,
2748 SSL_AES128GCM,
2749 SSL_AEAD,
2750 SSL_TLSV1_2,
2751 SSL_HIGH | SSL_FIPS,
2752 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2753 128,
2754 128,
2755 },
2756
2757 /* Cipher C02E */
2758 {
2759 1,
2760 TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,
2761 TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,
2762 SSL_kECDHe,
2763 SSL_aECDH,
2764 SSL_AES256GCM,
2765 SSL_AEAD,
2766 SSL_TLSV1_2,
2767 SSL_HIGH | SSL_FIPS,
2768 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2769 256,
2770 256,
2771 },
2772
2773 /* Cipher C02F */
2774 {
2775 1,
2776 TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
2777 TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
2778 SSL_kECDHE,
2779 SSL_aRSA,
2780 SSL_AES128GCM,
2781 SSL_AEAD,
2782 SSL_TLSV1_2,
2783 SSL_HIGH | SSL_FIPS,
2784 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2785 128,
2786 128,
2787 },
2788
2789 /* Cipher C030 */
2790 {
2791 1,
2792 TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
2793 TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
2794 SSL_kECDHE,
2795 SSL_aRSA,
2796 SSL_AES256GCM,
2797 SSL_AEAD,
2798 SSL_TLSV1_2,
2799 SSL_HIGH | SSL_FIPS,
2800 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2801 256,
2802 256,
2803 },
2804
2805 /* Cipher C031 */
2806 {
2807 1,
2808 TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256,
2809 TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256,
2810 SSL_kECDHr,
2811 SSL_aECDH,
2812 SSL_AES128GCM,
2813 SSL_AEAD,
2814 SSL_TLSV1_2,
2815 SSL_HIGH | SSL_FIPS,
2816 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2817 128,
2818 128,
2819 },
2820
2821 /* Cipher C032 */
2822 {
2823 1,
2824 TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384,
2825 TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384,
2826 SSL_kECDHr,
2827 SSL_aECDH,
2828 SSL_AES256GCM,
2829 SSL_AEAD,
2830 SSL_TLSV1_2,
2831 SSL_HIGH | SSL_FIPS,
2832 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2833 256,
2834 256,
2835 },
2836
2837 /* PSK ciphersuites from RFC 5489 */
2838 /* Cipher C033 */
2839 {
2840 1,
2841 TLS1_TXT_ECDHE_PSK_WITH_RC4_128_SHA,
2842 TLS1_CK_ECDHE_PSK_WITH_RC4_128_SHA,
2843 SSL_kECDHEPSK,
2844 SSL_aPSK,
2845 SSL_RC4,
2846 SSL_SHA1,
2847 SSL_SSLV3,
2848 SSL_NOT_DEFAULT | SSL_MEDIUM,
2849 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2850 128,
2851 128,
2852 },
2853
2854 /* Cipher C034 */
2855 {
2856 1,
2857 TLS1_TXT_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
2858 TLS1_CK_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
2859 SSL_kECDHEPSK,
2860 SSL_aPSK,
2861 SSL_3DES,
2862 SSL_SHA1,
2863 SSL_SSLV3,
2864 SSL_HIGH | SSL_FIPS,
2865 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2866 112,
2867 168,
2868 },
2869
2870 /* Cipher C035 */
2871 {
2872 1,
2873 TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA,
2874 TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA,
2875 SSL_kECDHEPSK,
2876 SSL_aPSK,
2877 SSL_AES128,
2878 SSL_SHA1,
2879 SSL_SSLV3,
2880 SSL_HIGH | SSL_FIPS,
2881 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2882 128,
2883 128,
2884 },
2885
2886 /* Cipher C036 */
2887 {
2888 1,
2889 TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA,
2890 TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA,
2891 SSL_kECDHEPSK,
2892 SSL_aPSK,
2893 SSL_AES256,
2894 SSL_SHA1,
2895 SSL_SSLV3,
2896 SSL_HIGH | SSL_FIPS,
2897 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2898 256,
2899 256,
2900 },
2901
2902 /* Cipher C037 */
2903 {
2904 1,
2905 TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
2906 TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
2907 SSL_kECDHEPSK,
2908 SSL_aPSK,
2909 SSL_AES128,
2910 SSL_SHA256,
2911 SSL_TLSV1,
2912 SSL_HIGH | SSL_FIPS,
2913 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2914 128,
2915 128,
2916 },
2917
2918 /* Cipher C038 */
2919 {
2920 1,
2921 TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
2922 TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
2923 SSL_kECDHEPSK,
2924 SSL_aPSK,
2925 SSL_AES256,
2926 SSL_SHA384,
2927 SSL_TLSV1,
2928 SSL_HIGH | SSL_FIPS,
2929 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2930 256,
2931 256,
2932 },
2933
2934 /* Cipher C039 */
2935 {
2936 1,
2937 TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA,
2938 TLS1_CK_ECDHE_PSK_WITH_NULL_SHA,
2939 SSL_kECDHEPSK,
2940 SSL_aPSK,
2941 SSL_eNULL,
2942 SSL_SHA1,
2943 SSL_SSLV3,
2944 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2945 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2946 0,
2947 0,
2948 },
2949
2950 /* Cipher C03A */
2951 {
2952 1,
2953 TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA256,
2954 TLS1_CK_ECDHE_PSK_WITH_NULL_SHA256,
2955 SSL_kECDHEPSK,
2956 SSL_aPSK,
2957 SSL_eNULL,
2958 SSL_SHA256,
2959 SSL_TLSV1,
2960 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2961 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2962 0,
2963 0,
2964 },
2965
2966 /* Cipher C03B */
2967 {
2968 1,
2969 TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA384,
2970 TLS1_CK_ECDHE_PSK_WITH_NULL_SHA384,
2971 SSL_kECDHEPSK,
2972 SSL_aPSK,
2973 SSL_eNULL,
2974 SSL_SHA384,
2975 SSL_TLSV1,
2976 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2977 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2978 0,
2979 0,
2980 },
2981
2982 # ifndef OPENSSL_NO_CAMELLIA
2983 { /* Cipher C072 */
2984 1,
2985 TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
2986 TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
2987 SSL_kECDHE,
2988 SSL_aECDSA,
2989 SSL_CAMELLIA128,
2990 SSL_SHA256,
2991 SSL_TLSV1_2,
2992 SSL_HIGH,
2993 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2994 128,
2995 128},
2996
2997 { /* Cipher C073 */
2998 1,
2999 TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
3000 TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
3001 SSL_kECDHE,
3002 SSL_aECDSA,
3003 SSL_CAMELLIA256,
3004 SSL_SHA384,
3005 SSL_TLSV1_2,
3006 SSL_HIGH,
3007 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3008 256,
3009 256},
3010
3011 { /* Cipher C074 */
3012 1,
3013 TLS1_TXT_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
3014 TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
3015 SSL_kECDHe,
3016 SSL_aECDH,
3017 SSL_CAMELLIA128,
3018 SSL_SHA256,
3019 SSL_TLSV1_2,
3020 SSL_HIGH,
3021 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3022 128,
3023 128},
3024
3025 { /* Cipher C075 */
3026 1,
3027 TLS1_TXT_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
3028 TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
3029 SSL_kECDHe,
3030 SSL_aECDH,
3031 SSL_CAMELLIA256,
3032 SSL_SHA384,
3033 SSL_TLSV1_2,
3034 SSL_HIGH,
3035 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3036 256,
3037 256},
3038
3039 { /* Cipher C076 */
3040 1,
3041 TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
3042 TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
3043 SSL_kECDHE,
3044 SSL_aRSA,
3045 SSL_CAMELLIA128,
3046 SSL_SHA256,
3047 SSL_TLSV1_2,
3048 SSL_HIGH,
3049 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3050 128,
3051 128},
3052
3053 { /* Cipher C077 */
3054 1,
3055 TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
3056 TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
3057 SSL_kECDHE,
3058 SSL_aRSA,
3059 SSL_CAMELLIA256,
3060 SSL_SHA384,
3061 SSL_TLSV1_2,
3062 SSL_HIGH,
3063 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3064 256,
3065 256},
3066
3067 { /* Cipher C078 */
3068 1,
3069 TLS1_TXT_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256,
3070 TLS1_CK_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256,
3071 SSL_kECDHr,
3072 SSL_aECDH,
3073 SSL_CAMELLIA128,
3074 SSL_SHA256,
3075 SSL_TLSV1_2,
3076 SSL_HIGH,
3077 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3078 128,
3079 128},
3080
3081 { /* Cipher C079 */
3082 1,
3083 TLS1_TXT_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384,
3084 TLS1_CK_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384,
3085 SSL_kECDHr,
3086 SSL_aECDH,
3087 SSL_CAMELLIA256,
3088 SSL_SHA384,
3089 SSL_TLSV1_2,
3090 SSL_HIGH,
3091 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3092 256,
3093 256},
3094 # endif /* OPENSSL_NO_CAMELLIA */
3095 #endif /* OPENSSL_NO_EC */
3096
3097 #if !defined(OPENSSL_NO_CAMELLIA) && !defined(OPENSSL_NO_PSK)
3098 { /* Cipher C094 */
3099 1,
3100 TLS1_TXT_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3101 TLS1_CK_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3102 SSL_kPSK,
3103 SSL_aPSK,
3104 SSL_CAMELLIA128,
3105 SSL_SHA256,
3106 SSL_TLSV1,
3107 SSL_HIGH,
3108 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
3109 128,
3110 128},
3111
3112 { /* Cipher C095 */
3113 1,
3114 TLS1_TXT_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3115 TLS1_CK_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3116 SSL_kPSK,
3117 SSL_aPSK,
3118 SSL_CAMELLIA256,
3119 SSL_SHA384,
3120 SSL_TLSV1,
3121 SSL_HIGH,
3122 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3123 256,
3124 256},
3125
3126 { /* Cipher C096 */
3127 1,
3128 TLS1_TXT_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3129 TLS1_CK_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3130 SSL_kDHEPSK,
3131 SSL_aPSK,
3132 SSL_CAMELLIA128,
3133 SSL_SHA256,
3134 SSL_TLSV1,
3135 SSL_HIGH,
3136 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
3137 128,
3138 128},
3139
3140 { /* Cipher C097 */
3141 1,
3142 TLS1_TXT_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3143 TLS1_CK_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3144 SSL_kDHEPSK,
3145 SSL_aPSK,
3146 SSL_CAMELLIA256,
3147 SSL_SHA384,
3148 SSL_TLSV1,
3149 SSL_HIGH,
3150 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3151 256,
3152 256},
3153
3154 { /* Cipher C098 */
3155 1,
3156 TLS1_TXT_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3157 TLS1_CK_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3158 SSL_kRSAPSK,
3159 SSL_aRSA,
3160 SSL_CAMELLIA128,
3161 SSL_SHA256,
3162 SSL_TLSV1,
3163 SSL_HIGH,
3164 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
3165 128,
3166 128},
3167
3168 { /* Cipher C099 */
3169 1,
3170 TLS1_TXT_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3171 TLS1_CK_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3172 SSL_kRSAPSK,
3173 SSL_aRSA,
3174 SSL_CAMELLIA256,
3175 SSL_SHA384,
3176 SSL_TLSV1,
3177 SSL_HIGH,
3178 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3179 256,
3180 256},
3181
3182 { /* Cipher C09A */
3183 1,
3184 TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3185 TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3186 SSL_kECDHEPSK,
3187 SSL_aPSK,
3188 SSL_CAMELLIA128,
3189 SSL_SHA256,
3190 SSL_TLSV1,
3191 SSL_HIGH,
3192 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
3193 128,
3194 128},
3195
3196 { /* Cipher C09B */
3197 1,
3198 TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3199 TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3200 SSL_kECDHEPSK,
3201 SSL_aPSK,
3202 SSL_CAMELLIA256,
3203 SSL_SHA384,
3204 SSL_TLSV1,
3205 SSL_HIGH,
3206 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3207 256,
3208 256},
3209 #endif
3210
3211 /* Cipher C09C */
3212 {
3213 1,
3214 TLS1_TXT_RSA_WITH_AES_128_CCM,
3215 TLS1_CK_RSA_WITH_AES_128_CCM,
3216 SSL_kRSA,
3217 SSL_aRSA,
3218 SSL_AES128CCM,
3219 SSL_AEAD,
3220 SSL_TLSV1_2,
3221 SSL_HIGH,
3222 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3223 128,
3224 128,
3225 },
3226
3227 /* Cipher C09D */
3228 {
3229 1,
3230 TLS1_TXT_RSA_WITH_AES_256_CCM,
3231 TLS1_CK_RSA_WITH_AES_256_CCM,
3232 SSL_kRSA,
3233 SSL_aRSA,
3234 SSL_AES256CCM,
3235 SSL_AEAD,
3236 SSL_TLSV1_2,
3237 SSL_HIGH,
3238 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3239 256,
3240 256,
3241 },
3242
3243 /* Cipher C09E */
3244 {
3245 1,
3246 TLS1_TXT_DHE_RSA_WITH_AES_128_CCM,
3247 TLS1_CK_DHE_RSA_WITH_AES_128_CCM,
3248 SSL_kDHE,
3249 SSL_aRSA,
3250 SSL_AES128CCM,
3251 SSL_AEAD,
3252 SSL_TLSV1_2,
3253 SSL_HIGH,
3254 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3255 128,
3256 128,
3257 },
3258
3259 /* Cipher C09F */
3260 {
3261 1,
3262 TLS1_TXT_DHE_RSA_WITH_AES_256_CCM,
3263 TLS1_CK_DHE_RSA_WITH_AES_256_CCM,
3264 SSL_kDHE,
3265 SSL_aRSA,
3266 SSL_AES256CCM,
3267 SSL_AEAD,
3268 SSL_TLSV1_2,
3269 SSL_HIGH,
3270 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3271 256,
3272 256,
3273 },
3274
3275 /* Cipher C0A0 */
3276 {
3277 1,
3278 TLS1_TXT_RSA_WITH_AES_128_CCM_8,
3279 TLS1_CK_RSA_WITH_AES_128_CCM_8,
3280 SSL_kRSA,
3281 SSL_aRSA,
3282 SSL_AES128CCM8,
3283 SSL_AEAD,
3284 SSL_TLSV1_2,
3285 SSL_HIGH,
3286 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3287 128,
3288 128,
3289 },
3290
3291 /* Cipher C0A1 */
3292 {
3293 1,
3294 TLS1_TXT_RSA_WITH_AES_256_CCM_8,
3295 TLS1_CK_RSA_WITH_AES_256_CCM_8,
3296 SSL_kRSA,
3297 SSL_aRSA,
3298 SSL_AES256CCM8,
3299 SSL_AEAD,
3300 SSL_TLSV1_2,
3301 SSL_HIGH,
3302 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3303 256,
3304 256,
3305 },
3306
3307 /* Cipher C0A2 */
3308 {
3309 1,
3310 TLS1_TXT_DHE_RSA_WITH_AES_128_CCM_8,
3311 TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8,
3312 SSL_kDHE,
3313 SSL_aRSA,
3314 SSL_AES128CCM8,
3315 SSL_AEAD,
3316 SSL_TLSV1_2,
3317 SSL_HIGH,
3318 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3319 128,
3320 128,
3321 },
3322
3323 /* Cipher C0A3 */
3324 {
3325 1,
3326 TLS1_TXT_DHE_RSA_WITH_AES_256_CCM_8,
3327 TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8,
3328 SSL_kDHE,
3329 SSL_aRSA,
3330 SSL_AES256CCM8,
3331 SSL_AEAD,
3332 SSL_TLSV1_2,
3333 SSL_HIGH,
3334 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3335 256,
3336 256,
3337 },
3338
3339 /* Cipher C0A4 */
3340 {
3341 1,
3342 TLS1_TXT_PSK_WITH_AES_128_CCM,
3343 TLS1_CK_PSK_WITH_AES_128_CCM,
3344 SSL_kPSK,
3345 SSL_aPSK,
3346 SSL_AES128CCM,
3347 SSL_AEAD,
3348 SSL_TLSV1_2,
3349 SSL_HIGH,
3350 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3351 128,
3352 128,
3353 },
3354
3355 /* Cipher C0A4 */
3356 {
3357 1,
3358 TLS1_TXT_PSK_WITH_AES_256_CCM,
3359 TLS1_CK_PSK_WITH_AES_256_CCM,
3360 SSL_kPSK,
3361 SSL_aPSK,
3362 SSL_AES256CCM,
3363 SSL_AEAD,
3364 SSL_TLSV1_2,
3365 SSL_HIGH,
3366 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3367 256,
3368 256,
3369 },
3370
3371 /* Cipher C0A6 */
3372 {
3373 1,
3374 TLS1_TXT_DHE_PSK_WITH_AES_128_CCM,
3375 TLS1_CK_DHE_PSK_WITH_AES_128_CCM,
3376 SSL_kDHEPSK,
3377 SSL_aPSK,
3378 SSL_AES128CCM,
3379 SSL_AEAD,
3380 SSL_TLSV1_2,
3381 SSL_HIGH,
3382 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3383 128,
3384 128,
3385 },
3386
3387 /* Cipher C0A7 */
3388 {
3389 1,
3390 TLS1_TXT_DHE_PSK_WITH_AES_256_CCM,
3391 TLS1_CK_DHE_PSK_WITH_AES_256_CCM,
3392 SSL_kDHEPSK,
3393 SSL_aPSK,
3394 SSL_AES256CCM,
3395 SSL_AEAD,
3396 SSL_TLSV1_2,
3397 SSL_HIGH,
3398 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3399 256,
3400 256,
3401 },
3402
3403 /* Cipher C0A8 */
3404 {
3405 1,
3406 TLS1_TXT_PSK_WITH_AES_128_CCM_8,
3407 TLS1_CK_PSK_WITH_AES_128_CCM_8,
3408 SSL_kPSK,
3409 SSL_aPSK,
3410 SSL_AES128CCM8,
3411 SSL_AEAD,
3412 SSL_TLSV1_2,
3413 SSL_HIGH,
3414 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3415 128,
3416 128,
3417 },
3418
3419 /* Cipher C0A9 */
3420 {
3421 1,
3422 TLS1_TXT_PSK_WITH_AES_256_CCM_8,
3423 TLS1_CK_PSK_WITH_AES_256_CCM_8,
3424 SSL_kPSK,
3425 SSL_aPSK,
3426 SSL_AES256CCM8,
3427 SSL_AEAD,
3428 SSL_TLSV1_2,
3429 SSL_HIGH,
3430 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3431 256,
3432 256,
3433 },
3434
3435 /* Cipher C0AA */
3436 {
3437 1,
3438 TLS1_TXT_DHE_PSK_WITH_AES_128_CCM_8,
3439 TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8,
3440 SSL_kDHEPSK,
3441 SSL_aPSK,
3442 SSL_AES128CCM8,
3443 SSL_AEAD,
3444 SSL_TLSV1_2,
3445 SSL_HIGH,
3446 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3447 128,
3448 128,
3449 },
3450
3451 /* Cipher C0AB */
3452 {
3453 1,
3454 TLS1_TXT_DHE_PSK_WITH_AES_256_CCM_8,
3455 TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8,
3456 SSL_kDHEPSK,
3457 SSL_aPSK,
3458 SSL_AES256CCM8,
3459 SSL_AEAD,
3460 SSL_TLSV1_2,
3461 SSL_HIGH,
3462 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3463 256,
3464 256,
3465 },
3466
3467 /* Cipher C0AC */
3468 {
3469 1,
3470 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM,
3471 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM,
3472 SSL_kECDHE,
3473 SSL_aECDSA,
3474 SSL_AES128CCM,
3475 SSL_AEAD,
3476 SSL_TLSV1_2,
3477 SSL_HIGH,
3478 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3479 128,
3480 128,
3481 },
3482
3483 /* Cipher C0AD */
3484 {
3485 1,
3486 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM,
3487 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM,
3488 SSL_kECDHE,
3489 SSL_aECDSA,
3490 SSL_AES256CCM,
3491 SSL_AEAD,
3492 SSL_TLSV1_2,
3493 SSL_HIGH,
3494 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3495 256,
3496 256,
3497 },
3498
3499 /* Cipher C0AE */
3500 {
3501 1,
3502 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM_8,
3503 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8,
3504 SSL_kECDHE,
3505 SSL_aECDSA,
3506 SSL_AES128CCM8,
3507 SSL_AEAD,
3508 SSL_TLSV1_2,
3509 SSL_HIGH,
3510 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3511 128,
3512 128,
3513 },
3514
3515 /* Cipher C0AF */
3516 {
3517 1,
3518 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8,
3519 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8,
3520 SSL_kECDHE,
3521 SSL_aECDSA,
3522 SSL_AES256CCM8,
3523 SSL_AEAD,
3524 SSL_TLSV1_2,
3525 SSL_HIGH,
3526 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3527 256,
3528 256,
3529 },
3530 #if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
3531 # ifndef OPENSSL_NO_EC
3532 /* Cipher CCA8 as per draft-ietf-tls-chacha20-poly1305-03 */
3533 {
3534 1,
3535 TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305,
3536 TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305,
3537 SSL_kECDHE,
3538 SSL_aRSA,
3539 SSL_CHACHA20POLY1305,
3540 SSL_AEAD,
3541 SSL_TLSV1_2,
3542 SSL_HIGH,
3543 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3544 256,
3545 256,
3546 },
3547 /* Cipher CCA9 */
3548 {
3549 1,
3550 TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
3551 TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
3552 SSL_kECDHE,
3553 SSL_aECDSA,
3554 SSL_CHACHA20POLY1305,
3555 SSL_AEAD,
3556 SSL_TLSV1_2,
3557 SSL_HIGH,
3558 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3559 256,
3560 256,
3561 },
3562 # endif
3563 # ifndef OPENSSL_NO_RSA
3564 /* Cipher CCAA */
3565 {
3566 1,
3567 TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305,
3568 TLS1_CK_DHE_RSA_WITH_CHACHA20_POLY1305,
3569 SSL_kDHE,
3570 SSL_aRSA,
3571 SSL_CHACHA20POLY1305,
3572 SSL_AEAD,
3573 SSL_TLSV1_2,
3574 SSL_HIGH,
3575 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3576 256,
3577 256,
3578 },
3579 # endif
3580 # ifndef OPENSSL_NO_PSK
3581 /* Cipher CCAB */
3582 {
3583 1,
3584 TLS1_TXT_PSK_WITH_CHACHA20_POLY1305,
3585 TLS1_CK_PSK_WITH_CHACHA20_POLY1305,
3586 SSL_kPSK,
3587 SSL_aPSK,
3588 SSL_CHACHA20POLY1305,
3589 SSL_AEAD,
3590 SSL_TLSV1_2,
3591 SSL_HIGH,
3592 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3593 256,
3594 256,
3595 },
3596 /* Cipher CCAC */
3597 {
3598 1,
3599 TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305,
3600 TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305,
3601 SSL_kECDHEPSK,
3602 SSL_aPSK,
3603 SSL_CHACHA20POLY1305,
3604 SSL_AEAD,
3605 SSL_TLSV1_2,
3606 SSL_HIGH,
3607 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3608 256,
3609 256,
3610 },
3611 /* Cipher CCAD */
3612 {
3613 1,
3614 TLS1_TXT_DHE_PSK_WITH_CHACHA20_POLY1305,
3615 TLS1_CK_DHE_PSK_WITH_CHACHA20_POLY1305,
3616 SSL_kDHEPSK,
3617 SSL_aPSK,
3618 SSL_CHACHA20POLY1305,
3619 SSL_AEAD,
3620 SSL_TLSV1_2,
3621 SSL_HIGH,
3622 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3623 256,
3624 256,
3625 },
3626 /* Cipher CCAE */
3627 {
3628 1,
3629 TLS1_TXT_RSA_PSK_WITH_CHACHA20_POLY1305,
3630 TLS1_CK_RSA_PSK_WITH_CHACHA20_POLY1305,
3631 SSL_kRSAPSK,
3632 SSL_aRSA,
3633 SSL_CHACHA20POLY1305,
3634 SSL_AEAD,
3635 SSL_TLSV1_2,
3636 SSL_HIGH,
3637 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3638 256,
3639 256,
3640 },
3641 # endif
3642 #endif
3643 #ifndef OPENSSL_NO_GOST
3644 {
3645 1,
3646 "GOST2012-GOST8912-GOST8912",
3647 0x0300ff85,
3648 SSL_kGOST,
3649 SSL_aGOST12 | SSL_aGOST01,
3650 SSL_eGOST2814789CNT12,
3651 SSL_GOST89MAC12,
3652 SSL_TLSV1,
3653 SSL_HIGH,
3654 SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_STREAM_MAC,
3655 256,
3656 256},
3657 {
3658 1,
3659 "GOST2012-NULL-GOST12",
3660 0x0300ff87,
3661 SSL_kGOST,
3662 SSL_aGOST12 | SSL_aGOST01,
3663 SSL_eNULL,
3664 SSL_GOST12_256,
3665 SSL_TLSV1,
3666 SSL_STRONG_NONE,
3667 SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256,
3668 0,
3669 0},
3670 #endif
3671
3672 /* end of list */
3673 };
3674
3675 const SSL3_ENC_METHOD SSLv3_enc_data = {
3676 ssl3_enc,
3677 n_ssl3_mac,
3678 ssl3_setup_key_block,
3679 ssl3_generate_master_secret,
3680 ssl3_change_cipher_state,
3681 ssl3_final_finish_mac,
3682 MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH,
3683 SSL3_MD_CLIENT_FINISHED_CONST, 4,
3684 SSL3_MD_SERVER_FINISHED_CONST, 4,
3685 ssl3_alert_code,
3686 (int (*)(SSL *, unsigned char *, size_t, const char *,
3687 size_t, const unsigned char *, size_t,
3688 int use_context))ssl_undefined_function,
3689 0,
3690 SSL3_HM_HEADER_LENGTH,
3691 ssl3_set_handshake_header,
3692 ssl3_handshake_write
3693 };
3694
3695 long ssl3_default_timeout(void)
3696 {
3697 /*
3698 * 2 hours, the 24 hours mentioned in the SSLv3 spec is way too long for
3699 * http, the cache would over fill
3700 */
3701 return (60 * 60 * 2);
3702 }
3703
3704 int ssl3_num_ciphers(void)
3705 {
3706 return (SSL3_NUM_CIPHERS);
3707 }
3708
3709 const SSL_CIPHER *ssl3_get_cipher(unsigned int u)
3710 {
3711 if (u < SSL3_NUM_CIPHERS)
3712 return (&(ssl3_ciphers[SSL3_NUM_CIPHERS - 1 - u]));
3713 else
3714 return (NULL);
3715 }
3716
3717 int ssl3_set_handshake_header(SSL *s, int htype, unsigned long len)
3718 {
3719 unsigned char *p = (unsigned char *)s->init_buf->data;
3720 *(p++) = htype;
3721 l2n3(len, p);
3722 s->init_num = (int)len + SSL3_HM_HEADER_LENGTH;
3723 s->init_off = 0;
3724
3725 return 1;
3726 }
3727
3728 int ssl3_handshake_write(SSL *s)
3729 {
3730 return ssl3_do_write(s, SSL3_RT_HANDSHAKE);
3731 }
3732
3733 int ssl3_new(SSL *s)
3734 {
3735 SSL3_STATE *s3;
3736
3737 if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
3738 goto err;
3739 s->s3 = s3;
3740
3741 #ifndef OPENSSL_NO_SRP
3742 if (!SSL_SRP_CTX_init(s))
3743 goto err;
3744 #endif
3745 s->method->ssl_clear(s);
3746 return (1);
3747 err:
3748 return (0);
3749 }
3750
3751 void ssl3_free(SSL *s)
3752 {
3753 if (s == NULL || s->s3 == NULL)
3754 return;
3755
3756 ssl3_cleanup_key_block(s);
3757
3758 #ifndef OPENSSL_NO_DH
3759 DH_free(s->s3->tmp.dh);
3760 DH_free(s->s3->peer_dh_tmp);
3761 #endif
3762 #ifndef OPENSSL_NO_EC
3763 EVP_PKEY_free(s->s3->tmp.pkey);
3764 s->s3->tmp.pkey = NULL;
3765 EVP_PKEY_free(s->s3->peer_tmp);
3766 s->s3->peer_tmp = NULL;
3767 #endif
3768
3769 sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free);
3770 OPENSSL_free(s->s3->tmp.ciphers_raw);
3771 OPENSSL_clear_free(s->s3->tmp.pms, s->s3->tmp.pmslen);
3772 OPENSSL_free(s->s3->tmp.peer_sigalgs);
3773 ssl3_free_digest_list(s);
3774 OPENSSL_free(s->s3->alpn_selected);
3775
3776 #ifndef OPENSSL_NO_SRP
3777 SSL_SRP_CTX_free(s);
3778 #endif
3779 OPENSSL_clear_free(s->s3, sizeof(*s->s3));
3780 s->s3 = NULL;
3781 }
3782
3783 void ssl3_clear(SSL *s)
3784 {
3785 int init_extra;
3786
3787 ssl3_cleanup_key_block(s);
3788 sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free);
3789 OPENSSL_free(s->s3->tmp.ciphers_raw);
3790 s->s3->tmp.ciphers_raw = NULL;
3791 OPENSSL_clear_free(s->s3->tmp.pms, s->s3->tmp.pmslen);
3792 s->s3->tmp.pms = NULL;
3793 OPENSSL_free(s->s3->tmp.peer_sigalgs);
3794 s->s3->tmp.peer_sigalgs = NULL;
3795
3796 #ifndef OPENSSL_NO_DH
3797 DH_free(s->s3->tmp.dh);
3798 s->s3->tmp.dh = NULL;
3799 DH_free(s->s3->peer_dh_tmp);
3800 s->s3->peer_dh_tmp = NULL;
3801 #endif
3802 #ifndef OPENSSL_NO_EC
3803 EVP_PKEY_free(s->s3->tmp.pkey);
3804 s->s3->tmp.pkey = NULL;
3805 EVP_PKEY_free(s->s3->peer_tmp);
3806 s->s3->peer_tmp = NULL;
3807 s->s3->is_probably_safari = 0;
3808 #endif /* !OPENSSL_NO_EC */
3809
3810 init_extra = s->s3->init_extra;
3811 ssl3_free_digest_list(s);
3812
3813 if (s->s3->alpn_selected) {
3814 OPENSSL_free(s->s3->alpn_selected);
3815 s->s3->alpn_selected = NULL;
3816 }
3817
3818 memset(s->s3, 0, sizeof(*s->s3));
3819 s->s3->init_extra = init_extra;
3820
3821 ssl_free_wbio_buffer(s);
3822
3823 s->s3->renegotiate = 0;
3824 s->s3->total_renegotiations = 0;
3825 s->s3->num_renegotiations = 0;
3826 s->s3->in_read_app_data = 0;
3827 s->version = SSL3_VERSION;
3828
3829 #if !defined(OPENSSL_NO_NEXTPROTONEG)
3830 OPENSSL_free(s->next_proto_negotiated);
3831 s->next_proto_negotiated = NULL;
3832 s->next_proto_negotiated_len = 0;
3833 #endif
3834 }
3835
3836 #ifndef OPENSSL_NO_SRP
3837 static char *srp_password_from_info_cb(SSL *s, void *arg)
3838 {
3839 return OPENSSL_strdup(s->srp_ctx.info);
3840 }
3841 #endif
3842
3843 static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p,
3844 size_t len);
3845
3846 long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
3847 {
3848 int ret = 0;
3849
3850 switch (cmd) {
3851 case SSL_CTRL_GET_SESSION_REUSED:
3852 ret = s->hit;
3853 break;
3854 case SSL_CTRL_GET_CLIENT_CERT_REQUEST:
3855 break;
3856 case SSL_CTRL_GET_NUM_RENEGOTIATIONS:
3857 ret = s->s3->num_renegotiations;
3858 break;
3859 case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS:
3860 ret = s->s3->num_renegotiations;
3861 s->s3->num_renegotiations = 0;
3862 break;
3863 case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS:
3864 ret = s->s3->total_renegotiations;
3865 break;
3866 case SSL_CTRL_GET_FLAGS:
3867 ret = (int)(s->s3->flags);
3868 break;
3869 #ifndef OPENSSL_NO_DH
3870 case SSL_CTRL_SET_TMP_DH:
3871 {
3872 DH *dh = (DH *)parg;
3873 if (dh == NULL) {
3874 SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3875 return (ret);
3876 }
3877 if (!ssl_security(s, SSL_SECOP_TMP_DH,
3878 DH_security_bits(dh), 0, dh)) {
3879 SSLerr(SSL_F_SSL3_CTRL, SSL_R_DH_KEY_TOO_SMALL);
3880 return (ret);
3881 }
3882 if ((dh = DHparams_dup(dh)) == NULL) {
3883 SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
3884 return (ret);
3885 }
3886 if (!(s->options & SSL_OP_SINGLE_DH_USE)) {
3887 if (!DH_generate_key(dh)) {
3888 DH_free(dh);
3889 SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
3890 return (ret);
3891 }
3892 }
3893 DH_free(s->cert->dh_tmp);
3894 s->cert->dh_tmp = dh;
3895 ret = 1;
3896 }
3897 break;
3898 case SSL_CTRL_SET_TMP_DH_CB:
3899 {
3900 SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
3901 return (ret);
3902 }
3903 case SSL_CTRL_SET_DH_AUTO:
3904 s->cert->dh_tmp_auto = larg;
3905 return 1;
3906 #endif
3907 #ifndef OPENSSL_NO_EC
3908 case SSL_CTRL_SET_TMP_ECDH:
3909 {
3910 const EC_GROUP *group = NULL;
3911 int nid;
3912
3913 if (parg == NULL) {
3914 SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3915 return 0;
3916 }
3917 group = EC_KEY_get0_group((const EC_KEY *)parg);
3918 if (group == NULL) {
3919 SSLerr(SSL_F_SSL3_CTRL, EC_R_MISSING_PARAMETERS);
3920 return 0;
3921 }
3922 nid = EC_GROUP_get_curve_name(group);
3923 if (nid == NID_undef)
3924 return 0;
3925 return tls1_set_curves(&s->tlsext_ellipticcurvelist,
3926 &s->tlsext_ellipticcurvelist_length,
3927 &nid, 1);
3928 }
3929 break;
3930 #endif /* !OPENSSL_NO_EC */
3931 case SSL_CTRL_SET_TLSEXT_HOSTNAME:
3932 if (larg == TLSEXT_NAMETYPE_host_name) {
3933 OPENSSL_free(s->tlsext_hostname);
3934 s->tlsext_hostname = NULL;
3935
3936 ret = 1;
3937 if (parg == NULL)
3938 break;
3939 if (strlen((char *)parg) > TLSEXT_MAXLEN_host_name) {
3940 SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME);
3941 return 0;
3942 }
3943 if ((s->tlsext_hostname = OPENSSL_strdup((char *)parg)) == NULL) {
3944 SSLerr(SSL_F_SSL3_CTRL, ERR_R_INTERNAL_ERROR);
3945 return 0;
3946 }
3947 } else {
3948 SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE);
3949 return 0;
3950 }
3951 break;
3952 case SSL_CTRL_SET_TLSEXT_DEBUG_ARG:
3953 s->tlsext_debug_arg = parg;
3954 ret = 1;
3955 break;
3956
3957 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
3958 s->tlsext_status_type = larg;
3959 ret = 1;
3960 break;
3961
3962 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS:
3963 *(STACK_OF(X509_EXTENSION) **)parg = s->tlsext_ocsp_exts;
3964 ret = 1;
3965 break;
3966
3967 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS:
3968 s->tlsext_ocsp_exts = parg;
3969 ret = 1;
3970 break;
3971
3972 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS:
3973 *(STACK_OF(OCSP_RESPID) **)parg = s->tlsext_ocsp_ids;
3974 ret = 1;
3975 break;
3976
3977 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS:
3978 s->tlsext_ocsp_ids = parg;
3979 ret = 1;
3980 break;
3981
3982 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP:
3983 *(unsigned char **)parg = s->tlsext_ocsp_resp;
3984 return s->tlsext_ocsp_resplen;
3985
3986 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
3987 OPENSSL_free(s->tlsext_ocsp_resp);
3988 s->tlsext_ocsp_resp = parg;
3989 s->tlsext_ocsp_resplen = larg;
3990 ret = 1;
3991 break;
3992
3993 #ifndef OPENSSL_NO_HEARTBEATS
3994 case SSL_CTRL_TLS_EXT_SEND_HEARTBEAT:
3995 if (SSL_IS_DTLS(s))
3996 ret = dtls1_heartbeat(s);
3997 else
3998 ret = tls1_heartbeat(s);
3999 break;
4000
4001 case SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING:
4002 ret = s->tlsext_hb_pending;
4003 break;
4004
4005 case SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS:
4006 if (larg)
4007 s->tlsext_heartbeat |= SSL_TLSEXT_HB_DONT_RECV_REQUESTS;
4008 else
4009 s->tlsext_heartbeat &= ~SSL_TLSEXT_HB_DONT_RECV_REQUESTS;
4010 ret = 1;
4011 break;
4012 #endif
4013
4014 case SSL_CTRL_CHAIN:
4015 if (larg)
4016 return ssl_cert_set1_chain(s, NULL, (STACK_OF(X509) *)parg);
4017 else
4018 return ssl_cert_set0_chain(s, NULL, (STACK_OF(X509) *)parg);
4019
4020 case SSL_CTRL_CHAIN_CERT:
4021 if (larg)
4022 return ssl_cert_add1_chain_cert(s, NULL, (X509 *)parg);
4023 else
4024 return ssl_cert_add0_chain_cert(s, NULL, (X509 *)parg);
4025
4026 case SSL_CTRL_GET_CHAIN_CERTS:
4027 *(STACK_OF(X509) **)parg = s->cert->key->chain;
4028 break;
4029
4030 case SSL_CTRL_SELECT_CURRENT_CERT:
4031 return ssl_cert_select_current(s->cert, (X509 *)parg);
4032
4033 case SSL_CTRL_SET_CURRENT_CERT:
4034 if (larg == SSL_CERT_SET_SERVER) {
4035 CERT_PKEY *cpk;
4036 const SSL_CIPHER *cipher;
4037 if (!s->server)
4038 return 0;
4039 cipher = s->s3->tmp.new_cipher;
4040 if (!cipher)
4041 return 0;
4042 /*
4043 * No certificate for unauthenticated ciphersuites or using SRP
4044 * authentication
4045 */
4046 if (cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP))
4047 return 2;
4048 cpk = ssl_get_server_send_pkey(s);
4049 if (!cpk)
4050 return 0;
4051 s->cert->key = cpk;
4052 return 1;
4053 }
4054 return ssl_cert_set_current(s->cert, larg);
4055
4056 #ifndef OPENSSL_NO_EC
4057 case SSL_CTRL_GET_CURVES:
4058 {
4059 unsigned char *clist;
4060 size_t clistlen;
4061 if (!s->session)
4062 return 0;
4063 clist = s->session->tlsext_ellipticcurvelist;
4064 clistlen = s->session->tlsext_ellipticcurvelist_length / 2;
4065 if (parg) {
4066 size_t i;
4067 int *cptr = parg;
4068 unsigned int cid, nid;
4069 for (i = 0; i < clistlen; i++) {
4070 n2s(clist, cid);
4071 nid = tls1_ec_curve_id2nid(cid);
4072 if (nid != 0)
4073 cptr[i] = nid;
4074 else
4075 cptr[i] = TLSEXT_nid_unknown | cid;
4076 }
4077 }
4078 return (int)clistlen;
4079 }
4080
4081 case SSL_CTRL_SET_CURVES:
4082 return tls1_set_curves(&s->tlsext_ellipticcurvelist,
4083 &s->tlsext_ellipticcurvelist_length,
4084 parg, larg);
4085
4086 case SSL_CTRL_SET_CURVES_LIST:
4087 return tls1_set_curves_list(&s->tlsext_ellipticcurvelist,
4088 &s->tlsext_ellipticcurvelist_length,
4089 parg);
4090
4091 case SSL_CTRL_GET_SHARED_CURVE:
4092 return tls1_shared_curve(s, larg);
4093
4094 #endif
4095 case SSL_CTRL_SET_SIGALGS:
4096 return tls1_set_sigalgs(s->cert, parg, larg, 0);
4097
4098 case SSL_CTRL_SET_SIGALGS_LIST:
4099 return tls1_set_sigalgs_list(s->cert, parg, 0);
4100
4101 case SSL_CTRL_SET_CLIENT_SIGALGS:
4102 return tls1_set_sigalgs(s->cert, parg, larg, 1);
4103
4104 case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
4105 return tls1_set_sigalgs_list(s->cert, parg, 1);
4106
4107 case SSL_CTRL_GET_CLIENT_CERT_TYPES:
4108 {
4109 const unsigned char **pctype = parg;
4110 if (s->server || !s->s3->tmp.cert_req)
4111 return 0;
4112 if (s->cert->ctypes) {
4113 if (pctype)
4114 *pctype = s->cert->ctypes;
4115 return (int)s->cert->ctype_num;
4116 }
4117 if (pctype)
4118 *pctype = (unsigned char *)s->s3->tmp.ctype;
4119 return s->s3->tmp.ctype_num;
4120 }
4121
4122 case SSL_CTRL_SET_CLIENT_CERT_TYPES:
4123 if (!s->server)
4124 return 0;
4125 return ssl3_set_req_cert_type(s->cert, parg, larg);
4126
4127 case SSL_CTRL_BUILD_CERT_CHAIN:
4128 return ssl_build_cert_chain(s, NULL, larg);
4129
4130 case SSL_CTRL_SET_VERIFY_CERT_STORE:
4131 return ssl_cert_set_cert_store(s->cert, parg, 0, larg);
4132
4133 case SSL_CTRL_SET_CHAIN_CERT_STORE:
4134 return ssl_cert_set_cert_store(s->cert, parg, 1, larg);
4135
4136 case SSL_CTRL_GET_PEER_SIGNATURE_NID:
4137 if (SSL_USE_SIGALGS(s)) {
4138 if (s->session) {
4139 const EVP_MD *sig;
4140 sig = s->s3->tmp.peer_md;
4141 if (sig) {
4142 *(int *)parg = EVP_MD_type(sig);
4143 return 1;
4144 }
4145 }
4146 return 0;
4147 }
4148 /* Might want to do something here for other versions */
4149 else
4150 return 0;
4151
4152 case SSL_CTRL_GET_SERVER_TMP_KEY:
4153 if (s->server || !s->session)
4154 return 0;
4155 else {
4156 EVP_PKEY *ptmp;
4157 int rv = 0;
4158 #if !defined(OPENSSL_NO_DH) && !defined(OPENSSL_NO_EC)
4159 if (s->s3->peer_dh_tmp == NULL && s->s3->peer_tmp == NULL)
4160 return 0;
4161 #endif
4162 ptmp = EVP_PKEY_new();
4163 if (ptmp == NULL)
4164 return 0;
4165 #ifndef OPENSSL_NO_DH
4166 else if (s->s3->peer_dh_tmp != NULL)
4167 rv = EVP_PKEY_set1_DH(ptmp, s->s3->peer_dh_tmp);
4168 #endif
4169 #ifndef OPENSSL_NO_EC
4170 else if (s->s3->peer_tmp != NULL)
4171 rv = EVP_PKEY_set1_EC_KEY(ptmp,
4172 EVP_PKEY_get0_EC_KEY(s->s3->peer_tmp));
4173 #endif
4174 if (rv) {
4175 *(EVP_PKEY **)parg = ptmp;
4176 return 1;
4177 }
4178 EVP_PKEY_free(ptmp);
4179 return 0;
4180 }
4181 #ifndef OPENSSL_NO_EC
4182 case SSL_CTRL_GET_EC_POINT_FORMATS:
4183 {
4184 SSL_SESSION *sess = s->session;
4185 const unsigned char **pformat = parg;
4186 if (!sess || !sess->tlsext_ecpointformatlist)
4187 return 0;
4188 *pformat = sess->tlsext_ecpointformatlist;
4189 return (int)sess->tlsext_ecpointformatlist_length;
4190 }
4191 #endif
4192
4193 case SSL_CTRL_CHECK_PROTO_VERSION:
4194 /*
4195 * For library-internal use; checks that the current protocol is the
4196 * highest enabled version (according to s->ctx->method, as version
4197 * negotiation may have changed s->method).
4198 */
4199 if (s->version == s->ctx->method->version)
4200 return 1;
4201 /*
4202 * Apparently we're using a version-flexible SSL_METHOD (not at its
4203 * highest protocol version).
4204 */
4205 if (s->ctx->method->version == TLS_method()->version) {
4206 #if TLS_MAX_VERSION != TLS1_2_VERSION
4207 # error Code needs update for TLS_method() support beyond TLS1_2_VERSION.
4208 #endif
4209 if (!(s->options & SSL_OP_NO_TLSv1_2))
4210 return s->version == TLS1_2_VERSION;
4211 if (!(s->options & SSL_OP_NO_TLSv1_1))
4212 return s->version == TLS1_1_VERSION;
4213 if (!(s->options & SSL_OP_NO_TLSv1))
4214 return s->version == TLS1_VERSION;
4215 if (!(s->options & SSL_OP_NO_SSLv3))
4216 return s->version == SSL3_VERSION;
4217 }
4218 return 0; /* Unexpected state; fail closed. */
4219
4220 default:
4221 break;
4222 }
4223 return (ret);
4224 }
4225
4226 long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp) (void))
4227 {
4228 int ret = 0;
4229
4230 switch (cmd) {
4231 #ifndef OPENSSL_NO_DH
4232 case SSL_CTRL_SET_TMP_DH_CB:
4233 {
4234 s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
4235 }
4236 break;
4237 #endif
4238 case SSL_CTRL_SET_TLSEXT_DEBUG_CB:
4239 s->tlsext_debug_cb = (void (*)(SSL *, int, int,
4240 unsigned char *, int, void *))fp;
4241 break;
4242
4243 case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
4244 {
4245 s->not_resumable_session_cb = (int (*)(SSL *, int))fp;
4246 }
4247 break;
4248 default:
4249 break;
4250 }
4251 return (ret);
4252 }
4253
4254 long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
4255 {
4256 switch (cmd) {
4257 #ifndef OPENSSL_NO_DH
4258 case SSL_CTRL_SET_TMP_DH:
4259 {
4260 DH *new = NULL, *dh;
4261 CERT *cert;
4262
4263 cert = ctx->cert;
4264 dh = (DH *)parg;
4265 if (!ssl_ctx_security(ctx, SSL_SECOP_TMP_DH,
4266 DH_security_bits(dh), 0, dh)) {
4267 SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_DH_KEY_TOO_SMALL);
4268 return 0;
4269 }
4270 if ((new = DHparams_dup(dh)) == NULL) {
4271 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB);
4272 return 0;
4273 }
4274 if (!(ctx->options & SSL_OP_SINGLE_DH_USE)) {
4275 if (!DH_generate_key(new)) {
4276 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB);
4277 DH_free(new);
4278 return 0;
4279 }
4280 }
4281 DH_free(cert->dh_tmp);
4282 cert->dh_tmp = new;
4283 return 1;
4284 }
4285 /*
4286 * break;
4287 */
4288 case SSL_CTRL_SET_TMP_DH_CB:
4289 {
4290 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
4291 return (0);
4292 }
4293 case SSL_CTRL_SET_DH_AUTO:
4294 ctx->cert->dh_tmp_auto = larg;
4295 return 1;
4296 #endif
4297 #ifndef OPENSSL_NO_EC
4298 case SSL_CTRL_SET_TMP_ECDH:
4299 {
4300 const EC_GROUP *group = NULL;
4301 int nid;
4302
4303 if (parg == NULL) {
4304 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_PASSED_NULL_PARAMETER);
4305 return 0;
4306 }
4307 group = EC_KEY_get0_group((const EC_KEY *)parg);
4308 if (group == NULL) {
4309 SSLerr(SSL_F_SSL3_CTX_CTRL, EC_R_MISSING_PARAMETERS);
4310 return 0;
4311 }
4312 nid = EC_GROUP_get_curve_name(group);
4313 if (nid == NID_undef)
4314 return 0;
4315 return tls1_set_curves(&ctx->tlsext_ellipticcurvelist,
4316 &ctx->tlsext_ellipticcurvelist_length,
4317 &nid, 1);
4318 }
4319 /* break; */
4320 #endif /* !OPENSSL_NO_EC */
4321 case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG:
4322 ctx->tlsext_servername_arg = parg;
4323 break;
4324 case SSL_CTRL_SET_TLSEXT_TICKET_KEYS:
4325 case SSL_CTRL_GET_TLSEXT_TICKET_KEYS:
4326 {
4327 unsigned char *keys = parg;
4328 if (!keys)
4329 return 48;
4330 if (larg != 48) {
4331 SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_TICKET_KEYS_LENGTH);
4332 return 0;
4333 }
4334 if (cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEYS) {
4335 memcpy(ctx->tlsext_tick_key_name, keys, 16);
4336 memcpy(ctx->tlsext_tick_hmac_key, keys + 16, 16);
4337 memcpy(ctx->tlsext_tick_aes_key, keys + 32, 16);
4338 } else {
4339 memcpy(keys, ctx->tlsext_tick_key_name, 16);
4340 memcpy(keys + 16, ctx->tlsext_tick_hmac_key, 16);
4341 memcpy(keys + 32, ctx->tlsext_tick_aes_key, 16);
4342 }
4343 return 1;
4344 }
4345
4346 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
4347 ctx->tlsext_status_arg = parg;
4348 return 1;
4349
4350 #ifndef OPENSSL_NO_SRP
4351 case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
4352 ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4353 OPENSSL_free(ctx->srp_ctx.login);
4354 ctx->srp_ctx.login = NULL;
4355 if (parg == NULL)
4356 break;
4357 if (strlen((const char *)parg) > 255
4358 || strlen((const char *)parg) < 1) {
4359 SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_SRP_USERNAME);
4360 return 0;
4361 }
4362 if ((ctx->srp_ctx.login = OPENSSL_strdup((char *)parg)) == NULL) {
4363 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_INTERNAL_ERROR);
4364 return 0;
4365 }
4366 break;
4367 case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD:
4368 ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
4369 srp_password_from_info_cb;
4370 ctx->srp_ctx.info = parg;
4371 break;
4372 case SSL_CTRL_SET_SRP_ARG:
4373 ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4374 ctx->srp_ctx.SRP_cb_arg = parg;
4375 break;
4376
4377 case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH:
4378 ctx->srp_ctx.strength = larg;
4379 break;
4380 #endif
4381
4382 #ifndef OPENSSL_NO_EC
4383 case SSL_CTRL_SET_CURVES:
4384 return tls1_set_curves(&ctx->tlsext_ellipticcurvelist,
4385 &ctx->tlsext_ellipticcurvelist_length,
4386 parg, larg);
4387
4388 case SSL_CTRL_SET_CURVES_LIST:
4389 return tls1_set_curves_list(&ctx->tlsext_ellipticcurvelist,
4390 &ctx->tlsext_ellipticcurvelist_length,
4391 parg);
4392 #endif
4393 case SSL_CTRL_SET_SIGALGS:
4394 return tls1_set_sigalgs(ctx->cert, parg, larg, 0);
4395
4396 case SSL_CTRL_SET_SIGALGS_LIST:
4397 return tls1_set_sigalgs_list(ctx->cert, parg, 0);
4398
4399 case SSL_CTRL_SET_CLIENT_SIGALGS:
4400 return tls1_set_sigalgs(ctx->cert, parg, larg, 1);
4401
4402 case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
4403 return tls1_set_sigalgs_list(ctx->cert, parg, 1);
4404
4405 case SSL_CTRL_SET_CLIENT_CERT_TYPES:
4406 return ssl3_set_req_cert_type(ctx->cert, parg, larg);
4407
4408 case SSL_CTRL_BUILD_CERT_CHAIN:
4409 return ssl_build_cert_chain(NULL, ctx, larg);
4410
4411 case SSL_CTRL_SET_VERIFY_CERT_STORE:
4412 return ssl_cert_set_cert_store(ctx->cert, parg, 0, larg);
4413
4414 case SSL_CTRL_SET_CHAIN_CERT_STORE:
4415 return ssl_cert_set_cert_store(ctx->cert, parg, 1, larg);
4416
4417 /* A Thawte special :-) */
4418 case SSL_CTRL_EXTRA_CHAIN_CERT:
4419 if (ctx->extra_certs == NULL) {
4420 if ((ctx->extra_certs = sk_X509_new_null()) == NULL)
4421 return (0);
4422 }
4423 sk_X509_push(ctx->extra_certs, (X509 *)parg);
4424 break;
4425
4426 case SSL_CTRL_GET_EXTRA_CHAIN_CERTS:
4427 if (ctx->extra_certs == NULL && larg == 0)
4428 *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
4429 else
4430 *(STACK_OF(X509) **)parg = ctx->extra_certs;
4431 break;
4432
4433 case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS:
4434 sk_X509_pop_free(ctx->extra_certs, X509_free);
4435 ctx->extra_certs = NULL;
4436 break;
4437
4438 case SSL_CTRL_CHAIN:
4439 if (larg)
4440 return ssl_cert_set1_chain(NULL, ctx, (STACK_OF(X509) *)parg);
4441 else
4442 return ssl_cert_set0_chain(NULL, ctx, (STACK_OF(X509) *)parg);
4443
4444 case SSL_CTRL_CHAIN_CERT:
4445 if (larg)
4446 return ssl_cert_add1_chain_cert(NULL, ctx, (X509 *)parg);
4447 else
4448 return ssl_cert_add0_chain_cert(NULL, ctx, (X509 *)parg);
4449
4450 case SSL_CTRL_GET_CHAIN_CERTS:
4451 *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
4452 break;
4453
4454 case SSL_CTRL_SELECT_CURRENT_CERT:
4455 return ssl_cert_select_current(ctx->cert, (X509 *)parg);
4456
4457 case SSL_CTRL_SET_CURRENT_CERT:
4458 return ssl_cert_set_current(ctx->cert, larg);
4459
4460 default:
4461 return (0);
4462 }
4463 return (1);
4464 }
4465
4466 long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp) (void))
4467 {
4468 switch (cmd) {
4469 #ifndef OPENSSL_NO_DH
4470 case SSL_CTRL_SET_TMP_DH_CB:
4471 {
4472 ctx->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
4473 }
4474 break;
4475 #endif
4476 case SSL_CTRL_SET_TLSEXT_SERVERNAME_CB:
4477 ctx->tlsext_servername_callback = (int (*)(SSL *, int *, void *))fp;
4478 break;
4479
4480 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB:
4481 ctx->tlsext_status_cb = (int (*)(SSL *, void *))fp;
4482 break;
4483
4484 case SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB:
4485 ctx->tlsext_ticket_key_cb = (int (*)(SSL *, unsigned char *,
4486 unsigned char *,
4487 EVP_CIPHER_CTX *,
4488 HMAC_CTX *, int))fp;
4489 break;
4490
4491 #ifndef OPENSSL_NO_SRP
4492 case SSL_CTRL_SET_SRP_VERIFY_PARAM_CB:
4493 ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4494 ctx->srp_ctx.SRP_verify_param_callback = (int (*)(SSL *, void *))fp;
4495 break;
4496 case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB:
4497 ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4498 ctx->srp_ctx.TLS_ext_srp_username_callback =
4499 (int (*)(SSL *, int *, void *))fp;
4500 break;
4501 case SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB:
4502 ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4503 ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
4504 (char *(*)(SSL *, void *))fp;
4505 break;
4506 #endif
4507 case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
4508 {
4509 ctx->not_resumable_session_cb = (int (*)(SSL *, int))fp;
4510 }
4511 break;
4512 default:
4513 return (0);
4514 }
4515 return (1);
4516 }
4517
4518 /*
4519 * This function needs to check if the ciphers required are actually
4520 * available
4521 */
4522 const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p)
4523 {
4524 SSL_CIPHER c;
4525 const SSL_CIPHER *cp;
4526 uint32_t id;
4527
4528 id = 0x03000000 | ((uint32_t)p[0] << 8L) | (uint32_t)p[1];
4529 c.id = id;
4530 cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS);
4531 #ifdef DEBUG_PRINT_UNKNOWN_CIPHERSUITES
4532 if (cp == NULL)
4533 fprintf(stderr, "Unknown cipher ID %x\n", (p[0] << 8) | p[1]);
4534 #endif
4535 return cp;
4536 }
4537
4538 int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
4539 {
4540 long l;
4541
4542 if (p != NULL) {
4543 l = c->id;
4544 if ((l & 0xff000000) != 0x03000000)
4545 return (0);
4546 p[0] = ((unsigned char)(l >> 8L)) & 0xFF;
4547 p[1] = ((unsigned char)(l)) & 0xFF;
4548 }
4549 return (2);
4550 }
4551
4552 SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
4553 STACK_OF(SSL_CIPHER) *srvr)
4554 {
4555 SSL_CIPHER *c, *ret = NULL;
4556 STACK_OF(SSL_CIPHER) *prio, *allow;
4557 int i, ii, ok;
4558 unsigned long alg_k, alg_a, mask_k, mask_a;
4559
4560 /* Let's see which ciphers we can support */
4561
4562 #if 0
4563 /*
4564 * Do not set the compare functions, because this may lead to a
4565 * reordering by "id". We want to keep the original ordering. We may pay
4566 * a price in performance during sk_SSL_CIPHER_find(), but would have to
4567 * pay with the price of sk_SSL_CIPHER_dup().
4568 */
4569 sk_SSL_CIPHER_set_cmp_func(srvr, ssl_cipher_ptr_id_cmp);
4570 sk_SSL_CIPHER_set_cmp_func(clnt, ssl_cipher_ptr_id_cmp);
4571 #endif
4572
4573 #ifdef CIPHER_DEBUG
4574 fprintf(stderr, "Server has %d from %p:\n", sk_SSL_CIPHER_num(srvr),
4575 (void *)srvr);
4576 for (i = 0; i < sk_SSL_CIPHER_num(srvr); ++i) {
4577 c = sk_SSL_CIPHER_value(srvr, i);
4578 fprintf(stderr, "%p:%s\n", (void *)c, c->name);
4579 }
4580 fprintf(stderr, "Client sent %d from %p:\n", sk_SSL_CIPHER_num(clnt),
4581 (void *)clnt);
4582 for (i = 0; i < sk_SSL_CIPHER_num(clnt); ++i) {
4583 c = sk_SSL_CIPHER_value(clnt, i);
4584 fprintf(stderr, "%p:%s\n", (void *)c, c->name);
4585 }
4586 #endif
4587
4588 if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE || tls1_suiteb(s)) {
4589 prio = srvr;
4590 allow = clnt;
4591 } else {
4592 prio = clnt;
4593 allow = srvr;
4594 }
4595
4596 tls1_set_cert_validity(s);
4597
4598 for (i = 0; i < sk_SSL_CIPHER_num(prio); i++) {
4599 c = sk_SSL_CIPHER_value(prio, i);
4600
4601 /* Skip TLS v1.2 only ciphersuites if not supported */
4602 if ((c->algorithm_ssl & SSL_TLSV1_2) && !SSL_USE_TLS1_2_CIPHERS(s))
4603 continue;
4604 /* Skip TLS v1.0 ciphersuites if SSLv3 */
4605 if ((c->algorithm_ssl & SSL_TLSV1) && s->version == SSL3_VERSION)
4606 continue;
4607
4608 ssl_set_masks(s, c);
4609 mask_k = s->s3->tmp.mask_k;
4610 mask_a = s->s3->tmp.mask_a;
4611 #ifndef OPENSSL_NO_SRP
4612 if (s->srp_ctx.srp_Mask & SSL_kSRP) {
4613 mask_k |= SSL_kSRP;
4614 mask_a |= SSL_aSRP;
4615 }
4616 #endif
4617
4618 alg_k = c->algorithm_mkey;
4619 alg_a = c->algorithm_auth;
4620
4621 #ifndef OPENSSL_NO_PSK
4622 /* with PSK there must be server callback set */
4623 if ((alg_k & SSL_PSK) && s->psk_server_callback == NULL)
4624 continue;
4625 #endif /* OPENSSL_NO_PSK */
4626
4627 ok = (alg_k & mask_k) && (alg_a & mask_a);
4628 #ifdef CIPHER_DEBUG
4629 fprintf(stderr, "%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n", ok, alg_k,
4630 alg_a, mask_k, mask_a, (void *)c, c->name);
4631 #endif
4632
4633 # ifndef OPENSSL_NO_EC
4634 /*
4635 * if we are considering an ECC cipher suite that uses an ephemeral
4636 * EC key check it
4637 */
4638 if (alg_k & SSL_kECDHE)
4639 ok = ok && tls1_check_ec_tmp_key(s, c->id);
4640 # endif /* OPENSSL_NO_EC */
4641
4642 if (!ok)
4643 continue;
4644 ii = sk_SSL_CIPHER_find(allow, c);
4645 if (ii >= 0) {
4646 /* Check security callback permits this cipher */
4647 if (!ssl_security(s, SSL_SECOP_CIPHER_SHARED,
4648 c->strength_bits, 0, c))
4649 continue;
4650 #if !defined(OPENSSL_NO_EC)
4651 if ((alg_k & SSL_kECDHE) && (alg_a & SSL_aECDSA)
4652 && s->s3->is_probably_safari) {
4653 if (!ret)
4654 ret = sk_SSL_CIPHER_value(allow, ii);
4655 continue;
4656 }
4657 #endif
4658 ret = sk_SSL_CIPHER_value(allow, ii);
4659 break;
4660 }
4661 }
4662 return (ret);
4663 }
4664
4665 int ssl3_get_req_cert_type(SSL *s, unsigned char *p)
4666 {
4667 int ret = 0;
4668 int nostrict = 1;
4669 uint32_t alg_k, alg_a = 0;
4670
4671 /* If we have custom certificate types set, use them */
4672 if (s->cert->ctypes) {
4673 memcpy(p, s->cert->ctypes, s->cert->ctype_num);
4674 return (int)s->cert->ctype_num;
4675 }
4676 /* Get mask of algorithms disabled by signature list */
4677 ssl_set_sig_mask(&alg_a, s, SSL_SECOP_SIGALG_MASK);
4678 if (s->cert->cert_flags & SSL_CERT_FLAGS_CHECK_TLS_STRICT)
4679 nostrict = 0;
4680
4681 alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
4682
4683 #ifndef OPENSSL_NO_GOST
4684 if (s->version >= TLS1_VERSION) {
4685 if (alg_k & SSL_kGOST) {
4686 p[ret++] = TLS_CT_GOST01_SIGN;
4687 p[ret++] = TLS_CT_GOST12_SIGN;
4688 p[ret++] = TLS_CT_GOST12_512_SIGN;
4689 return (ret);
4690 }
4691 }
4692 #endif
4693
4694 #ifndef OPENSSL_NO_DH
4695 if (alg_k & (SSL_kDHr | SSL_kDHE)) {
4696 # ifndef OPENSSL_NO_RSA
4697 /*
4698 * Since this refers to a certificate signed with an RSA algorithm,
4699 * only check for rsa signing in strict mode.
4700 */
4701 if (nostrict || !(alg_a & SSL_aRSA))
4702 p[ret++] = SSL3_CT_RSA_FIXED_DH;
4703 # endif
4704 # ifndef OPENSSL_NO_DSA
4705 if (nostrict || !(alg_a & SSL_aDSS))
4706 p[ret++] = SSL3_CT_DSS_FIXED_DH;
4707 # endif
4708 }
4709 if ((s->version == SSL3_VERSION) &&
4710 (alg_k & (SSL_kDHE | SSL_kDHd | SSL_kDHr))) {
4711 # ifndef OPENSSL_NO_RSA
4712 p[ret++] = SSL3_CT_RSA_EPHEMERAL_DH;
4713 # endif
4714 # ifndef OPENSSL_NO_DSA
4715 p[ret++] = SSL3_CT_DSS_EPHEMERAL_DH;
4716 # endif
4717 }
4718 #endif /* !OPENSSL_NO_DH */
4719 #ifndef OPENSSL_NO_RSA
4720 if (!(alg_a & SSL_aRSA))
4721 p[ret++] = SSL3_CT_RSA_SIGN;
4722 #endif
4723 #ifndef OPENSSL_NO_DSA
4724 if (!(alg_a & SSL_aDSS))
4725 p[ret++] = SSL3_CT_DSS_SIGN;
4726 #endif
4727 #ifndef OPENSSL_NO_EC
4728 /*
4729 * ECDSA certs can be used with RSA cipher suites too so we don't
4730 * need to check for SSL_kECDH or SSL_kECDHE
4731 */
4732 if (s->version >= TLS1_VERSION) {
4733 if (!(alg_a & SSL_aECDSA))
4734 p[ret++] = TLS_CT_ECDSA_SIGN;
4735 }
4736 #endif
4737 return (ret);
4738 }
4739
4740 static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p, size_t len)
4741 {
4742 OPENSSL_free(c->ctypes);
4743 c->ctypes = NULL;
4744 if (!p || !len)
4745 return 1;
4746 if (len > 0xff)
4747 return 0;
4748 c->ctypes = OPENSSL_malloc(len);
4749 if (c->ctypes == NULL)
4750 return 0;
4751 memcpy(c->ctypes, p, len);
4752 c->ctype_num = len;
4753 return 1;
4754 }
4755
4756 int ssl3_shutdown(SSL *s)
4757 {
4758 int ret;
4759
4760 /*
4761 * Don't do anything much if we have not done the handshake or we don't
4762 * want to send messages :-)
4763 */
4764 if (s->quiet_shutdown || SSL_in_before(s)) {
4765 s->shutdown = (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
4766 return (1);
4767 }
4768
4769 if (!(s->shutdown & SSL_SENT_SHUTDOWN)) {
4770 s->shutdown |= SSL_SENT_SHUTDOWN;
4771 ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY);
4772 /*
4773 * our shutdown alert has been sent now, and if it still needs to be
4774 * written, s->s3->alert_dispatch will be true
4775 */
4776 if (s->s3->alert_dispatch)
4777 return (-1); /* return WANT_WRITE */
4778 } else if (s->s3->alert_dispatch) {
4779 /* resend it if not sent */
4780 ret = s->method->ssl_dispatch_alert(s);
4781 if (ret == -1) {
4782 /*
4783 * we only get to return -1 here the 2nd/Nth invocation, we must
4784 * have already signalled return 0 upon a previous invoation,
4785 * return WANT_WRITE
4786 */
4787 return (ret);
4788 }
4789 } else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) {
4790 /*
4791 * If we are waiting for a close from our peer, we are closed
4792 */
4793 s->method->ssl_read_bytes(s, 0, NULL, NULL, 0, 0);
4794 if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) {
4795 return (-1); /* return WANT_READ */
4796 }
4797 }
4798
4799 if ((s->shutdown == (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN)) &&
4800 !s->s3->alert_dispatch)
4801 return (1);
4802 else
4803 return (0);
4804 }
4805
4806 int ssl3_write(SSL *s, const void *buf, int len)
4807 {
4808 clear_sys_error();
4809 if (s->s3->renegotiate)
4810 ssl3_renegotiate_check(s);
4811
4812 return s->method->ssl_write_bytes(s, SSL3_RT_APPLICATION_DATA,
4813 buf, len);
4814 }
4815
4816 static int ssl3_read_internal(SSL *s, void *buf, int len, int peek)
4817 {
4818 int ret;
4819
4820 clear_sys_error();
4821 if (s->s3->renegotiate)
4822 ssl3_renegotiate_check(s);
4823 s->s3->in_read_app_data = 1;
4824 ret =
4825 s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf, len,
4826 peek);
4827 if ((ret == -1) && (s->s3->in_read_app_data == 2)) {
4828 /*
4829 * ssl3_read_bytes decided to call s->handshake_func, which called
4830 * ssl3_read_bytes to read handshake data. However, ssl3_read_bytes
4831 * actually found application data and thinks that application data
4832 * makes sense here; so disable handshake processing and try to read
4833 * application data again.
4834 */
4835 ossl_statem_set_in_handshake(s, 1);
4836 ret =
4837 s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf,
4838 len, peek);
4839 ossl_statem_set_in_handshake(s, 0);
4840 } else
4841 s->s3->in_read_app_data = 0;
4842
4843 return (ret);
4844 }
4845
4846 int ssl3_read(SSL *s, void *buf, int len)
4847 {
4848 return ssl3_read_internal(s, buf, len, 0);
4849 }
4850
4851 int ssl3_peek(SSL *s, void *buf, int len)
4852 {
4853 return ssl3_read_internal(s, buf, len, 1);
4854 }
4855
4856 int ssl3_renegotiate(SSL *s)
4857 {
4858 if (s->handshake_func == NULL)
4859 return (1);
4860
4861 if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)
4862 return (0);
4863
4864 s->s3->renegotiate = 1;
4865 return (1);
4866 }
4867
4868 int ssl3_renegotiate_check(SSL *s)
4869 {
4870 int ret = 0;
4871
4872 if (s->s3->renegotiate) {
4873 if (!RECORD_LAYER_read_pending(&s->rlayer)
4874 && !RECORD_LAYER_write_pending(&s->rlayer)
4875 && !SSL_in_init(s)) {
4876 /*
4877 * if we are the server, and we have sent a 'RENEGOTIATE'
4878 * message, we need to set the state machine into the renegotiate
4879 * state.
4880 */
4881 ossl_statem_set_renegotiate(s);
4882 s->s3->renegotiate = 0;
4883 s->s3->num_renegotiations++;
4884 s->s3->total_renegotiations++;
4885 ret = 1;
4886 }
4887 }
4888 return (ret);
4889 }
4890
4891 /*
4892 * If we are using default SHA1+MD5 algorithms switch to new SHA256 PRF and
4893 * handshake macs if required.
4894 *
4895 * If PSK and using SHA384 for TLS < 1.2 switch to default.
4896 */
4897 long ssl_get_algorithm2(SSL *s)
4898 {
4899 long alg2 = s->s3->tmp.new_cipher->algorithm2;
4900 if (s->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_SHA256_PRF) {
4901 if (alg2 == (SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF))
4902 return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256;
4903 } else if (s->s3->tmp.new_cipher->algorithm_mkey & SSL_PSK) {
4904 if (alg2 == (SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384))
4905 return SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF;
4906 }
4907 return alg2;
4908 }
4909
4910 /*
4911 * Fill a ClientRandom or ServerRandom field of length len. Returns <= 0 on
4912 * failure, 1 on success.
4913 */
4914 int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, int len)
4915 {
4916 int send_time = 0;
4917
4918 if (len < 4)
4919 return 0;
4920 if (server)
4921 send_time = (s->mode & SSL_MODE_SEND_SERVERHELLO_TIME) != 0;
4922 else
4923 send_time = (s->mode & SSL_MODE_SEND_CLIENTHELLO_TIME) != 0;
4924 if (send_time) {
4925 unsigned long Time = (unsigned long)time(NULL);
4926 unsigned char *p = result;
4927 l2n(Time, p);
4928 return RAND_bytes(p, len - 4);
4929 } else
4930 return RAND_bytes(result, len);
4931 }
4932
4933 int ssl_generate_master_secret(SSL *s, unsigned char *pms, size_t pmslen,
4934 int free_pms)
4935 {
4936 #ifndef OPENSSL_NO_PSK
4937 unsigned long alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
4938 if (alg_k & SSL_PSK) {
4939 unsigned char *pskpms, *t;
4940 size_t psklen = s->s3->tmp.psklen;
4941 size_t pskpmslen;
4942
4943 /* create PSK premaster_secret */
4944
4945 /* For plain PSK "other_secret" is psklen zeroes */
4946 if (alg_k & SSL_kPSK)
4947 pmslen = psklen;
4948
4949 pskpmslen = 4 + pmslen + psklen;
4950 pskpms = OPENSSL_malloc(pskpmslen);
4951 if (pskpms == NULL) {
4952 s->session->master_key_length = 0;
4953 goto err;
4954 }
4955 t = pskpms;
4956 s2n(pmslen, t);
4957 if (alg_k & SSL_kPSK)
4958 memset(t, 0, pmslen);
4959 else
4960 memcpy(t, pms, pmslen);
4961 t += pmslen;
4962 s2n(psklen, t);
4963 memcpy(t, s->s3->tmp.psk, psklen);
4964
4965 OPENSSL_clear_free(s->s3->tmp.psk, psklen);
4966 s->s3->tmp.psk = NULL;
4967 s->session->master_key_length =
4968 s->method->ssl3_enc->generate_master_secret(s,
4969 s->session->master_key,
4970 pskpms, pskpmslen);
4971 OPENSSL_clear_free(pskpms, pskpmslen);
4972 } else
4973 #endif
4974 s->session->master_key_length =
4975 s->method->ssl3_enc->generate_master_secret(s,
4976 s->session->master_key,
4977 pms, pmslen);
4978 #ifndef OPENSSL_NO_PSK
4979 err:
4980 #endif
4981 if (pms) {
4982 if (free_pms)
4983 OPENSSL_clear_free(pms, pmslen);
4984 else
4985 OPENSSL_cleanse(pms, pmslen);
4986 }
4987 if (s->server == 0)
4988 s->s3->tmp.pms = NULL;
4989 return s->session->master_key_length >= 0;
4990 }
4991
4992 /* Generate a private key from parameters or a curve NID */
4993 EVP_PKEY *ssl_generate_pkey(EVP_PKEY *pm, int nid)
4994 {
4995 EVP_PKEY_CTX *pctx = NULL;
4996 EVP_PKEY *pkey = NULL;
4997 if (pm != NULL) {
4998 pctx = EVP_PKEY_CTX_new(pm, NULL);
4999 } else {
5000 /*
5001 * Generate a new key for this curve.
5002 * Should not be called if EC is disabled: if it is it will
5003 * fail with an unknown algorithm error.
5004 */
5005 pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL);
5006 }
5007 if (pctx == NULL)
5008 goto err;
5009 if (EVP_PKEY_keygen_init(pctx) <= 0)
5010 goto err;
5011 #ifndef OPENSSL_NO_EC
5012 if (pm == NULL && EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, nid) <= 0)
5013 goto err;
5014 #endif
5015
5016 if (EVP_PKEY_keygen(pctx, &pkey) <= 0) {
5017 EVP_PKEY_free(pkey);
5018 pkey = NULL;
5019 }
5020
5021 err:
5022 EVP_PKEY_CTX_free(pctx);
5023 return pkey;
5024 }
5025 /* Derive premaster or master secret for ECDH/DH */
5026 int ssl_derive(SSL *s, EVP_PKEY *privkey, EVP_PKEY *pubkey)
5027 {
5028 int rv = 0;
5029 unsigned char *pms = NULL;
5030 size_t pmslen = 0;
5031 EVP_PKEY_CTX *pctx;
5032
5033 if (privkey == NULL || pubkey == NULL)
5034 return 0;
5035
5036 pctx = EVP_PKEY_CTX_new(privkey, NULL);
5037
5038 if (EVP_PKEY_derive_init(pctx) <= 0
5039 || EVP_PKEY_derive_set_peer(pctx, pubkey) <= 0
5040 || EVP_PKEY_derive(pctx, NULL, &pmslen) <= 0) {
5041 goto err;
5042 }
5043
5044 pms = OPENSSL_malloc(pmslen);
5045 if (pms == NULL)
5046 goto err;
5047
5048 if (EVP_PKEY_derive(pctx, pms, &pmslen) <= 0)
5049 goto err;
5050
5051 if (s->server) {
5052 /* For server generate master secret and discard premaster */
5053 rv = ssl_generate_master_secret(s, pms, pmslen, 1);
5054 pms = NULL;
5055 } else {
5056 /* For client just save premaster secret */
5057 s->s3->tmp.pms = pms;
5058 s->s3->tmp.pmslen = pmslen;
5059 pms = NULL;
5060 rv = 1;
5061 }
5062
5063 err:
5064 OPENSSL_clear_free(pms, pmslen);
5065 EVP_PKEY_CTX_free(pctx);
5066 return rv;
5067 }