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 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
;
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
);
3776 #ifndef OPENSSL_NO_SRP
3777 SSL_SRP_CTX_free(s
);
3779 OPENSSL_clear_free(s
->s3
, sizeof(*s
->s3
));
3783 void ssl3_clear(SSL
*s
)
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
;
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
;
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 */
3810 init_extra
= s
->s3
->init_extra
;
3811 ssl3_free_digest_list(s
);
3813 if (s
->s3
->alpn_selected
) {
3814 OPENSSL_free(s
->s3
->alpn_selected
);
3815 s
->s3
->alpn_selected
= NULL
;
3818 memset(s
->s3
, 0, sizeof(*s
->s3
));
3819 s
->s3
->init_extra
= init_extra
;
3821 ssl_free_wbio_buffer(s
);
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
;
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;
3836 #ifndef OPENSSL_NO_SRP
3837 static char *srp_password_from_info_cb(SSL
*s
, void *arg
)
3839 return OPENSSL_strdup(s
->srp_ctx
.info
);
3843 static int ssl3_set_req_cert_type(CERT
*c
, const unsigned char *p
,
3846 long ssl3_ctrl(SSL
*s
, int cmd
, long larg
, void *parg
)
3851 case SSL_CTRL_GET_SESSION_REUSED
:
3854 case SSL_CTRL_GET_CLIENT_CERT_REQUEST
:
3856 case SSL_CTRL_GET_NUM_RENEGOTIATIONS
:
3857 ret
= s
->s3
->num_renegotiations
;
3859 case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS
:
3860 ret
= s
->s3
->num_renegotiations
;
3861 s
->s3
->num_renegotiations
= 0;
3863 case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS
:
3864 ret
= s
->s3
->total_renegotiations
;
3866 case SSL_CTRL_GET_FLAGS
:
3867 ret
= (int)(s
->s3
->flags
);
3869 #ifndef OPENSSL_NO_DH
3870 case SSL_CTRL_SET_TMP_DH
:
3872 DH
*dh
= (DH
*)parg
;
3874 SSLerr(SSL_F_SSL3_CTRL
, ERR_R_PASSED_NULL_PARAMETER
);
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
);
3882 if ((dh
= DHparams_dup(dh
)) == NULL
) {
3883 SSLerr(SSL_F_SSL3_CTRL
, ERR_R_DH_LIB
);
3886 if (!(s
->options
& SSL_OP_SINGLE_DH_USE
)) {
3887 if (!DH_generate_key(dh
)) {
3889 SSLerr(SSL_F_SSL3_CTRL
, ERR_R_DH_LIB
);
3893 DH_free(s
->cert
->dh_tmp
);
3894 s
->cert
->dh_tmp
= dh
;
3898 case SSL_CTRL_SET_TMP_DH_CB
:
3900 SSLerr(SSL_F_SSL3_CTRL
, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED
);
3903 case SSL_CTRL_SET_DH_AUTO
:
3904 s
->cert
->dh_tmp_auto
= larg
;
3907 #ifndef OPENSSL_NO_EC
3908 case SSL_CTRL_SET_TMP_ECDH
:
3910 const EC_GROUP
*group
= NULL
;
3914 SSLerr(SSL_F_SSL3_CTRL
, ERR_R_PASSED_NULL_PARAMETER
);
3917 group
= EC_KEY_get0_group((const EC_KEY
*)parg
);
3918 if (group
== NULL
) {
3919 SSLerr(SSL_F_SSL3_CTRL
, EC_R_MISSING_PARAMETERS
);
3922 nid
= EC_GROUP_get_curve_name(group
);
3923 if (nid
== NID_undef
)
3925 return tls1_set_curves(&s
->tlsext_ellipticcurvelist
,
3926 &s
->tlsext_ellipticcurvelist_length
,
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
;
3939 if (strlen((char *)parg
) > TLSEXT_MAXLEN_host_name
) {
3940 SSLerr(SSL_F_SSL3_CTRL
, SSL_R_SSL3_EXT_INVALID_SERVERNAME
);
3943 if ((s
->tlsext_hostname
= OPENSSL_strdup((char *)parg
)) == NULL
) {
3944 SSLerr(SSL_F_SSL3_CTRL
, ERR_R_INTERNAL_ERROR
);
3948 SSLerr(SSL_F_SSL3_CTRL
, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE
);
3952 case SSL_CTRL_SET_TLSEXT_DEBUG_ARG
:
3953 s
->tlsext_debug_arg
= parg
;
3957 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE
:
3958 s
->tlsext_status_type
= larg
;
3962 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS
:
3963 *(STACK_OF(X509_EXTENSION
) **)parg
= s
->tlsext_ocsp_exts
;
3967 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS
:
3968 s
->tlsext_ocsp_exts
= parg
;
3972 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS
:
3973 *(STACK_OF(OCSP_RESPID
) **)parg
= s
->tlsext_ocsp_ids
;
3977 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS
:
3978 s
->tlsext_ocsp_ids
= parg
;
3982 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP
:
3983 *(unsigned char **)parg
= s
->tlsext_ocsp_resp
;
3984 return s
->tlsext_ocsp_resplen
;
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
;
3993 #ifndef OPENSSL_NO_HEARTBEATS
3994 case SSL_CTRL_TLS_EXT_SEND_HEARTBEAT
:
3996 ret
= dtls1_heartbeat(s
);
3998 ret
= tls1_heartbeat(s
);
4001 case SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING
:
4002 ret
= s
->tlsext_hb_pending
;
4005 case SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS
:
4007 s
->tlsext_heartbeat
|= SSL_TLSEXT_HB_DONT_RECV_REQUESTS
;
4009 s
->tlsext_heartbeat
&= ~SSL_TLSEXT_HB_DONT_RECV_REQUESTS
;
4014 case SSL_CTRL_CHAIN
:
4016 return ssl_cert_set1_chain(s
, NULL
, (STACK_OF(X509
) *)parg
);
4018 return ssl_cert_set0_chain(s
, NULL
, (STACK_OF(X509
) *)parg
);
4020 case SSL_CTRL_CHAIN_CERT
:
4022 return ssl_cert_add1_chain_cert(s
, NULL
, (X509
*)parg
);
4024 return ssl_cert_add0_chain_cert(s
, NULL
, (X509
*)parg
);
4026 case SSL_CTRL_GET_CHAIN_CERTS
:
4027 *(STACK_OF(X509
) **)parg
= s
->cert
->key
->chain
;
4030 case SSL_CTRL_SELECT_CURRENT_CERT
:
4031 return ssl_cert_select_current(s
->cert
, (X509
*)parg
);
4033 case SSL_CTRL_SET_CURRENT_CERT
:
4034 if (larg
== SSL_CERT_SET_SERVER
) {
4036 const SSL_CIPHER
*cipher
;
4039 cipher
= s
->s3
->tmp
.new_cipher
;
4043 * No certificate for unauthenticated ciphersuites or using SRP
4046 if (cipher
->algorithm_auth
& (SSL_aNULL
| SSL_aSRP
))
4048 cpk
= ssl_get_server_send_pkey(s
);
4054 return ssl_cert_set_current(s
->cert
, larg
);
4056 #ifndef OPENSSL_NO_EC
4057 case SSL_CTRL_GET_CURVES
:
4059 unsigned char *clist
;
4063 clist
= s
->session
->tlsext_ellipticcurvelist
;
4064 clistlen
= s
->session
->tlsext_ellipticcurvelist_length
/ 2;
4068 unsigned int cid
, nid
;
4069 for (i
= 0; i
< clistlen
; i
++) {
4071 nid
= tls1_ec_curve_id2nid(cid
);
4075 cptr
[i
] = TLSEXT_nid_unknown
| cid
;
4078 return (int)clistlen
;
4081 case SSL_CTRL_SET_CURVES
:
4082 return tls1_set_curves(&s
->tlsext_ellipticcurvelist
,
4083 &s
->tlsext_ellipticcurvelist_length
,
4086 case SSL_CTRL_SET_CURVES_LIST
:
4087 return tls1_set_curves_list(&s
->tlsext_ellipticcurvelist
,
4088 &s
->tlsext_ellipticcurvelist_length
,
4091 case SSL_CTRL_GET_SHARED_CURVE
:
4092 return tls1_shared_curve(s
, larg
);
4095 case SSL_CTRL_SET_SIGALGS
:
4096 return tls1_set_sigalgs(s
->cert
, parg
, larg
, 0);
4098 case SSL_CTRL_SET_SIGALGS_LIST
:
4099 return tls1_set_sigalgs_list(s
->cert
, parg
, 0);
4101 case SSL_CTRL_SET_CLIENT_SIGALGS
:
4102 return tls1_set_sigalgs(s
->cert
, parg
, larg
, 1);
4104 case SSL_CTRL_SET_CLIENT_SIGALGS_LIST
:
4105 return tls1_set_sigalgs_list(s
->cert
, parg
, 1);
4107 case SSL_CTRL_GET_CLIENT_CERT_TYPES
:
4109 const unsigned char **pctype
= parg
;
4110 if (s
->server
|| !s
->s3
->tmp
.cert_req
)
4112 if (s
->cert
->ctypes
) {
4114 *pctype
= s
->cert
->ctypes
;
4115 return (int)s
->cert
->ctype_num
;
4118 *pctype
= (unsigned char *)s
->s3
->tmp
.ctype
;
4119 return s
->s3
->tmp
.ctype_num
;
4122 case SSL_CTRL_SET_CLIENT_CERT_TYPES
:
4125 return ssl3_set_req_cert_type(s
->cert
, parg
, larg
);
4127 case SSL_CTRL_BUILD_CERT_CHAIN
:
4128 return ssl_build_cert_chain(s
, NULL
, larg
);
4130 case SSL_CTRL_SET_VERIFY_CERT_STORE
:
4131 return ssl_cert_set_cert_store(s
->cert
, parg
, 0, larg
);
4133 case SSL_CTRL_SET_CHAIN_CERT_STORE
:
4134 return ssl_cert_set_cert_store(s
->cert
, parg
, 1, larg
);
4136 case SSL_CTRL_GET_PEER_SIGNATURE_NID
:
4137 if (SSL_USE_SIGALGS(s
)) {
4140 sig
= s
->s3
->tmp
.peer_md
;
4142 *(int *)parg
= EVP_MD_type(sig
);
4148 /* Might want to do something here for other versions */
4152 case SSL_CTRL_GET_SERVER_TMP_KEY
:
4153 if (s
->server
|| !s
->session
)
4158 #if !defined(OPENSSL_NO_DH) && !defined(OPENSSL_NO_EC)
4159 if (s
->s3
->peer_dh_tmp
== NULL
&& s
->s3
->peer_tmp
== NULL
)
4162 ptmp
= EVP_PKEY_new();
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
);
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
));
4175 *(EVP_PKEY
**)parg
= ptmp
;
4178 EVP_PKEY_free(ptmp
);
4181 #ifndef OPENSSL_NO_EC
4182 case SSL_CTRL_GET_EC_POINT_FORMATS
:
4184 SSL_SESSION
*sess
= s
->session
;
4185 const unsigned char **pformat
= parg
;
4186 if (!sess
|| !sess
->tlsext_ecpointformatlist
)
4188 *pformat
= sess
->tlsext_ecpointformatlist
;
4189 return (int)sess
->tlsext_ecpointformatlist_length
;
4193 case SSL_CTRL_CHECK_PROTO_VERSION
:
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).
4199 if (s
->version
== s
->ctx
->method
->version
)
4202 * Apparently we're using a version-flexible SSL_METHOD (not at its
4203 * highest protocol version).
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.
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
;
4218 return 0; /* Unexpected state; fail closed. */
4226 long ssl3_callback_ctrl(SSL
*s
, int cmd
, void (*fp
) (void))
4231 #ifndef OPENSSL_NO_DH
4232 case SSL_CTRL_SET_TMP_DH_CB
:
4234 s
->cert
->dh_tmp_cb
= (DH
*(*)(SSL
*, int, int))fp
;
4238 case SSL_CTRL_SET_TLSEXT_DEBUG_CB
:
4239 s
->tlsext_debug_cb
= (void (*)(SSL
*, int, int,
4240 unsigned char *, int, void *))fp
;
4243 case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB
:
4245 s
->not_resumable_session_cb
= (int (*)(SSL
*, int))fp
;
4254 long ssl3_ctx_ctrl(SSL_CTX
*ctx
, int cmd
, long larg
, void *parg
)
4257 #ifndef OPENSSL_NO_DH
4258 case SSL_CTRL_SET_TMP_DH
:
4260 DH
*new = NULL
, *dh
;
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
);
4270 if ((new = DHparams_dup(dh
)) == NULL
) {
4271 SSLerr(SSL_F_SSL3_CTX_CTRL
, ERR_R_DH_LIB
);
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
);
4281 DH_free(cert
->dh_tmp
);
4288 case SSL_CTRL_SET_TMP_DH_CB
:
4290 SSLerr(SSL_F_SSL3_CTX_CTRL
, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED
);
4293 case SSL_CTRL_SET_DH_AUTO
:
4294 ctx
->cert
->dh_tmp_auto
= larg
;
4297 #ifndef OPENSSL_NO_EC
4298 case SSL_CTRL_SET_TMP_ECDH
:
4300 const EC_GROUP
*group
= NULL
;
4304 SSLerr(SSL_F_SSL3_CTX_CTRL
, ERR_R_PASSED_NULL_PARAMETER
);
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
);
4312 nid
= EC_GROUP_get_curve_name(group
);
4313 if (nid
== NID_undef
)
4315 return tls1_set_curves(&ctx
->tlsext_ellipticcurvelist
,
4316 &ctx
->tlsext_ellipticcurvelist_length
,
4320 #endif /* !OPENSSL_NO_EC */
4321 case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG
:
4322 ctx
->tlsext_servername_arg
= parg
;
4324 case SSL_CTRL_SET_TLSEXT_TICKET_KEYS
:
4325 case SSL_CTRL_GET_TLSEXT_TICKET_KEYS
:
4327 unsigned char *keys
= parg
;
4331 SSLerr(SSL_F_SSL3_CTX_CTRL
, SSL_R_INVALID_TICKET_KEYS_LENGTH
);
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);
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);
4346 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG
:
4347 ctx
->tlsext_status_arg
= parg
;
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
;
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
);
4362 if ((ctx
->srp_ctx
.login
= OPENSSL_strdup((char *)parg
)) == NULL
) {
4363 SSLerr(SSL_F_SSL3_CTX_CTRL
, ERR_R_INTERNAL_ERROR
);
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
;
4372 case SSL_CTRL_SET_SRP_ARG
:
4373 ctx
->srp_ctx
.srp_Mask
|= SSL_kSRP
;
4374 ctx
->srp_ctx
.SRP_cb_arg
= parg
;
4377 case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH
:
4378 ctx
->srp_ctx
.strength
= larg
;
4382 #ifndef OPENSSL_NO_EC
4383 case SSL_CTRL_SET_CURVES
:
4384 return tls1_set_curves(&ctx
->tlsext_ellipticcurvelist
,
4385 &ctx
->tlsext_ellipticcurvelist_length
,
4388 case SSL_CTRL_SET_CURVES_LIST
:
4389 return tls1_set_curves_list(&ctx
->tlsext_ellipticcurvelist
,
4390 &ctx
->tlsext_ellipticcurvelist_length
,
4393 case SSL_CTRL_SET_SIGALGS
:
4394 return tls1_set_sigalgs(ctx
->cert
, parg
, larg
, 0);
4396 case SSL_CTRL_SET_SIGALGS_LIST
:
4397 return tls1_set_sigalgs_list(ctx
->cert
, parg
, 0);
4399 case SSL_CTRL_SET_CLIENT_SIGALGS
:
4400 return tls1_set_sigalgs(ctx
->cert
, parg
, larg
, 1);
4402 case SSL_CTRL_SET_CLIENT_SIGALGS_LIST
:
4403 return tls1_set_sigalgs_list(ctx
->cert
, parg
, 1);
4405 case SSL_CTRL_SET_CLIENT_CERT_TYPES
:
4406 return ssl3_set_req_cert_type(ctx
->cert
, parg
, larg
);
4408 case SSL_CTRL_BUILD_CERT_CHAIN
:
4409 return ssl_build_cert_chain(NULL
, ctx
, larg
);
4411 case SSL_CTRL_SET_VERIFY_CERT_STORE
:
4412 return ssl_cert_set_cert_store(ctx
->cert
, parg
, 0, larg
);
4414 case SSL_CTRL_SET_CHAIN_CERT_STORE
:
4415 return ssl_cert_set_cert_store(ctx
->cert
, parg
, 1, larg
);
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
)
4423 sk_X509_push(ctx
->extra_certs
, (X509
*)parg
);
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
;
4430 *(STACK_OF(X509
) **)parg
= ctx
->extra_certs
;
4433 case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS
:
4434 sk_X509_pop_free(ctx
->extra_certs
, X509_free
);
4435 ctx
->extra_certs
= NULL
;
4438 case SSL_CTRL_CHAIN
:
4440 return ssl_cert_set1_chain(NULL
, ctx
, (STACK_OF(X509
) *)parg
);
4442 return ssl_cert_set0_chain(NULL
, ctx
, (STACK_OF(X509
) *)parg
);
4444 case SSL_CTRL_CHAIN_CERT
:
4446 return ssl_cert_add1_chain_cert(NULL
, ctx
, (X509
*)parg
);
4448 return ssl_cert_add0_chain_cert(NULL
, ctx
, (X509
*)parg
);
4450 case SSL_CTRL_GET_CHAIN_CERTS
:
4451 *(STACK_OF(X509
) **)parg
= ctx
->cert
->key
->chain
;
4454 case SSL_CTRL_SELECT_CURRENT_CERT
:
4455 return ssl_cert_select_current(ctx
->cert
, (X509
*)parg
);
4457 case SSL_CTRL_SET_CURRENT_CERT
:
4458 return ssl_cert_set_current(ctx
->cert
, larg
);
4466 long ssl3_ctx_callback_ctrl(SSL_CTX
*ctx
, int cmd
, void (*fp
) (void))
4469 #ifndef OPENSSL_NO_DH
4470 case SSL_CTRL_SET_TMP_DH_CB
:
4472 ctx
->cert
->dh_tmp_cb
= (DH
*(*)(SSL
*, int, int))fp
;
4476 case SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
:
4477 ctx
->tlsext_servername_callback
= (int (*)(SSL
*, int *, void *))fp
;
4480 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB
:
4481 ctx
->tlsext_status_cb
= (int (*)(SSL
*, void *))fp
;
4484 case SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB
:
4485 ctx
->tlsext_ticket_key_cb
= (int (*)(SSL
*, unsigned char *,
4488 HMAC_CTX
*, int))fp
;
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
;
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
;
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
;
4507 case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB
:
4509 ctx
->not_resumable_session_cb
= (int (*)(SSL
*, int))fp
;
4519 * This function needs to check if the ciphers required are actually
4522 const SSL_CIPHER
*ssl3_get_cipher_by_char(const unsigned char *p
)
4525 const SSL_CIPHER
*cp
;
4528 id
= 0x03000000 | ((uint32_t)p
[0] << 8L) | (uint32_t)p
[1];
4530 cp
= OBJ_bsearch_ssl_cipher_id(&c
, ssl3_ciphers
, SSL3_NUM_CIPHERS
);
4531 #ifdef DEBUG_PRINT_UNKNOWN_CIPHERSUITES
4533 fprintf(stderr
, "Unknown cipher ID %x\n", (p
[0] << 8) | p
[1]);
4538 int ssl3_put_cipher_by_char(const SSL_CIPHER
*c
, unsigned char *p
)
4544 if ((l
& 0xff000000) != 0x03000000)
4546 p
[0] = ((unsigned char)(l
>> 8L)) & 0xFF;
4547 p
[1] = ((unsigned char)(l
)) & 0xFF;
4552 SSL_CIPHER
*ssl3_choose_cipher(SSL
*s
, STACK_OF(SSL_CIPHER
) *clnt
,
4553 STACK_OF(SSL_CIPHER
) *srvr
)
4555 SSL_CIPHER
*c
, *ret
= NULL
;
4556 STACK_OF(SSL_CIPHER
) *prio
, *allow
;
4558 unsigned long alg_k
, alg_a
, mask_k
, mask_a
;
4560 /* Let's see which ciphers we can support */
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().
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
);
4574 fprintf(stderr
, "Server has %d from %p:\n", sk_SSL_CIPHER_num(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
);
4580 fprintf(stderr
, "Client sent %d from %p:\n", sk_SSL_CIPHER_num(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
);
4588 if (s
->options
& SSL_OP_CIPHER_SERVER_PREFERENCE
|| tls1_suiteb(s
)) {
4596 tls1_set_cert_validity(s
);
4598 for (i
= 0; i
< sk_SSL_CIPHER_num(prio
); i
++) {
4599 c
= sk_SSL_CIPHER_value(prio
, i
);
4601 /* Skip TLS v1.2 only ciphersuites if not supported */
4602 if ((c
->algorithm_ssl
& SSL_TLSV1_2
) && !SSL_USE_TLS1_2_CIPHERS(s
))
4604 /* Skip TLS v1.0 ciphersuites if SSLv3 */
4605 if ((c
->algorithm_ssl
& SSL_TLSV1
) && s
->version
== SSL3_VERSION
)
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
) {
4618 alg_k
= c
->algorithm_mkey
;
4619 alg_a
= c
->algorithm_auth
;
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
)
4625 #endif /* OPENSSL_NO_PSK */
4627 ok
= (alg_k
& mask_k
) && (alg_a
& mask_a
);
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
);
4633 # ifndef OPENSSL_NO_EC
4635 * if we are considering an ECC cipher suite that uses an ephemeral
4638 if (alg_k
& SSL_kECDHE
)
4639 ok
= ok
&& tls1_check_ec_tmp_key(s
, c
->id
);
4640 # endif /* OPENSSL_NO_EC */
4644 ii
= sk_SSL_CIPHER_find(allow
, c
);
4646 /* Check security callback permits this cipher */
4647 if (!ssl_security(s
, SSL_SECOP_CIPHER_SHARED
,
4648 c
->strength_bits
, 0, c
))
4650 #if !defined(OPENSSL_NO_EC)
4651 if ((alg_k
& SSL_kECDHE
) && (alg_a
& SSL_aECDSA
)
4652 && s
->s3
->is_probably_safari
) {
4654 ret
= sk_SSL_CIPHER_value(allow
, ii
);
4658 ret
= sk_SSL_CIPHER_value(allow
, ii
);
4665 int ssl3_get_req_cert_type(SSL
*s
, unsigned char *p
)
4669 uint32_t alg_k
, alg_a
= 0;
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
;
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
)
4681 alg_k
= s
->s3
->tmp
.new_cipher
->algorithm_mkey
;
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
;
4694 #ifndef OPENSSL_NO_DH
4695 if (alg_k
& (SSL_kDHr
| SSL_kDHE
)) {
4696 # ifndef OPENSSL_NO_RSA
4698 * Since this refers to a certificate signed with an RSA algorithm,
4699 * only check for rsa signing in strict mode.
4701 if (nostrict
|| !(alg_a
& SSL_aRSA
))
4702 p
[ret
++] = SSL3_CT_RSA_FIXED_DH
;
4704 # ifndef OPENSSL_NO_DSA
4705 if (nostrict
|| !(alg_a
& SSL_aDSS
))
4706 p
[ret
++] = SSL3_CT_DSS_FIXED_DH
;
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
;
4714 # ifndef OPENSSL_NO_DSA
4715 p
[ret
++] = SSL3_CT_DSS_EPHEMERAL_DH
;
4718 #endif /* !OPENSSL_NO_DH */
4719 #ifndef OPENSSL_NO_RSA
4720 if (!(alg_a
& SSL_aRSA
))
4721 p
[ret
++] = SSL3_CT_RSA_SIGN
;
4723 #ifndef OPENSSL_NO_DSA
4724 if (!(alg_a
& SSL_aDSS
))
4725 p
[ret
++] = SSL3_CT_DSS_SIGN
;
4727 #ifndef OPENSSL_NO_EC
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
4732 if (s
->version
>= TLS1_VERSION
) {
4733 if (!(alg_a
& SSL_aECDSA
))
4734 p
[ret
++] = TLS_CT_ECDSA_SIGN
;
4740 static int ssl3_set_req_cert_type(CERT
*c
, const unsigned char *p
, size_t len
)
4742 OPENSSL_free(c
->ctypes
);
4748 c
->ctypes
= OPENSSL_malloc(len
);
4749 if (c
->ctypes
== NULL
)
4751 memcpy(c
->ctypes
, p
, len
);
4756 int ssl3_shutdown(SSL
*s
)
4761 * Don't do anything much if we have not done the handshake or we don't
4762 * want to send messages :-)
4764 if (s
->quiet_shutdown
|| SSL_in_before(s
)) {
4765 s
->shutdown
= (SSL_SENT_SHUTDOWN
| SSL_RECEIVED_SHUTDOWN
);
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
);
4773 * our shutdown alert has been sent now, and if it still needs to be
4774 * written, s->s3->alert_dispatch will be true
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
);
4783 * we only get to return -1 here the 2nd/Nth invocation, we must
4784 * have already signalled return 0 upon a previous invoation,
4789 } else if (!(s
->shutdown
& SSL_RECEIVED_SHUTDOWN
)) {
4791 * If we are waiting for a close from our peer, we are closed
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 */
4799 if ((s
->shutdown
== (SSL_SENT_SHUTDOWN
| SSL_RECEIVED_SHUTDOWN
)) &&
4800 !s
->s3
->alert_dispatch
)
4806 int ssl3_write(SSL
*s
, const void *buf
, int len
)
4809 if (s
->s3
->renegotiate
)
4810 ssl3_renegotiate_check(s
);
4812 return s
->method
->ssl_write_bytes(s
, SSL3_RT_APPLICATION_DATA
,
4816 static int ssl3_read_internal(SSL
*s
, void *buf
, int len
, int peek
)
4821 if (s
->s3
->renegotiate
)
4822 ssl3_renegotiate_check(s
);
4823 s
->s3
->in_read_app_data
= 1;
4825 s
->method
->ssl_read_bytes(s
, SSL3_RT_APPLICATION_DATA
, NULL
, buf
, len
,
4827 if ((ret
== -1) && (s
->s3
->in_read_app_data
== 2)) {
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.
4835 ossl_statem_set_in_handshake(s
, 1);
4837 s
->method
->ssl_read_bytes(s
, SSL3_RT_APPLICATION_DATA
, NULL
, buf
,
4839 ossl_statem_set_in_handshake(s
, 0);
4841 s
->s3
->in_read_app_data
= 0;
4846 int ssl3_read(SSL
*s
, void *buf
, int len
)
4848 return ssl3_read_internal(s
, buf
, len
, 0);
4851 int ssl3_peek(SSL
*s
, void *buf
, int len
)
4853 return ssl3_read_internal(s
, buf
, len
, 1);
4856 int ssl3_renegotiate(SSL
*s
)
4858 if (s
->handshake_func
== NULL
)
4861 if (s
->s3
->flags
& SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS
)
4864 s
->s3
->renegotiate
= 1;
4868 int ssl3_renegotiate_check(SSL
*s
)
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
)) {
4877 * if we are the server, and we have sent a 'RENEGOTIATE'
4878 * message, we need to set the state machine into the renegotiate
4881 ossl_statem_set_renegotiate(s
);
4882 s
->s3
->renegotiate
= 0;
4883 s
->s3
->num_renegotiations
++;
4884 s
->s3
->total_renegotiations
++;
4892 * If we are using default SHA1+MD5 algorithms switch to new SHA256 PRF and
4893 * handshake macs if required.
4895 * If PSK and using SHA384 for TLS < 1.2 switch to default.
4897 long ssl_get_algorithm2(SSL
*s
)
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
;
4911 * Fill a ClientRandom or ServerRandom field of length len. Returns <= 0 on
4912 * failure, 1 on success.
4914 int ssl_fill_hello_random(SSL
*s
, int server
, unsigned char *result
, int len
)
4921 send_time
= (s
->mode
& SSL_MODE_SEND_SERVERHELLO_TIME
) != 0;
4923 send_time
= (s
->mode
& SSL_MODE_SEND_CLIENTHELLO_TIME
) != 0;
4925 unsigned long Time
= (unsigned long)time(NULL
);
4926 unsigned char *p
= result
;
4928 return RAND_bytes(p
, len
- 4);
4930 return RAND_bytes(result
, len
);
4933 int ssl_generate_master_secret(SSL
*s
, unsigned char *pms
, size_t pmslen
,
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
;
4943 /* create PSK premaster_secret */
4945 /* For plain PSK "other_secret" is psklen zeroes */
4946 if (alg_k
& SSL_kPSK
)
4949 pskpmslen
= 4 + pmslen
+ psklen
;
4950 pskpms
= OPENSSL_malloc(pskpmslen
);
4951 if (pskpms
== NULL
) {
4952 s
->session
->master_key_length
= 0;
4957 if (alg_k
& SSL_kPSK
)
4958 memset(t
, 0, pmslen
);
4960 memcpy(t
, pms
, pmslen
);
4963 memcpy(t
, s
->s3
->tmp
.psk
, psklen
);
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
,
4971 OPENSSL_clear_free(pskpms
, pskpmslen
);
4974 s
->session
->master_key_length
=
4975 s
->method
->ssl3_enc
->generate_master_secret(s
,
4976 s
->session
->master_key
,
4978 #ifndef OPENSSL_NO_PSK
4983 OPENSSL_clear_free(pms
, pmslen
);
4985 OPENSSL_cleanse(pms
, pmslen
);
4988 s
->s3
->tmp
.pms
= NULL
;
4989 return s
->session
->master_key_length
>= 0;
4992 /* Generate a private key from parameters or a curve NID */
4993 EVP_PKEY
*ssl_generate_pkey(EVP_PKEY
*pm
, int nid
)
4995 EVP_PKEY_CTX
*pctx
= NULL
;
4996 EVP_PKEY
*pkey
= NULL
;
4998 pctx
= EVP_PKEY_CTX_new(pm
, NULL
);
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.
5005 pctx
= EVP_PKEY_CTX_new_id(EVP_PKEY_EC
, NULL
);
5009 if (EVP_PKEY_keygen_init(pctx
) <= 0)
5011 #ifndef OPENSSL_NO_EC
5012 if (pm
== NULL
&& EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx
, nid
) <= 0)
5016 if (EVP_PKEY_keygen(pctx
, &pkey
) <= 0) {
5017 EVP_PKEY_free(pkey
);
5022 EVP_PKEY_CTX_free(pctx
);
5025 /* Derive premaster or master secret for ECDH/DH */
5026 int ssl_derive(SSL
*s
, EVP_PKEY
*privkey
, EVP_PKEY
*pubkey
)
5029 unsigned char *pms
= NULL
;
5033 if (privkey
== NULL
|| pubkey
== NULL
)
5036 pctx
= EVP_PKEY_CTX_new(privkey
, NULL
);
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) {
5044 pms
= OPENSSL_malloc(pmslen
);
5048 if (EVP_PKEY_derive(pctx
, pms
, &pmslen
) <= 0)
5052 /* For server generate master secret and discard premaster */
5053 rv
= ssl_generate_master_secret(s
, pms
, pmslen
, 1);
5056 /* For client just save premaster secret */
5057 s
->s3
->tmp
.pms
= pms
;
5058 s
->s3
->tmp
.pmslen
= pmslen
;
5064 OPENSSL_clear_free(pms
, pmslen
);
5065 EVP_PKEY_CTX_free(pctx
);