2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
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.
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).
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.
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
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)"
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
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.]
58 /* ====================================================================
59 * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved.
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
65 * 1. Redistributions of source code must retain the above copyright
66 * notice, this list of conditions and the following disclaimer.
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
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/)"
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.
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.
87 * 6. Redistributions of any form whatsoever must retain the following
89 * "This product includes software developed by the OpenSSL Project
90 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
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 * ====================================================================
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).
111 /* ====================================================================
112 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
114 * Portions of the attached software ("Contribution") are developed by
115 * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
117 * The Contribution is licensed pursuant to the OpenSSL open source
118 * license provided above.
120 * ECC cipher suite support in OpenSSL originally written by
121 * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories.
124 /* ====================================================================
125 * Copyright 2005 Nokia. All rights reserved.
127 * The portions of the attached software ("Contribution") is developed by
128 * Nokia Corporation and is licensed pursuant to the OpenSSL open source
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.
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.
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.
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
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>
158 #include <openssl/rand.h>
160 #define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers)
162 /* list of available SSLv3 ciphers (sorted by id) */
163 OPENSSL_GLOBAL const SSL_CIPHER ssl3_ciphers[] = {
165 /* The RSA ciphers */
169 SSL3_TXT_RSA_NULL_MD5,
170 SSL3_CK_RSA_NULL_MD5,
176 SSL_NOT_DEFAULT | SSL_STRONG_NONE,
177 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
185 SSL3_TXT_RSA_NULL_SHA,
186 SSL3_CK_RSA_NULL_SHA,
192 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
193 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
201 SSL3_TXT_RSA_RC4_128_MD5,
202 SSL3_CK_RSA_RC4_128_MD5,
208 SSL_NOT_DEFAULT | SSL_MEDIUM,
209 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
217 SSL3_TXT_RSA_RC4_128_SHA,
218 SSL3_CK_RSA_RC4_128_SHA,
224 SSL_NOT_DEFAULT | SSL_MEDIUM,
225 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
231 #ifndef OPENSSL_NO_IDEA
234 SSL3_TXT_RSA_IDEA_128_SHA,
235 SSL3_CK_RSA_IDEA_128_SHA,
242 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
251 SSL3_TXT_RSA_DES_192_CBC3_SHA,
252 SSL3_CK_RSA_DES_192_CBC3_SHA,
259 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
267 SSL3_TXT_DH_DSS_DES_192_CBC3_SHA,
268 SSL3_CK_DH_DSS_DES_192_CBC3_SHA,
275 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
283 SSL3_TXT_DH_RSA_DES_192_CBC3_SHA,
284 SSL3_CK_DH_RSA_DES_192_CBC3_SHA,
291 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
299 SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA,
300 SSL3_CK_DHE_DSS_DES_192_CBC3_SHA,
307 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
315 SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA,
316 SSL3_CK_DHE_RSA_DES_192_CBC3_SHA,
323 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
331 SSL3_TXT_ADH_RC4_128_MD5,
332 SSL3_CK_ADH_RC4_128_MD5,
338 SSL_NOT_DEFAULT | SSL_MEDIUM,
339 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
347 SSL3_TXT_ADH_DES_192_CBC_SHA,
348 SSL3_CK_ADH_DES_192_CBC_SHA,
354 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
355 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
359 #ifndef OPENSSL_NO_PSK
363 TLS1_TXT_PSK_WITH_NULL_SHA,
364 TLS1_CK_PSK_WITH_NULL_SHA,
370 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
371 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
378 TLS1_TXT_DHE_PSK_WITH_NULL_SHA,
379 TLS1_CK_DHE_PSK_WITH_NULL_SHA,
385 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
386 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
393 TLS1_TXT_RSA_PSK_WITH_NULL_SHA,
394 TLS1_CK_RSA_PSK_WITH_NULL_SHA,
400 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
401 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
407 /* New AES ciphersuites */
411 TLS1_TXT_RSA_WITH_AES_128_SHA,
412 TLS1_CK_RSA_WITH_AES_128_SHA,
419 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
426 TLS1_TXT_DH_DSS_WITH_AES_128_SHA,
427 TLS1_CK_DH_DSS_WITH_AES_128_SHA,
434 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
441 TLS1_TXT_DH_RSA_WITH_AES_128_SHA,
442 TLS1_CK_DH_RSA_WITH_AES_128_SHA,
449 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
456 TLS1_TXT_DHE_DSS_WITH_AES_128_SHA,
457 TLS1_CK_DHE_DSS_WITH_AES_128_SHA,
464 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
471 TLS1_TXT_DHE_RSA_WITH_AES_128_SHA,
472 TLS1_CK_DHE_RSA_WITH_AES_128_SHA,
479 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
486 TLS1_TXT_ADH_WITH_AES_128_SHA,
487 TLS1_CK_ADH_WITH_AES_128_SHA,
493 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
494 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
502 TLS1_TXT_RSA_WITH_AES_256_SHA,
503 TLS1_CK_RSA_WITH_AES_256_SHA,
510 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
517 TLS1_TXT_DH_DSS_WITH_AES_256_SHA,
518 TLS1_CK_DH_DSS_WITH_AES_256_SHA,
525 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
533 TLS1_TXT_DH_RSA_WITH_AES_256_SHA,
534 TLS1_CK_DH_RSA_WITH_AES_256_SHA,
541 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
549 TLS1_TXT_DHE_DSS_WITH_AES_256_SHA,
550 TLS1_CK_DHE_DSS_WITH_AES_256_SHA,
557 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
565 TLS1_TXT_DHE_RSA_WITH_AES_256_SHA,
566 TLS1_CK_DHE_RSA_WITH_AES_256_SHA,
573 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
581 TLS1_TXT_ADH_WITH_AES_256_SHA,
582 TLS1_CK_ADH_WITH_AES_256_SHA,
588 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
589 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
594 /* TLS v1.2 ciphersuites */
598 TLS1_TXT_RSA_WITH_NULL_SHA256,
599 TLS1_CK_RSA_WITH_NULL_SHA256,
605 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
606 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
614 TLS1_TXT_RSA_WITH_AES_128_SHA256,
615 TLS1_CK_RSA_WITH_AES_128_SHA256,
622 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
630 TLS1_TXT_RSA_WITH_AES_256_SHA256,
631 TLS1_CK_RSA_WITH_AES_256_SHA256,
638 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
646 TLS1_TXT_DH_DSS_WITH_AES_128_SHA256,
647 TLS1_CK_DH_DSS_WITH_AES_128_SHA256,
654 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
662 TLS1_TXT_DH_RSA_WITH_AES_128_SHA256,
663 TLS1_CK_DH_RSA_WITH_AES_128_SHA256,
670 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
678 TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256,
679 TLS1_CK_DHE_DSS_WITH_AES_128_SHA256,
686 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
691 #ifndef OPENSSL_NO_CAMELLIA
692 /* Camellia ciphersuites from RFC4132 (128-bit portion) */
697 TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA,
698 TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA,
705 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
713 TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA,
714 TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA,
721 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
729 TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA,
730 TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA,
737 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
745 TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
746 TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
753 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
761 TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
762 TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
769 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
777 TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA,
778 TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA,
784 SSL_NOT_DEFAULT | SSL_HIGH,
785 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
789 #endif /* OPENSSL_NO_CAMELLIA */
791 /* TLS v1.2 ciphersuites */
795 TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256,
796 TLS1_CK_DHE_RSA_WITH_AES_128_SHA256,
803 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
811 TLS1_TXT_DH_DSS_WITH_AES_256_SHA256,
812 TLS1_CK_DH_DSS_WITH_AES_256_SHA256,
819 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
827 TLS1_TXT_DH_RSA_WITH_AES_256_SHA256,
828 TLS1_CK_DH_RSA_WITH_AES_256_SHA256,
835 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
843 TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256,
844 TLS1_CK_DHE_DSS_WITH_AES_256_SHA256,
851 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
859 TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256,
860 TLS1_CK_DHE_RSA_WITH_AES_256_SHA256,
867 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
875 TLS1_TXT_ADH_WITH_AES_128_SHA256,
876 TLS1_CK_ADH_WITH_AES_128_SHA256,
882 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
883 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
891 TLS1_TXT_ADH_WITH_AES_256_SHA256,
892 TLS1_CK_ADH_WITH_AES_256_SHA256,
898 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
899 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
904 /* GOST Ciphersuites */
905 #ifndef OPENSL_NO_GOST
908 "GOST2001-GOST89-GOST89",
916 SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94 | TLS1_STREAM_MAC,
922 "GOST2001-NULL-GOST94",
929 SSL_NOT_DEFAULT | SSL_STRONG_NONE,
930 SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94,
935 #ifndef OPENSSL_NO_CAMELLIA
936 /* Camellia ciphersuites from RFC4132 (256-bit portion) */
941 TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA,
942 TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA,
949 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
956 TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA,
957 TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA,
964 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
972 TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA,
973 TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA,
980 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
988 TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
989 TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
996 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1004 TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
1005 TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
1012 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1020 TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA,
1021 TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA,
1027 SSL_NOT_DEFAULT | SSL_HIGH,
1028 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1032 #endif /* OPENSSL_NO_CAMELLIA */
1034 #ifndef OPENSSL_NO_PSK
1035 /* PSK ciphersuites from RFC 4279 */
1039 TLS1_TXT_PSK_WITH_RC4_128_SHA,
1040 TLS1_CK_PSK_WITH_RC4_128_SHA,
1046 SSL_NOT_DEFAULT | SSL_MEDIUM,
1047 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1055 TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA,
1056 TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA,
1062 SSL_HIGH | SSL_FIPS,
1063 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1071 TLS1_TXT_PSK_WITH_AES_128_CBC_SHA,
1072 TLS1_CK_PSK_WITH_AES_128_CBC_SHA,
1078 SSL_HIGH | SSL_FIPS,
1079 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1087 TLS1_TXT_PSK_WITH_AES_256_CBC_SHA,
1088 TLS1_CK_PSK_WITH_AES_256_CBC_SHA,
1094 SSL_HIGH | SSL_FIPS,
1095 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1103 TLS1_TXT_DHE_PSK_WITH_RC4_128_SHA,
1104 TLS1_CK_DHE_PSK_WITH_RC4_128_SHA,
1110 SSL_NOT_DEFAULT | SSL_MEDIUM,
1111 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1119 TLS1_TXT_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
1120 TLS1_CK_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
1126 SSL_HIGH | SSL_FIPS,
1127 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1135 TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA,
1136 TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA,
1142 SSL_HIGH | SSL_FIPS,
1143 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1151 TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA,
1152 TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA,
1158 SSL_HIGH | SSL_FIPS,
1159 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1167 TLS1_TXT_RSA_PSK_WITH_RC4_128_SHA,
1168 TLS1_CK_RSA_PSK_WITH_RC4_128_SHA,
1174 SSL_NOT_DEFAULT | SSL_MEDIUM,
1175 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1183 TLS1_TXT_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
1184 TLS1_CK_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
1190 SSL_HIGH | SSL_FIPS,
1191 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1199 TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA,
1200 TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA,
1206 SSL_HIGH | SSL_FIPS,
1207 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1215 TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA,
1216 TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA,
1222 SSL_HIGH | SSL_FIPS,
1223 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1227 #endif /* OPENSSL_NO_PSK */
1229 #ifndef OPENSSL_NO_SEED
1230 /* SEED ciphersuites from RFC4162 */
1235 TLS1_TXT_RSA_WITH_SEED_SHA,
1236 TLS1_CK_RSA_WITH_SEED_SHA,
1243 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1251 TLS1_TXT_DH_DSS_WITH_SEED_SHA,
1252 TLS1_CK_DH_DSS_WITH_SEED_SHA,
1259 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1267 TLS1_TXT_DH_RSA_WITH_SEED_SHA,
1268 TLS1_CK_DH_RSA_WITH_SEED_SHA,
1275 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1283 TLS1_TXT_DHE_DSS_WITH_SEED_SHA,
1284 TLS1_CK_DHE_DSS_WITH_SEED_SHA,
1291 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1299 TLS1_TXT_DHE_RSA_WITH_SEED_SHA,
1300 TLS1_CK_DHE_RSA_WITH_SEED_SHA,
1307 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1315 TLS1_TXT_ADH_WITH_SEED_SHA,
1316 TLS1_CK_ADH_WITH_SEED_SHA,
1322 SSL_NOT_DEFAULT | SSL_MEDIUM,
1323 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1328 #endif /* OPENSSL_NO_SEED */
1330 /* GCM ciphersuites from RFC5288 */
1335 TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256,
1336 TLS1_CK_RSA_WITH_AES_128_GCM_SHA256,
1342 SSL_HIGH | SSL_FIPS,
1343 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1351 TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384,
1352 TLS1_CK_RSA_WITH_AES_256_GCM_SHA384,
1358 SSL_HIGH | SSL_FIPS,
1359 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1367 TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256,
1368 TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256,
1374 SSL_HIGH | SSL_FIPS,
1375 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1383 TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384,
1384 TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384,
1390 SSL_HIGH | SSL_FIPS,
1391 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1399 TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256,
1400 TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256,
1406 SSL_HIGH | SSL_FIPS,
1407 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1415 TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384,
1416 TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384,
1422 SSL_HIGH | SSL_FIPS,
1423 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1431 TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256,
1432 TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256,
1438 SSL_HIGH | SSL_FIPS,
1439 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1447 TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384,
1448 TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384,
1454 SSL_HIGH | SSL_FIPS,
1455 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1463 TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256,
1464 TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256,
1470 SSL_HIGH | SSL_FIPS,
1471 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1479 TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384,
1480 TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384,
1486 SSL_HIGH | SSL_FIPS,
1487 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1495 TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256,
1496 TLS1_CK_ADH_WITH_AES_128_GCM_SHA256,
1502 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
1503 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1511 TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384,
1512 TLS1_CK_ADH_WITH_AES_256_GCM_SHA384,
1518 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
1519 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1523 #ifndef OPENSSL_NO_PSK
1524 /* PSK ciphersuites from RFC5487 */
1529 TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256,
1530 TLS1_CK_PSK_WITH_AES_128_GCM_SHA256,
1536 SSL_HIGH | SSL_FIPS,
1537 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1545 TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384,
1546 TLS1_CK_PSK_WITH_AES_256_GCM_SHA384,
1552 SSL_HIGH | SSL_FIPS,
1553 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1561 TLS1_TXT_DHE_PSK_WITH_AES_128_GCM_SHA256,
1562 TLS1_CK_DHE_PSK_WITH_AES_128_GCM_SHA256,
1568 SSL_HIGH | SSL_FIPS,
1569 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1577 TLS1_TXT_DHE_PSK_WITH_AES_256_GCM_SHA384,
1578 TLS1_CK_DHE_PSK_WITH_AES_256_GCM_SHA384,
1584 SSL_HIGH | SSL_FIPS,
1585 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1593 TLS1_TXT_RSA_PSK_WITH_AES_128_GCM_SHA256,
1594 TLS1_CK_RSA_PSK_WITH_AES_128_GCM_SHA256,
1600 SSL_HIGH | SSL_FIPS,
1601 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1609 TLS1_TXT_RSA_PSK_WITH_AES_256_GCM_SHA384,
1610 TLS1_CK_RSA_PSK_WITH_AES_256_GCM_SHA384,
1616 SSL_HIGH | SSL_FIPS,
1617 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1625 TLS1_TXT_PSK_WITH_AES_128_CBC_SHA256,
1626 TLS1_CK_PSK_WITH_AES_128_CBC_SHA256,
1632 SSL_HIGH | SSL_FIPS,
1633 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1641 TLS1_TXT_PSK_WITH_AES_256_CBC_SHA384,
1642 TLS1_CK_PSK_WITH_AES_256_CBC_SHA384,
1648 SSL_HIGH | SSL_FIPS,
1649 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1657 TLS1_TXT_PSK_WITH_NULL_SHA256,
1658 TLS1_CK_PSK_WITH_NULL_SHA256,
1664 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1665 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1673 TLS1_TXT_PSK_WITH_NULL_SHA384,
1674 TLS1_CK_PSK_WITH_NULL_SHA384,
1680 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1681 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1689 TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA256,
1690 TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA256,
1696 SSL_HIGH | SSL_FIPS,
1697 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1705 TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA384,
1706 TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA384,
1712 SSL_HIGH | SSL_FIPS,
1713 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1721 TLS1_TXT_DHE_PSK_WITH_NULL_SHA256,
1722 TLS1_CK_DHE_PSK_WITH_NULL_SHA256,
1728 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1729 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1737 TLS1_TXT_DHE_PSK_WITH_NULL_SHA384,
1738 TLS1_CK_DHE_PSK_WITH_NULL_SHA384,
1744 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1745 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1753 TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA256,
1754 TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA256,
1760 SSL_HIGH | SSL_FIPS,
1761 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1769 TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA384,
1770 TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA384,
1776 SSL_HIGH | SSL_FIPS,
1777 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1785 TLS1_TXT_RSA_PSK_WITH_NULL_SHA256,
1786 TLS1_CK_RSA_PSK_WITH_NULL_SHA256,
1792 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1793 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1801 TLS1_TXT_RSA_PSK_WITH_NULL_SHA384,
1802 TLS1_CK_RSA_PSK_WITH_NULL_SHA384,
1808 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
1809 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1813 #endif /* OPENSSL_NO_PSK */
1815 #ifndef OPENSSL_NO_CAMELLIA
1816 /* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 */
1821 TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1822 TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1829 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1837 TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256,
1838 TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256,
1845 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1853 TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1854 TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1861 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1869 TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
1870 TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
1877 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1885 TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1886 TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
1893 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1901 TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA256,
1902 TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA256,
1908 SSL_NOT_DEFAULT | SSL_HIGH,
1909 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1917 TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1918 TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1925 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1933 TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256,
1934 TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256,
1941 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1949 TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1950 TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1957 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1965 TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
1966 TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
1973 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1981 TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1982 TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
1989 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1997 TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA256,
1998 TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256,
2004 SSL_NOT_DEFAULT | SSL_HIGH,
2005 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2011 #ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL
2028 #ifndef OPENSSL_NO_EC
2032 TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA,
2033 TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA,
2039 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2040 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2048 TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA,
2049 TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA,
2055 SSL_NOT_DEFAULT | SSL_MEDIUM,
2056 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2064 TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA,
2065 TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA,
2071 SSL_HIGH | SSL_FIPS,
2072 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2080 TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
2081 TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
2087 SSL_HIGH | SSL_FIPS,
2088 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2096 TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
2097 TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
2103 SSL_HIGH | SSL_FIPS,
2104 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2112 TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA,
2113 TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA,
2119 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2120 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2128 TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA,
2129 TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA,
2135 SSL_NOT_DEFAULT | SSL_MEDIUM,
2136 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2144 TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
2145 TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
2151 SSL_HIGH | SSL_FIPS,
2152 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2160 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
2161 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
2167 SSL_HIGH | SSL_FIPS,
2168 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2176 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
2177 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
2183 SSL_HIGH | SSL_FIPS,
2184 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2192 TLS1_TXT_ECDH_RSA_WITH_NULL_SHA,
2193 TLS1_CK_ECDH_RSA_WITH_NULL_SHA,
2199 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2200 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2208 TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA,
2209 TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA,
2215 SSL_NOT_DEFAULT | SSL_MEDIUM,
2216 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2224 TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA,
2225 TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA,
2231 SSL_HIGH | SSL_FIPS,
2232 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2240 TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA,
2241 TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA,
2247 SSL_HIGH | SSL_FIPS,
2248 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2256 TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA,
2257 TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA,
2263 SSL_HIGH | SSL_FIPS,
2264 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2272 TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA,
2273 TLS1_CK_ECDHE_RSA_WITH_NULL_SHA,
2279 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2280 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2288 TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA,
2289 TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA,
2295 SSL_NOT_DEFAULT | SSL_MEDIUM,
2296 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2304 TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
2305 TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
2311 SSL_HIGH | SSL_FIPS,
2312 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2320 TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA,
2321 TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA,
2327 SSL_HIGH | SSL_FIPS,
2328 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2336 TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA,
2337 TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA,
2343 SSL_HIGH | SSL_FIPS,
2344 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2352 TLS1_TXT_ECDH_anon_WITH_NULL_SHA,
2353 TLS1_CK_ECDH_anon_WITH_NULL_SHA,
2359 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2360 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2368 TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA,
2369 TLS1_CK_ECDH_anon_WITH_RC4_128_SHA,
2375 SSL_NOT_DEFAULT | SSL_MEDIUM,
2376 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2384 TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA,
2385 TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA,
2391 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
2392 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2400 TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA,
2401 TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA,
2407 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
2408 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2416 TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA,
2417 TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA,
2423 SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
2424 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2428 #endif /* OPENSSL_NO_EC */
2430 #ifndef OPENSSL_NO_SRP
2434 TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
2435 TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
2442 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2450 TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
2451 TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
2458 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2466 TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
2467 TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
2474 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2482 TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA,
2483 TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA,
2490 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2498 TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
2499 TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
2506 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2514 TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
2515 TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
2522 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2530 TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA,
2531 TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA,
2538 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2546 TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
2547 TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
2554 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2562 TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
2563 TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
2570 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2574 #endif /* OPENSSL_NO_SRP */
2575 #ifndef OPENSSL_NO_EC
2577 /* HMAC based TLS v1.2 ciphersuites from RFC5289 */
2582 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256,
2583 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256,
2589 SSL_HIGH | SSL_FIPS,
2590 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2598 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384,
2599 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384,
2605 SSL_HIGH | SSL_FIPS,
2606 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2614 TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256,
2615 TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256,
2621 SSL_HIGH | SSL_FIPS,
2622 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2630 TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384,
2631 TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384,
2637 SSL_HIGH | SSL_FIPS,
2638 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2646 TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256,
2647 TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256,
2653 SSL_HIGH | SSL_FIPS,
2654 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2662 TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384,
2663 TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384,
2669 SSL_HIGH | SSL_FIPS,
2670 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2678 TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256,
2679 TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256,
2685 SSL_HIGH | SSL_FIPS,
2686 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2694 TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384,
2695 TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384,
2701 SSL_HIGH | SSL_FIPS,
2702 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2707 /* GCM based TLS v1.2 ciphersuites from RFC5289 */
2712 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
2713 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
2719 SSL_HIGH | SSL_FIPS,
2720 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2728 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
2729 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
2735 SSL_HIGH | SSL_FIPS,
2736 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2744 TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
2745 TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
2751 SSL_HIGH | SSL_FIPS,
2752 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2760 TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,
2761 TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,
2767 SSL_HIGH | SSL_FIPS,
2768 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2776 TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
2777 TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
2783 SSL_HIGH | SSL_FIPS,
2784 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2792 TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
2793 TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
2799 SSL_HIGH | SSL_FIPS,
2800 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2808 TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256,
2809 TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256,
2815 SSL_HIGH | SSL_FIPS,
2816 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2824 TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384,
2825 TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384,
2831 SSL_HIGH | SSL_FIPS,
2832 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2837 /* PSK ciphersuites from RFC 5489 */
2841 TLS1_TXT_ECDHE_PSK_WITH_RC4_128_SHA,
2842 TLS1_CK_ECDHE_PSK_WITH_RC4_128_SHA,
2848 SSL_NOT_DEFAULT | SSL_MEDIUM,
2849 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2857 TLS1_TXT_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
2858 TLS1_CK_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
2864 SSL_HIGH | SSL_FIPS,
2865 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2873 TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA,
2874 TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA,
2880 SSL_HIGH | SSL_FIPS,
2881 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2889 TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA,
2890 TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA,
2896 SSL_HIGH | SSL_FIPS,
2897 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2905 TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
2906 TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
2912 SSL_HIGH | SSL_FIPS,
2913 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2921 TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
2922 TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
2928 SSL_HIGH | SSL_FIPS,
2929 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2937 TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA,
2938 TLS1_CK_ECDHE_PSK_WITH_NULL_SHA,
2944 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2945 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2953 TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA256,
2954 TLS1_CK_ECDHE_PSK_WITH_NULL_SHA256,
2960 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2961 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2969 TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA384,
2970 TLS1_CK_ECDHE_PSK_WITH_NULL_SHA384,
2976 SSL_NOT_DEFAULT | SSL_STRONG_NONE | SSL_FIPS,
2977 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2982 # ifndef OPENSSL_NO_CAMELLIA
2985 TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
2986 TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
2993 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
2999 TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
3000 TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
3007 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3013 TLS1_TXT_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
3014 TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
3021 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3027 TLS1_TXT_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
3028 TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
3035 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3041 TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
3042 TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
3049 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3055 TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
3056 TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
3063 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3069 TLS1_TXT_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256,
3070 TLS1_CK_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256,
3077 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3083 TLS1_TXT_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384,
3084 TLS1_CK_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384,
3091 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3094 # endif /* OPENSSL_NO_CAMELLIA */
3095 #endif /* OPENSSL_NO_EC */
3097 #if !defined(OPENSSL_NO_CAMELLIA) && !defined(OPENSSL_NO_PSK)
3100 TLS1_TXT_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3101 TLS1_CK_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3108 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
3114 TLS1_TXT_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3115 TLS1_CK_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3122 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3128 TLS1_TXT_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3129 TLS1_CK_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3136 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
3142 TLS1_TXT_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3143 TLS1_CK_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3150 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3156 TLS1_TXT_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3157 TLS1_CK_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3164 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
3170 TLS1_TXT_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3171 TLS1_CK_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3178 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3184 TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3185 TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
3192 SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
3198 TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3199 TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
3206 SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
3214 TLS1_TXT_RSA_WITH_AES_128_CCM,
3215 TLS1_CK_RSA_WITH_AES_128_CCM,
3222 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3230 TLS1_TXT_RSA_WITH_AES_256_CCM,
3231 TLS1_CK_RSA_WITH_AES_256_CCM,
3238 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3246 TLS1_TXT_DHE_RSA_WITH_AES_128_CCM,
3247 TLS1_CK_DHE_RSA_WITH_AES_128_CCM,
3254 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3262 TLS1_TXT_DHE_RSA_WITH_AES_256_CCM,
3263 TLS1_CK_DHE_RSA_WITH_AES_256_CCM,
3270 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3278 TLS1_TXT_RSA_WITH_AES_128_CCM_8,
3279 TLS1_CK_RSA_WITH_AES_128_CCM_8,
3286 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3294 TLS1_TXT_RSA_WITH_AES_256_CCM_8,
3295 TLS1_CK_RSA_WITH_AES_256_CCM_8,
3302 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3310 TLS1_TXT_DHE_RSA_WITH_AES_128_CCM_8,
3311 TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8,
3318 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3326 TLS1_TXT_DHE_RSA_WITH_AES_256_CCM_8,
3327 TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8,
3334 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3342 TLS1_TXT_PSK_WITH_AES_128_CCM,
3343 TLS1_CK_PSK_WITH_AES_128_CCM,
3350 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3358 TLS1_TXT_PSK_WITH_AES_256_CCM,
3359 TLS1_CK_PSK_WITH_AES_256_CCM,
3366 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3374 TLS1_TXT_DHE_PSK_WITH_AES_128_CCM,
3375 TLS1_CK_DHE_PSK_WITH_AES_128_CCM,
3382 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3390 TLS1_TXT_DHE_PSK_WITH_AES_256_CCM,
3391 TLS1_CK_DHE_PSK_WITH_AES_256_CCM,
3398 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3406 TLS1_TXT_PSK_WITH_AES_128_CCM_8,
3407 TLS1_CK_PSK_WITH_AES_128_CCM_8,
3414 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3422 TLS1_TXT_PSK_WITH_AES_256_CCM_8,
3423 TLS1_CK_PSK_WITH_AES_256_CCM_8,
3430 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3438 TLS1_TXT_DHE_PSK_WITH_AES_128_CCM_8,
3439 TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8,
3446 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3454 TLS1_TXT_DHE_PSK_WITH_AES_256_CCM_8,
3455 TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8,
3462 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3470 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM,
3471 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM,
3478 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3486 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM,
3487 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM,
3494 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3502 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM_8,
3503 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8,
3510 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3518 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8,
3519 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8,
3526 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
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 */
3535 TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305,
3536 TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305,
3539 SSL_CHACHA20POLY1305,
3543 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3550 TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
3551 TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
3554 SSL_CHACHA20POLY1305,
3558 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3563 # ifndef OPENSSL_NO_RSA
3567 TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305,
3568 TLS1_CK_DHE_RSA_WITH_CHACHA20_POLY1305,
3571 SSL_CHACHA20POLY1305,
3575 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3580 # ifndef OPENSSL_NO_PSK
3584 TLS1_TXT_PSK_WITH_CHACHA20_POLY1305,
3585 TLS1_CK_PSK_WITH_CHACHA20_POLY1305,
3588 SSL_CHACHA20POLY1305,
3592 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3599 TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305,
3600 TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305,
3603 SSL_CHACHA20POLY1305,
3607 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3614 TLS1_TXT_DHE_PSK_WITH_CHACHA20_POLY1305,
3615 TLS1_CK_DHE_PSK_WITH_CHACHA20_POLY1305,
3618 SSL_CHACHA20POLY1305,
3622 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3629 TLS1_TXT_RSA_PSK_WITH_CHACHA20_POLY1305,
3630 TLS1_CK_RSA_PSK_WITH_CHACHA20_POLY1305,
3633 SSL_CHACHA20POLY1305,
3637 SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
3643 #ifndef OPENSSL_NO_GOST
3646 "GOST2012-GOST8912-GOST8912",
3649 SSL_aGOST12 | SSL_aGOST01,
3650 SSL_eGOST2814789CNT12,
3654 SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_STREAM_MAC,
3659 "GOST2012-NULL-GOST12",
3662 SSL_aGOST12 | SSL_aGOST01,
3667 SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256,
3675 const SSL3_ENC_METHOD SSLv3_enc_data = {
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,
3686 (int (*)(SSL *, unsigned char *, size_t, const char *,
3687 size_t, const unsigned char *, size_t,
3688 int use_context))ssl_undefined_function,
3690 SSL3_HM_HEADER_LENGTH,
3691 ssl3_set_handshake_header,
3692 ssl3_handshake_write
3695 long ssl3_default_timeout(void)
3698 * 2 hours, the 24 hours mentioned in the SSLv3 spec is way too long for
3699 * http, the cache would over fill
3701 return (60 * 60 * 2);
3704 int ssl3_num_ciphers(void)
3706 return (SSL3_NUM_CIPHERS);
3709 const SSL_CIPHER *ssl3_get_cipher(unsigned int u)
3711 if (u < SSL3_NUM_CIPHERS)
3712 return (&(ssl3_ciphers[SSL3_NUM_CIPHERS - 1 - u]));
3717 int ssl3_set_handshake_header(SSL *s, int htype, unsigned long len)
3719 unsigned char *p = (unsigned char *)s->init_buf->data;
3722 s->init_num = (int)len + SSL3_HM_HEADER_LENGTH;
3728 int ssl3_handshake_write(SSL *s)
3730 return ssl3_do_write(s, SSL3_RT_HANDSHAKE);
3733 int ssl3_new(SSL *s)
3737 if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
3741 #ifndef OPENSSL_NO_SRP
3742 if (!SSL_SRP_CTX_init(s))
3745 s->method->ssl_clear(s);
3751 void ssl3_free(SSL *s)
3753 if (s == NULL || s->s3 == NULL)
3756 ssl3_cleanup_key_block(s);
3758 #ifndef OPENSSL_NO_DH
3759 DH_free(s->s3->tmp.dh);
3760 DH_free(s->s3->peer_dh_tmp);
3762 #ifndef OPENSSL_NO_EC
3763 EC_KEY_free(s->s3->tmp.ecdh);
3764 EC_KEY_free(s->s3->peer_ecdh_tmp);
3767 sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free);
3768 OPENSSL_free(s->s3->tmp.ciphers_raw);
3769 OPENSSL_clear_free(s->s3->tmp.pms, s->s3->tmp.pmslen);
3770 OPENSSL_free(s->s3->tmp.peer_sigalgs);
3771 ssl3_free_digest_list(s);
3772 OPENSSL_free(s->s3->alpn_selected);
3774 #ifndef OPENSSL_NO_SRP
3775 SSL_SRP_CTX_free(s);
3777 OPENSSL_clear_free(s->s3, sizeof(*s->s3));
3781 void ssl3_clear(SSL *s)
3785 ssl3_cleanup_key_block(s);
3786 sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free);
3787 OPENSSL_free(s->s3->tmp.ciphers_raw);
3788 s->s3->tmp.ciphers_raw = NULL;
3789 OPENSSL_clear_free(s->s3->tmp.pms, s->s3->tmp.pmslen);
3790 s->s3->tmp.pms = NULL;
3791 OPENSSL_free(s->s3->tmp.peer_sigalgs);
3792 s->s3->tmp.peer_sigalgs = NULL;
3794 #ifndef OPENSSL_NO_DH
3795 DH_free(s->s3->tmp.dh);
3796 s->s3->tmp.dh = NULL;
3797 DH_free(s->s3->peer_dh_tmp);
3798 s->s3->peer_dh_tmp = NULL;
3800 #ifndef OPENSSL_NO_EC
3801 EC_KEY_free(s->s3->tmp.ecdh);
3802 s->s3->tmp.ecdh = NULL;
3803 EC_KEY_free(s->s3->peer_ecdh_tmp);
3804 s->s3->peer_ecdh_tmp = NULL;
3805 s->s3->is_probably_safari = 0;
3806 #endif /* !OPENSSL_NO_EC */
3808 init_extra = s->s3->init_extra;
3809 ssl3_free_digest_list(s);
3811 if (s->s3->alpn_selected) {
3812 OPENSSL_free(s->s3->alpn_selected);
3813 s->s3->alpn_selected = NULL;
3816 memset(s->s3, 0, sizeof(*s->s3));
3817 s->s3->init_extra = init_extra;
3819 ssl_free_wbio_buffer(s);
3821 s->s3->renegotiate = 0;
3822 s->s3->total_renegotiations = 0;
3823 s->s3->num_renegotiations = 0;
3824 s->s3->in_read_app_data = 0;
3825 s->version = SSL3_VERSION;
3827 #if !defined(OPENSSL_NO_NEXTPROTONEG)
3828 OPENSSL_free(s->next_proto_negotiated);
3829 s->next_proto_negotiated = NULL;
3830 s->next_proto_negotiated_len = 0;
3834 #ifndef OPENSSL_NO_SRP
3835 static char *srp_password_from_info_cb(SSL *s, void *arg)
3837 return BUF_strdup(s->srp_ctx.info);
3841 static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p,
3844 long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
3849 case SSL_CTRL_GET_SESSION_REUSED:
3852 case SSL_CTRL_GET_CLIENT_CERT_REQUEST:
3854 case SSL_CTRL_GET_NUM_RENEGOTIATIONS:
3855 ret = s->s3->num_renegotiations;
3857 case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS:
3858 ret = s->s3->num_renegotiations;
3859 s->s3->num_renegotiations = 0;
3861 case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS:
3862 ret = s->s3->total_renegotiations;
3864 case SSL_CTRL_GET_FLAGS:
3865 ret = (int)(s->s3->flags);
3867 #ifndef OPENSSL_NO_DH
3868 case SSL_CTRL_SET_TMP_DH:
3870 DH *dh = (DH *)parg;
3872 SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3875 if (!ssl_security(s, SSL_SECOP_TMP_DH,
3876 DH_security_bits(dh), 0, dh)) {
3877 SSLerr(SSL_F_SSL3_CTRL, SSL_R_DH_KEY_TOO_SMALL);
3880 if ((dh = DHparams_dup(dh)) == NULL) {
3881 SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
3884 if (!(s->options & SSL_OP_SINGLE_DH_USE)) {
3885 if (!DH_generate_key(dh)) {
3887 SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
3891 DH_free(s->cert->dh_tmp);
3892 s->cert->dh_tmp = dh;
3896 case SSL_CTRL_SET_TMP_DH_CB:
3898 SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
3901 case SSL_CTRL_SET_DH_AUTO:
3902 s->cert->dh_tmp_auto = larg;
3905 #ifndef OPENSSL_NO_EC
3906 case SSL_CTRL_SET_TMP_ECDH:
3908 const EC_GROUP *group = NULL;
3912 SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3915 group = EC_KEY_get0_group((const EC_KEY *)parg);
3916 if (group == NULL) {
3917 SSLerr(SSL_F_SSL3_CTRL, EC_R_MISSING_PARAMETERS);
3920 nid = EC_GROUP_get_curve_name(group);
3921 if (nid == NID_undef)
3923 return tls1_set_curves(&s->tlsext_ellipticcurvelist,
3924 &s->tlsext_ellipticcurvelist_length,
3928 #endif /* !OPENSSL_NO_EC */
3929 case SSL_CTRL_SET_TLSEXT_HOSTNAME:
3930 if (larg == TLSEXT_NAMETYPE_host_name) {
3931 OPENSSL_free(s->tlsext_hostname);
3932 s->tlsext_hostname = NULL;
3937 if (strlen((char *)parg) > TLSEXT_MAXLEN_host_name) {
3938 SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME);
3941 if ((s->tlsext_hostname = BUF_strdup((char *)parg)) == NULL) {
3942 SSLerr(SSL_F_SSL3_CTRL, ERR_R_INTERNAL_ERROR);
3946 SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE);
3950 case SSL_CTRL_SET_TLSEXT_DEBUG_ARG:
3951 s->tlsext_debug_arg = parg;
3955 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
3956 s->tlsext_status_type = larg;
3960 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS:
3961 *(STACK_OF(X509_EXTENSION) **)parg = s->tlsext_ocsp_exts;
3965 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS:
3966 s->tlsext_ocsp_exts = parg;
3970 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS:
3971 *(STACK_OF(OCSP_RESPID) **)parg = s->tlsext_ocsp_ids;
3975 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS:
3976 s->tlsext_ocsp_ids = parg;
3980 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP:
3981 *(unsigned char **)parg = s->tlsext_ocsp_resp;
3982 return s->tlsext_ocsp_resplen;
3984 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
3985 OPENSSL_free(s->tlsext_ocsp_resp);
3986 s->tlsext_ocsp_resp = parg;
3987 s->tlsext_ocsp_resplen = larg;
3991 #ifndef OPENSSL_NO_HEARTBEATS
3992 case SSL_CTRL_TLS_EXT_SEND_HEARTBEAT:
3994 ret = dtls1_heartbeat(s);
3996 ret = tls1_heartbeat(s);
3999 case SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING:
4000 ret = s->tlsext_hb_pending;
4003 case SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS:
4005 s->tlsext_heartbeat |= SSL_TLSEXT_HB_DONT_RECV_REQUESTS;
4007 s->tlsext_heartbeat &= ~SSL_TLSEXT_HB_DONT_RECV_REQUESTS;
4012 case SSL_CTRL_CHAIN:
4014 return ssl_cert_set1_chain(s, NULL, (STACK_OF(X509) *)parg);
4016 return ssl_cert_set0_chain(s, NULL, (STACK_OF(X509) *)parg);
4018 case SSL_CTRL_CHAIN_CERT:
4020 return ssl_cert_add1_chain_cert(s, NULL, (X509 *)parg);
4022 return ssl_cert_add0_chain_cert(s, NULL, (X509 *)parg);
4024 case SSL_CTRL_GET_CHAIN_CERTS:
4025 *(STACK_OF(X509) **)parg = s->cert->key->chain;
4028 case SSL_CTRL_SELECT_CURRENT_CERT:
4029 return ssl_cert_select_current(s->cert, (X509 *)parg);
4031 case SSL_CTRL_SET_CURRENT_CERT:
4032 if (larg == SSL_CERT_SET_SERVER) {
4034 const SSL_CIPHER *cipher;
4037 cipher = s->s3->tmp.new_cipher;
4041 * No certificate for unauthenticated ciphersuites or using SRP
4044 if (cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP))
4046 cpk = ssl_get_server_send_pkey(s);
4052 return ssl_cert_set_current(s->cert, larg);
4054 #ifndef OPENSSL_NO_EC
4055 case SSL_CTRL_GET_CURVES:
4057 unsigned char *clist;
4061 clist = s->session->tlsext_ellipticcurvelist;
4062 clistlen = s->session->tlsext_ellipticcurvelist_length / 2;
4066 unsigned int cid, nid;
4067 for (i = 0; i < clistlen; i++) {
4069 nid = tls1_ec_curve_id2nid(cid);
4073 cptr[i] = TLSEXT_nid_unknown | cid;
4076 return (int)clistlen;
4079 case SSL_CTRL_SET_CURVES:
4080 return tls1_set_curves(&s->tlsext_ellipticcurvelist,
4081 &s->tlsext_ellipticcurvelist_length,
4084 case SSL_CTRL_SET_CURVES_LIST:
4085 return tls1_set_curves_list(&s->tlsext_ellipticcurvelist,
4086 &s->tlsext_ellipticcurvelist_length,
4089 case SSL_CTRL_GET_SHARED_CURVE:
4090 return tls1_shared_curve(s, larg);
4093 case SSL_CTRL_SET_SIGALGS:
4094 return tls1_set_sigalgs(s->cert, parg, larg, 0);
4096 case SSL_CTRL_SET_SIGALGS_LIST:
4097 return tls1_set_sigalgs_list(s->cert, parg, 0);
4099 case SSL_CTRL_SET_CLIENT_SIGALGS:
4100 return tls1_set_sigalgs(s->cert, parg, larg, 1);
4102 case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
4103 return tls1_set_sigalgs_list(s->cert, parg, 1);
4105 case SSL_CTRL_GET_CLIENT_CERT_TYPES:
4107 const unsigned char **pctype = parg;
4108 if (s->server || !s->s3->tmp.cert_req)
4110 if (s->cert->ctypes) {
4112 *pctype = s->cert->ctypes;
4113 return (int)s->cert->ctype_num;
4116 *pctype = (unsigned char *)s->s3->tmp.ctype;
4117 return s->s3->tmp.ctype_num;
4120 case SSL_CTRL_SET_CLIENT_CERT_TYPES:
4123 return ssl3_set_req_cert_type(s->cert, parg, larg);
4125 case SSL_CTRL_BUILD_CERT_CHAIN:
4126 return ssl_build_cert_chain(s, NULL, larg);
4128 case SSL_CTRL_SET_VERIFY_CERT_STORE:
4129 return ssl_cert_set_cert_store(s->cert, parg, 0, larg);
4131 case SSL_CTRL_SET_CHAIN_CERT_STORE:
4132 return ssl_cert_set_cert_store(s->cert, parg, 1, larg);
4134 case SSL_CTRL_GET_PEER_SIGNATURE_NID:
4135 if (SSL_USE_SIGALGS(s)) {
4138 sig = s->s3->tmp.peer_md;
4140 *(int *)parg = EVP_MD_type(sig);
4146 /* Might want to do something here for other versions */
4150 case SSL_CTRL_GET_SERVER_TMP_KEY:
4151 if (s->server || !s->session)
4156 #if !defined(OPENSSL_NO_DH) && !defined(OPENSSL_NO_EC)
4157 if (!s->s3->peer_dh_tmp && !s->s3->peer_ecdh_tmp)
4160 ptmp = EVP_PKEY_new();
4163 #ifndef OPENSSL_NO_DH
4164 else if (s->s3->peer_dh_tmp)
4165 rv = EVP_PKEY_set1_DH(ptmp, s->s3->peer_dh_tmp);
4167 #ifndef OPENSSL_NO_EC
4168 else if (s->s3->peer_ecdh_tmp)
4169 rv = EVP_PKEY_set1_EC_KEY(ptmp, s->s3->peer_ecdh_tmp);
4172 *(EVP_PKEY **)parg = ptmp;
4175 EVP_PKEY_free(ptmp);
4178 #ifndef OPENSSL_NO_EC
4179 case SSL_CTRL_GET_EC_POINT_FORMATS:
4181 SSL_SESSION *sess = s->session;
4182 const unsigned char **pformat = parg;
4183 if (!sess || !sess->tlsext_ecpointformatlist)
4185 *pformat = sess->tlsext_ecpointformatlist;
4186 return (int)sess->tlsext_ecpointformatlist_length;
4190 case SSL_CTRL_CHECK_PROTO_VERSION:
4192 * For library-internal use; checks that the current protocol is the
4193 * highest enabled version (according to s->ctx->method, as version
4194 * negotiation may have changed s->method).
4196 if (s->version == s->ctx->method->version)
4199 * Apparently we're using a version-flexible SSL_METHOD (not at its
4200 * highest protocol version).
4202 if (s->ctx->method->version == TLS_method()->version) {
4203 #if TLS_MAX_VERSION != TLS1_2_VERSION
4204 # error Code needs update for TLS_method() support beyond TLS1_2_VERSION.
4206 if (!(s->options & SSL_OP_NO_TLSv1_2))
4207 return s->version == TLS1_2_VERSION;
4208 if (!(s->options & SSL_OP_NO_TLSv1_1))
4209 return s->version == TLS1_1_VERSION;
4210 if (!(s->options & SSL_OP_NO_TLSv1))
4211 return s->version == TLS1_VERSION;
4212 if (!(s->options & SSL_OP_NO_SSLv3))
4213 return s->version == SSL3_VERSION;
4215 return 0; /* Unexpected state; fail closed. */
4223 long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp) (void))
4228 #ifndef OPENSSL_NO_DH
4229 case SSL_CTRL_SET_TMP_DH_CB:
4231 s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
4235 case SSL_CTRL_SET_TLSEXT_DEBUG_CB:
4236 s->tlsext_debug_cb = (void (*)(SSL *, int, int,
4237 unsigned char *, int, void *))fp;
4240 case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
4242 s->not_resumable_session_cb = (int (*)(SSL *, int))fp;
4251 long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
4254 #ifndef OPENSSL_NO_DH
4255 case SSL_CTRL_SET_TMP_DH:
4257 DH *new = NULL, *dh;
4262 if (!ssl_ctx_security(ctx, SSL_SECOP_TMP_DH,
4263 DH_security_bits(dh), 0, dh)) {
4264 SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_DH_KEY_TOO_SMALL);
4267 if ((new = DHparams_dup(dh)) == NULL) {
4268 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB);
4271 if (!(ctx->options & SSL_OP_SINGLE_DH_USE)) {
4272 if (!DH_generate_key(new)) {
4273 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB);
4278 DH_free(cert->dh_tmp);
4285 case SSL_CTRL_SET_TMP_DH_CB:
4287 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
4290 case SSL_CTRL_SET_DH_AUTO:
4291 ctx->cert->dh_tmp_auto = larg;
4294 #ifndef OPENSSL_NO_EC
4295 case SSL_CTRL_SET_TMP_ECDH:
4297 const EC_GROUP *group = NULL;
4301 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_PASSED_NULL_PARAMETER);
4304 group = EC_KEY_get0_group((const EC_KEY *)parg);
4305 if (group == NULL) {
4306 SSLerr(SSL_F_SSL3_CTX_CTRL, EC_R_MISSING_PARAMETERS);
4309 nid = EC_GROUP_get_curve_name(group);
4310 if (nid == NID_undef)
4312 return tls1_set_curves(&ctx->tlsext_ellipticcurvelist,
4313 &ctx->tlsext_ellipticcurvelist_length,
4317 #endif /* !OPENSSL_NO_EC */
4318 case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG:
4319 ctx->tlsext_servername_arg = parg;
4321 case SSL_CTRL_SET_TLSEXT_TICKET_KEYS:
4322 case SSL_CTRL_GET_TLSEXT_TICKET_KEYS:
4324 unsigned char *keys = parg;
4328 SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_TICKET_KEYS_LENGTH);
4331 if (cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEYS) {
4332 memcpy(ctx->tlsext_tick_key_name, keys, 16);
4333 memcpy(ctx->tlsext_tick_hmac_key, keys + 16, 16);
4334 memcpy(ctx->tlsext_tick_aes_key, keys + 32, 16);
4336 memcpy(keys, ctx->tlsext_tick_key_name, 16);
4337 memcpy(keys + 16, ctx->tlsext_tick_hmac_key, 16);
4338 memcpy(keys + 32, ctx->tlsext_tick_aes_key, 16);
4343 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
4344 ctx->tlsext_status_arg = parg;
4347 #ifndef OPENSSL_NO_SRP
4348 case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
4349 ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4350 OPENSSL_free(ctx->srp_ctx.login);
4351 ctx->srp_ctx.login = NULL;
4354 if (strlen((const char *)parg) > 255
4355 || strlen((const char *)parg) < 1) {
4356 SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_SRP_USERNAME);
4359 if ((ctx->srp_ctx.login = BUF_strdup((char *)parg)) == NULL) {
4360 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_INTERNAL_ERROR);
4364 case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD:
4365 ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
4366 srp_password_from_info_cb;
4367 ctx->srp_ctx.info = parg;
4369 case SSL_CTRL_SET_SRP_ARG:
4370 ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4371 ctx->srp_ctx.SRP_cb_arg = parg;
4374 case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH:
4375 ctx->srp_ctx.strength = larg;
4379 #ifndef OPENSSL_NO_EC
4380 case SSL_CTRL_SET_CURVES:
4381 return tls1_set_curves(&ctx->tlsext_ellipticcurvelist,
4382 &ctx->tlsext_ellipticcurvelist_length,
4385 case SSL_CTRL_SET_CURVES_LIST:
4386 return tls1_set_curves_list(&ctx->tlsext_ellipticcurvelist,
4387 &ctx->tlsext_ellipticcurvelist_length,
4390 case SSL_CTRL_SET_SIGALGS:
4391 return tls1_set_sigalgs(ctx->cert, parg, larg, 0);
4393 case SSL_CTRL_SET_SIGALGS_LIST:
4394 return tls1_set_sigalgs_list(ctx->cert, parg, 0);
4396 case SSL_CTRL_SET_CLIENT_SIGALGS:
4397 return tls1_set_sigalgs(ctx->cert, parg, larg, 1);
4399 case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
4400 return tls1_set_sigalgs_list(ctx->cert, parg, 1);
4402 case SSL_CTRL_SET_CLIENT_CERT_TYPES:
4403 return ssl3_set_req_cert_type(ctx->cert, parg, larg);
4405 case SSL_CTRL_BUILD_CERT_CHAIN:
4406 return ssl_build_cert_chain(NULL, ctx, larg);
4408 case SSL_CTRL_SET_VERIFY_CERT_STORE:
4409 return ssl_cert_set_cert_store(ctx->cert, parg, 0, larg);
4411 case SSL_CTRL_SET_CHAIN_CERT_STORE:
4412 return ssl_cert_set_cert_store(ctx->cert, parg, 1, larg);
4414 /* A Thawte special :-) */
4415 case SSL_CTRL_EXTRA_CHAIN_CERT:
4416 if (ctx->extra_certs == NULL) {
4417 if ((ctx->extra_certs = sk_X509_new_null()) == NULL)
4420 sk_X509_push(ctx->extra_certs, (X509 *)parg);
4423 case SSL_CTRL_GET_EXTRA_CHAIN_CERTS:
4424 if (ctx->extra_certs == NULL && larg == 0)
4425 *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
4427 *(STACK_OF(X509) **)parg = ctx->extra_certs;
4430 case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS:
4431 sk_X509_pop_free(ctx->extra_certs, X509_free);
4432 ctx->extra_certs = NULL;
4435 case SSL_CTRL_CHAIN:
4437 return ssl_cert_set1_chain(NULL, ctx, (STACK_OF(X509) *)parg);
4439 return ssl_cert_set0_chain(NULL, ctx, (STACK_OF(X509) *)parg);
4441 case SSL_CTRL_CHAIN_CERT:
4443 return ssl_cert_add1_chain_cert(NULL, ctx, (X509 *)parg);
4445 return ssl_cert_add0_chain_cert(NULL, ctx, (X509 *)parg);
4447 case SSL_CTRL_GET_CHAIN_CERTS:
4448 *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
4451 case SSL_CTRL_SELECT_CURRENT_CERT:
4452 return ssl_cert_select_current(ctx->cert, (X509 *)parg);
4454 case SSL_CTRL_SET_CURRENT_CERT:
4455 return ssl_cert_set_current(ctx->cert, larg);
4463 long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp) (void))
4466 #ifndef OPENSSL_NO_DH
4467 case SSL_CTRL_SET_TMP_DH_CB:
4469 ctx->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
4473 case SSL_CTRL_SET_TLSEXT_SERVERNAME_CB:
4474 ctx->tlsext_servername_callback = (int (*)(SSL *, int *, void *))fp;
4477 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB:
4478 ctx->tlsext_status_cb = (int (*)(SSL *, void *))fp;
4481 case SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB:
4482 ctx->tlsext_ticket_key_cb = (int (*)(SSL *, unsigned char *,
4485 HMAC_CTX *, int))fp;
4488 #ifndef OPENSSL_NO_SRP
4489 case SSL_CTRL_SET_SRP_VERIFY_PARAM_CB:
4490 ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4491 ctx->srp_ctx.SRP_verify_param_callback = (int (*)(SSL *, void *))fp;
4493 case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB:
4494 ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4495 ctx->srp_ctx.TLS_ext_srp_username_callback =
4496 (int (*)(SSL *, int *, void *))fp;
4498 case SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB:
4499 ctx->srp_ctx.srp_Mask |= SSL_kSRP;
4500 ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
4501 (char *(*)(SSL *, void *))fp;
4504 case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
4506 ctx->not_resumable_session_cb = (int (*)(SSL *, int))fp;
4516 * This function needs to check if the ciphers required are actually
4519 const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p)
4522 const SSL_CIPHER *cp;
4525 id = 0x03000000 | ((uint32_t)p[0] << 8L) | (uint32_t)p[1];
4527 cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS);
4528 #ifdef DEBUG_PRINT_UNKNOWN_CIPHERSUITES
4530 fprintf(stderr, "Unknown cipher ID %x\n", (p[0] << 8) | p[1]);
4535 int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
4541 if ((l & 0xff000000) != 0x03000000)
4543 p[0] = ((unsigned char)(l >> 8L)) & 0xFF;
4544 p[1] = ((unsigned char)(l)) & 0xFF;
4549 SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
4550 STACK_OF(SSL_CIPHER) *srvr)
4552 SSL_CIPHER *c, *ret = NULL;
4553 STACK_OF(SSL_CIPHER) *prio, *allow;
4555 unsigned long alg_k, alg_a, mask_k, mask_a;
4557 /* Let's see which ciphers we can support */
4561 * Do not set the compare functions, because this may lead to a
4562 * reordering by "id". We want to keep the original ordering. We may pay
4563 * a price in performance during sk_SSL_CIPHER_find(), but would have to
4564 * pay with the price of sk_SSL_CIPHER_dup().
4566 sk_SSL_CIPHER_set_cmp_func(srvr, ssl_cipher_ptr_id_cmp);
4567 sk_SSL_CIPHER_set_cmp_func(clnt, ssl_cipher_ptr_id_cmp);
4571 fprintf(stderr, "Server has %d from %p:\n", sk_SSL_CIPHER_num(srvr),
4573 for (i = 0; i < sk_SSL_CIPHER_num(srvr); ++i) {
4574 c = sk_SSL_CIPHER_value(srvr, i);
4575 fprintf(stderr, "%p:%s\n", (void *)c, c->name);
4577 fprintf(stderr, "Client sent %d from %p:\n", sk_SSL_CIPHER_num(clnt),
4579 for (i = 0; i < sk_SSL_CIPHER_num(clnt); ++i) {
4580 c = sk_SSL_CIPHER_value(clnt, i);
4581 fprintf(stderr, "%p:%s\n", (void *)c, c->name);
4585 if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE || tls1_suiteb(s)) {
4593 tls1_set_cert_validity(s);
4595 for (i = 0; i < sk_SSL_CIPHER_num(prio); i++) {
4596 c = sk_SSL_CIPHER_value(prio, i);
4598 /* Skip TLS v1.2 only ciphersuites if not supported */
4599 if ((c->algorithm_ssl & SSL_TLSV1_2) && !SSL_USE_TLS1_2_CIPHERS(s))
4601 /* Skip TLS v1.0 ciphersuites if SSLv3 */
4602 if ((c->algorithm_ssl & SSL_TLSV1) && s->version == SSL3_VERSION)
4605 ssl_set_masks(s, c);
4606 mask_k = s->s3->tmp.mask_k;
4607 mask_a = s->s3->tmp.mask_a;
4608 #ifndef OPENSSL_NO_SRP
4609 if (s->srp_ctx.srp_Mask & SSL_kSRP) {
4615 alg_k = c->algorithm_mkey;
4616 alg_a = c->algorithm_auth;
4618 #ifndef OPENSSL_NO_PSK
4619 /* with PSK there must be server callback set */
4620 if ((alg_k & SSL_PSK) && s->psk_server_callback == NULL)
4622 #endif /* OPENSSL_NO_PSK */
4624 ok = (alg_k & mask_k) && (alg_a & mask_a);
4626 fprintf(stderr, "%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n", ok, alg_k,
4627 alg_a, mask_k, mask_a, (void *)c, c->name);
4630 # ifndef OPENSSL_NO_EC
4632 * if we are considering an ECC cipher suite that uses an ephemeral
4635 if (alg_k & SSL_kECDHE)
4636 ok = ok && tls1_check_ec_tmp_key(s, c->id);
4637 # endif /* OPENSSL_NO_EC */
4641 ii = sk_SSL_CIPHER_find(allow, c);
4643 /* Check security callback permits this cipher */
4644 if (!ssl_security(s, SSL_SECOP_CIPHER_SHARED,
4645 c->strength_bits, 0, c))
4647 #if !defined(OPENSSL_NO_EC)
4648 if ((alg_k & SSL_kECDHE) && (alg_a & SSL_aECDSA)
4649 && s->s3->is_probably_safari) {
4651 ret = sk_SSL_CIPHER_value(allow, ii);
4655 ret = sk_SSL_CIPHER_value(allow, ii);
4662 int ssl3_get_req_cert_type(SSL *s, unsigned char *p)
4666 uint32_t alg_k, alg_a = 0;
4668 /* If we have custom certificate types set, use them */
4669 if (s->cert->ctypes) {
4670 memcpy(p, s->cert->ctypes, s->cert->ctype_num);
4671 return (int)s->cert->ctype_num;
4673 /* Get mask of algorithms disabled by signature list */
4674 ssl_set_sig_mask(&alg_a, s, SSL_SECOP_SIGALG_MASK);
4675 if (s->cert->cert_flags & SSL_CERT_FLAGS_CHECK_TLS_STRICT)
4678 alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
4680 #ifndef OPENSSL_NO_GOST
4681 if (s->version >= TLS1_VERSION) {
4682 if (alg_k & SSL_kGOST) {
4683 p[ret++] = TLS_CT_GOST01_SIGN;
4684 p[ret++] = TLS_CT_GOST12_SIGN;
4685 p[ret++] = TLS_CT_GOST12_512_SIGN;
4691 #ifndef OPENSSL_NO_DH
4692 if (alg_k & (SSL_kDHr | SSL_kDHE)) {
4693 # ifndef OPENSSL_NO_RSA
4695 * Since this refers to a certificate signed with an RSA algorithm,
4696 * only check for rsa signing in strict mode.
4698 if (nostrict || !(alg_a & SSL_aRSA))
4699 p[ret++] = SSL3_CT_RSA_FIXED_DH;
4701 # ifndef OPENSSL_NO_DSA
4702 if (nostrict || !(alg_a & SSL_aDSS))
4703 p[ret++] = SSL3_CT_DSS_FIXED_DH;
4706 if ((s->version == SSL3_VERSION) &&
4707 (alg_k & (SSL_kDHE | SSL_kDHd | SSL_kDHr))) {
4708 # ifndef OPENSSL_NO_RSA
4709 p[ret++] = SSL3_CT_RSA_EPHEMERAL_DH;
4711 # ifndef OPENSSL_NO_DSA
4712 p[ret++] = SSL3_CT_DSS_EPHEMERAL_DH;
4715 #endif /* !OPENSSL_NO_DH */
4716 #ifndef OPENSSL_NO_RSA
4717 if (!(alg_a & SSL_aRSA))
4718 p[ret++] = SSL3_CT_RSA_SIGN;
4720 #ifndef OPENSSL_NO_DSA
4721 if (!(alg_a & SSL_aDSS))
4722 p[ret++] = SSL3_CT_DSS_SIGN;
4724 #ifndef OPENSSL_NO_EC
4726 * ECDSA certs can be used with RSA cipher suites too so we don't
4727 * need to check for SSL_kECDH or SSL_kECDHE
4729 if (s->version >= TLS1_VERSION) {
4730 if (!(alg_a & SSL_aECDSA))
4731 p[ret++] = TLS_CT_ECDSA_SIGN;
4737 static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p, size_t len)
4739 OPENSSL_free(c->ctypes);
4745 c->ctypes = OPENSSL_malloc(len);
4746 if (c->ctypes == NULL)
4748 memcpy(c->ctypes, p, len);
4753 int ssl3_shutdown(SSL *s)
4758 * Don't do anything much if we have not done the handshake or we don't
4759 * want to send messages :-)
4761 if (s->quiet_shutdown || SSL_in_before(s)) {
4762 s->shutdown = (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
4766 if (!(s->shutdown & SSL_SENT_SHUTDOWN)) {
4767 s->shutdown |= SSL_SENT_SHUTDOWN;
4768 ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY);
4770 * our shutdown alert has been sent now, and if it still needs to be
4771 * written, s->s3->alert_dispatch will be true
4773 if (s->s3->alert_dispatch)
4774 return (-1); /* return WANT_WRITE */
4775 } else if (s->s3->alert_dispatch) {
4776 /* resend it if not sent */
4777 ret = s->method->ssl_dispatch_alert(s);
4780 * we only get to return -1 here the 2nd/Nth invocation, we must
4781 * have already signalled return 0 upon a previous invoation,
4786 } else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) {
4788 * If we are waiting for a close from our peer, we are closed
4790 s->method->ssl_read_bytes(s, 0, NULL, NULL, 0, 0);
4791 if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) {
4792 return (-1); /* return WANT_READ */
4796 if ((s->shutdown == (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN)) &&
4797 !s->s3->alert_dispatch)
4803 int ssl3_write(SSL *s, const void *buf, int len)
4806 if (s->s3->renegotiate)
4807 ssl3_renegotiate_check(s);
4809 return s->method->ssl_write_bytes(s, SSL3_RT_APPLICATION_DATA,
4813 static int ssl3_read_internal(SSL *s, void *buf, int len, int peek)
4818 if (s->s3->renegotiate)
4819 ssl3_renegotiate_check(s);
4820 s->s3->in_read_app_data = 1;
4822 s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf, len,
4824 if ((ret == -1) && (s->s3->in_read_app_data == 2)) {
4826 * ssl3_read_bytes decided to call s->handshake_func, which called
4827 * ssl3_read_bytes to read handshake data. However, ssl3_read_bytes
4828 * actually found application data and thinks that application data
4829 * makes sense here; so disable handshake processing and try to read
4830 * application data again.
4832 ossl_statem_set_in_handshake(s, 1);
4834 s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf,
4836 ossl_statem_set_in_handshake(s, 0);
4838 s->s3->in_read_app_data = 0;
4843 int ssl3_read(SSL *s, void *buf, int len)
4845 return ssl3_read_internal(s, buf, len, 0);
4848 int ssl3_peek(SSL *s, void *buf, int len)
4850 return ssl3_read_internal(s, buf, len, 1);
4853 int ssl3_renegotiate(SSL *s)
4855 if (s->handshake_func == NULL)
4858 if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)
4861 s->s3->renegotiate = 1;
4865 int ssl3_renegotiate_check(SSL *s)
4869 if (s->s3->renegotiate) {
4870 if (!RECORD_LAYER_read_pending(&s->rlayer)
4871 && !RECORD_LAYER_write_pending(&s->rlayer)
4872 && !SSL_in_init(s)) {
4874 * if we are the server, and we have sent a 'RENEGOTIATE'
4875 * message, we need to set the state machine into the renegotiate
4878 ossl_statem_set_renegotiate(s);
4879 s->s3->renegotiate = 0;
4880 s->s3->num_renegotiations++;
4881 s->s3->total_renegotiations++;
4889 * If we are using default SHA1+MD5 algorithms switch to new SHA256 PRF and
4890 * handshake macs if required.
4892 * If PSK and using SHA384 for TLS < 1.2 switch to default.
4894 long ssl_get_algorithm2(SSL *s)
4896 long alg2 = s->s3->tmp.new_cipher->algorithm2;
4897 if (s->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_SHA256_PRF) {
4898 if (alg2 == (SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF))
4899 return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256;
4900 } else if (s->s3->tmp.new_cipher->algorithm_mkey & SSL_PSK) {
4901 if (alg2 == (SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384))
4902 return SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF;
4908 * Fill a ClientRandom or ServerRandom field of length len. Returns <= 0 on
4909 * failure, 1 on success.
4911 int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, int len)
4918 send_time = (s->mode & SSL_MODE_SEND_SERVERHELLO_TIME) != 0;
4920 send_time = (s->mode & SSL_MODE_SEND_CLIENTHELLO_TIME) != 0;
4922 unsigned long Time = (unsigned long)time(NULL);
4923 unsigned char *p = result;
4925 return RAND_bytes(p, len - 4);
4927 return RAND_bytes(result, len);
4930 int ssl_generate_master_secret(SSL *s, unsigned char *pms, size_t pmslen,
4933 #ifndef OPENSSL_NO_PSK
4934 unsigned long alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
4935 if (alg_k & SSL_PSK) {
4936 unsigned char *pskpms, *t;
4937 size_t psklen = s->s3->tmp.psklen;
4940 /* create PSK premaster_secret */
4942 /* For plain PSK "other_secret" is psklen zeroes */
4943 if (alg_k & SSL_kPSK)
4946 pskpmslen = 4 + pmslen + psklen;
4947 pskpms = OPENSSL_malloc(pskpmslen);
4948 if (pskpms == NULL) {
4949 s->session->master_key_length = 0;
4954 if (alg_k & SSL_kPSK)
4955 memset(t, 0, pmslen);
4957 memcpy(t, pms, pmslen);
4960 memcpy(t, s->s3->tmp.psk, psklen);
4962 OPENSSL_clear_free(s->s3->tmp.psk, psklen);
4963 s->s3->tmp.psk = NULL;
4964 s->session->master_key_length =
4965 s->method->ssl3_enc->generate_master_secret(s,
4966 s->session->master_key,
4968 OPENSSL_clear_free(pskpms, pskpmslen);
4971 s->session->master_key_length =
4972 s->method->ssl3_enc->generate_master_secret(s,
4973 s->session->master_key,
4975 #ifndef OPENSSL_NO_PSK
4980 OPENSSL_clear_free(pms, pmslen);
4982 OPENSSL_cleanse(pms, pmslen);
4985 s->s3->tmp.pms = NULL;
4986 return s->session->master_key_length >= 0;