s3_lib.c 122.5 KB
Newer Older
R
Rich Salz 已提交
1
/*
M
Matt Caswell 已提交
2
 * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
3
 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
4
 * Copyright 2005 Nokia. All rights reserved.
B
Bodo Möller 已提交
5
 *
R
Rich Salz 已提交
6 7 8 9
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
B
Bodo Möller 已提交
10
 */
R
Rich Salz 已提交
11

12
#include <stdio.h>
13
#include <openssl/objects.h>
14
#include "internal/nelem.h"
15
#include "ssl_locl.h"
16
#include <openssl/md5.h>
R
Rich Salz 已提交
17
#include <openssl/dh.h>
18
#include <openssl/rand.h>
R
Rich Salz 已提交
19
#include "internal/cryptlib.h"
20

D
Dr. Stephen Henson 已提交
21
#define SSL3_NUM_CIPHERS        OSSL_NELEM(ssl3_ciphers)
22
#define SSL3_NUM_SCSVS          OSSL_NELEM(ssl3_scsvs)
23

24 25 26 27 28 29 30 31
/* TLSv1.3 downgrade protection sentinel values */
const unsigned char tls11downgrade[] = {
    0x44, 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x00
};
const unsigned char tls12downgrade[] = {
    0x44, 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x01
};

R
Rich Salz 已提交
32
/*
R
Rich Salz 已提交
33
 * The list of available ciphers, mostly organized into the following
R
Rich Salz 已提交
34 35 36 37 38
 * groups:
 *      Always there
 *      EC
 *      PSK
 *      SRP (within that: RSA EC PSK)
P
Pauli 已提交
39
 *      Cipher families: Chacha/poly, Camellia, Gost, IDEA, SEED
R
Rich Salz 已提交
40 41
 *      Weak ciphers
 */
E
Emilia Kasper 已提交
42
static SSL_CIPHER ssl3_ciphers[] = {
43 44 45
    {
     1,
     SSL3_TXT_RSA_NULL_MD5,
46
     SSL3_RFC_RSA_NULL_MD5,
47 48 49 50 51
     SSL3_CK_RSA_NULL_MD5,
     SSL_kRSA,
     SSL_aRSA,
     SSL_eNULL,
     SSL_MD5,
52
     SSL3_VERSION, TLS1_2_VERSION,
53
     DTLS1_BAD_VER, DTLS1_2_VERSION,
54
     SSL_STRONG_NONE,
55 56 57 58 59 60 61
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
     },
    {
     1,
     SSL3_TXT_RSA_NULL_SHA,
62
     SSL3_RFC_RSA_NULL_SHA,
63 64 65 66 67
     SSL3_CK_RSA_NULL_SHA,
     SSL_kRSA,
     SSL_aRSA,
     SSL_eNULL,
     SSL_SHA1,
68
     SSL3_VERSION, TLS1_2_VERSION,
69
     DTLS1_BAD_VER, DTLS1_2_VERSION,
70
     SSL_STRONG_NONE | SSL_FIPS,
71 72 73 74
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
     },
75
#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
76 77 78
    {
     1,
     SSL3_TXT_RSA_DES_192_CBC3_SHA,
79
     SSL3_RFC_RSA_DES_192_CBC3_SHA,
80 81 82 83 84
     SSL3_CK_RSA_DES_192_CBC3_SHA,
     SSL_kRSA,
     SSL_aRSA,
     SSL_3DES,
     SSL_SHA1,
85
     SSL3_VERSION, TLS1_2_VERSION,
86
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
87
     SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
88 89 90 91 92 93 94
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
    {
     1,
     SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA,
95
     SSL3_RFC_DHE_DSS_DES_192_CBC3_SHA,
96 97 98 99 100
     SSL3_CK_DHE_DSS_DES_192_CBC3_SHA,
     SSL_kDHE,
     SSL_aDSS,
     SSL_3DES,
     SSL_SHA1,
101
     SSL3_VERSION, TLS1_2_VERSION,
102
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
103
     SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
104 105 106 107 108 109 110
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
    {
     1,
     SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA,
111
     SSL3_RFC_DHE_RSA_DES_192_CBC3_SHA,
112 113 114 115 116
     SSL3_CK_DHE_RSA_DES_192_CBC3_SHA,
     SSL_kDHE,
     SSL_aRSA,
     SSL_3DES,
     SSL_SHA1,
117
     SSL3_VERSION, TLS1_2_VERSION,
118
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
119
     SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
120 121 122 123 124 125 126
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
    {
     1,
     SSL3_TXT_ADH_DES_192_CBC_SHA,
127
     SSL3_RFC_ADH_DES_192_CBC_SHA,
128 129 130 131 132
     SSL3_CK_ADH_DES_192_CBC_SHA,
     SSL_kDHE,
     SSL_aNULL,
     SSL_3DES,
     SSL_SHA1,
133
     SSL3_VERSION, TLS1_2_VERSION,
134
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
135
     SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
136 137 138 139
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
140
#endif
141 142 143
    {
     1,
     TLS1_TXT_RSA_WITH_AES_128_SHA,
144
     TLS1_RFC_RSA_WITH_AES_128_SHA,
145 146 147 148 149
     TLS1_CK_RSA_WITH_AES_128_SHA,
     SSL_kRSA,
     SSL_aRSA,
     SSL_AES128,
     SSL_SHA1,
150
     SSL3_VERSION, TLS1_2_VERSION,
151
     DTLS1_BAD_VER, DTLS1_2_VERSION,
152
     SSL_HIGH | SSL_FIPS,
153 154 155 156 157 158 159
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_DHE_DSS_WITH_AES_128_SHA,
160
     TLS1_RFC_DHE_DSS_WITH_AES_128_SHA,
161 162 163 164 165
     TLS1_CK_DHE_DSS_WITH_AES_128_SHA,
     SSL_kDHE,
     SSL_aDSS,
     SSL_AES128,
     SSL_SHA1,
166
     SSL3_VERSION, TLS1_2_VERSION,
167
     DTLS1_BAD_VER, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
168
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
169 170 171 172 173 174 175
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_DHE_RSA_WITH_AES_128_SHA,
176
     TLS1_RFC_DHE_RSA_WITH_AES_128_SHA,
177 178 179 180 181
     TLS1_CK_DHE_RSA_WITH_AES_128_SHA,
     SSL_kDHE,
     SSL_aRSA,
     SSL_AES128,
     SSL_SHA1,
182
     SSL3_VERSION, TLS1_2_VERSION,
183
     DTLS1_BAD_VER, DTLS1_2_VERSION,
184
     SSL_HIGH | SSL_FIPS,
185 186 187 188 189 190 191
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_ADH_WITH_AES_128_SHA,
192
     TLS1_RFC_ADH_WITH_AES_128_SHA,
193 194 195 196 197
     TLS1_CK_ADH_WITH_AES_128_SHA,
     SSL_kDHE,
     SSL_aNULL,
     SSL_AES128,
     SSL_SHA1,
198
     SSL3_VERSION, TLS1_2_VERSION,
199
     DTLS1_BAD_VER, DTLS1_2_VERSION,
200
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
201 202 203 204 205 206 207
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_RSA_WITH_AES_256_SHA,
208
     TLS1_RFC_RSA_WITH_AES_256_SHA,
209 210 211 212 213
     TLS1_CK_RSA_WITH_AES_256_SHA,
     SSL_kRSA,
     SSL_aRSA,
     SSL_AES256,
     SSL_SHA1,
214
     SSL3_VERSION, TLS1_2_VERSION,
215
     DTLS1_BAD_VER, DTLS1_2_VERSION,
216
     SSL_HIGH | SSL_FIPS,
217 218 219 220 221 222 223
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_DSS_WITH_AES_256_SHA,
224
     TLS1_RFC_DHE_DSS_WITH_AES_256_SHA,
225 226 227 228 229
     TLS1_CK_DHE_DSS_WITH_AES_256_SHA,
     SSL_kDHE,
     SSL_aDSS,
     SSL_AES256,
     SSL_SHA1,
230
     SSL3_VERSION, TLS1_2_VERSION,
231
     DTLS1_BAD_VER, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
232
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
233 234 235 236 237 238 239
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_RSA_WITH_AES_256_SHA,
240
     TLS1_RFC_DHE_RSA_WITH_AES_256_SHA,
241 242 243 244 245
     TLS1_CK_DHE_RSA_WITH_AES_256_SHA,
     SSL_kDHE,
     SSL_aRSA,
     SSL_AES256,
     SSL_SHA1,
246
     SSL3_VERSION, TLS1_2_VERSION,
247
     DTLS1_BAD_VER, DTLS1_2_VERSION,
248
     SSL_HIGH | SSL_FIPS,
249 250 251 252 253 254 255
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ADH_WITH_AES_256_SHA,
256
     TLS1_RFC_ADH_WITH_AES_256_SHA,
257 258 259 260 261
     TLS1_CK_ADH_WITH_AES_256_SHA,
     SSL_kDHE,
     SSL_aNULL,
     SSL_AES256,
     SSL_SHA1,
262
     SSL3_VERSION, TLS1_2_VERSION,
263
     DTLS1_BAD_VER, DTLS1_2_VERSION,
264
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
265 266 267 268 269 270 271
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_RSA_WITH_NULL_SHA256,
272
     TLS1_RFC_RSA_WITH_NULL_SHA256,
273 274 275 276 277
     TLS1_CK_RSA_WITH_NULL_SHA256,
     SSL_kRSA,
     SSL_aRSA,
     SSL_eNULL,
     SSL_SHA256,
278 279
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
280
     SSL_STRONG_NONE | SSL_FIPS,
281 282 283 284 285 286 287
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
     },
    {
     1,
     TLS1_TXT_RSA_WITH_AES_128_SHA256,
288
     TLS1_RFC_RSA_WITH_AES_128_SHA256,
289 290 291 292 293
     TLS1_CK_RSA_WITH_AES_128_SHA256,
     SSL_kRSA,
     SSL_aRSA,
     SSL_AES128,
     SSL_SHA256,
294 295
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
296
     SSL_HIGH | SSL_FIPS,
297 298 299 300 301 302 303
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_RSA_WITH_AES_256_SHA256,
304
     TLS1_RFC_RSA_WITH_AES_256_SHA256,
305 306 307 308 309
     TLS1_CK_RSA_WITH_AES_256_SHA256,
     SSL_kRSA,
     SSL_aRSA,
     SSL_AES256,
     SSL_SHA256,
310 311
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
312
     SSL_HIGH | SSL_FIPS,
313 314 315 316 317 318 319
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256,
320
     TLS1_RFC_DHE_DSS_WITH_AES_128_SHA256,
321 322 323 324 325
     TLS1_CK_DHE_DSS_WITH_AES_128_SHA256,
     SSL_kDHE,
     SSL_aDSS,
     SSL_AES128,
     SSL_SHA256,
326 327
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
328
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
329 330 331 332 333 334 335
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256,
336
     TLS1_RFC_DHE_RSA_WITH_AES_128_SHA256,
337 338 339 340 341
     TLS1_CK_DHE_RSA_WITH_AES_128_SHA256,
     SSL_kDHE,
     SSL_aRSA,
     SSL_AES128,
     SSL_SHA256,
342 343
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
344
     SSL_HIGH | SSL_FIPS,
345 346 347 348 349 350 351
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256,
352
     TLS1_RFC_DHE_DSS_WITH_AES_256_SHA256,
353 354 355 356 357
     TLS1_CK_DHE_DSS_WITH_AES_256_SHA256,
     SSL_kDHE,
     SSL_aDSS,
     SSL_AES256,
     SSL_SHA256,
358 359
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
360
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
361 362 363 364 365 366 367
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256,
368
     TLS1_RFC_DHE_RSA_WITH_AES_256_SHA256,
369 370 371 372 373
     TLS1_CK_DHE_RSA_WITH_AES_256_SHA256,
     SSL_kDHE,
     SSL_aRSA,
     SSL_AES256,
     SSL_SHA256,
374 375
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
376
     SSL_HIGH | SSL_FIPS,
377 378 379 380 381 382 383
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ADH_WITH_AES_128_SHA256,
384
     TLS1_RFC_ADH_WITH_AES_128_SHA256,
385 386 387 388 389
     TLS1_CK_ADH_WITH_AES_128_SHA256,
     SSL_kDHE,
     SSL_aNULL,
     SSL_AES128,
     SSL_SHA256,
390 391
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
392
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
393 394 395 396 397 398 399
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_ADH_WITH_AES_256_SHA256,
400
     TLS1_RFC_ADH_WITH_AES_256_SHA256,
401 402 403 404 405
     TLS1_CK_ADH_WITH_AES_256_SHA256,
     SSL_kDHE,
     SSL_aNULL,
     SSL_AES256,
     SSL_SHA256,
406 407
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
408
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
409 410 411 412 413 414
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
415
     TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256,
416
     TLS1_RFC_RSA_WITH_AES_128_GCM_SHA256,
R
Rich Salz 已提交
417 418 419 420 421 422 423 424 425 426 427 428
     TLS1_CK_RSA_WITH_AES_128_GCM_SHA256,
     SSL_kRSA,
     SSL_aRSA,
     SSL_AES128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
429 430
    {
     1,
R
Rich Salz 已提交
431
     TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384,
432
     TLS1_RFC_RSA_WITH_AES_256_GCM_SHA384,
R
Rich Salz 已提交
433
     TLS1_CK_RSA_WITH_AES_256_GCM_SHA384,
434 435
     SSL_kRSA,
     SSL_aRSA,
R
Rich Salz 已提交
436 437 438 439 440 441
     SSL_AES256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
442 443 444 445 446
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
447
     TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256,
448
     TLS1_RFC_DHE_RSA_WITH_AES_128_GCM_SHA256,
R
Rich Salz 已提交
449
     TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256,
450
     SSL_kDHE,
R
Rich Salz 已提交
451 452 453 454 455 456 457 458 459
     SSL_aRSA,
     SSL_AES128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
460 461 462
     },
    {
     1,
R
Rich Salz 已提交
463
     TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384,
464
     TLS1_RFC_DHE_RSA_WITH_AES_256_GCM_SHA384,
R
Rich Salz 已提交
465
     TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384,
466 467
     SSL_kDHE,
     SSL_aRSA,
R
Rich Salz 已提交
468 469 470 471 472 473
     SSL_AES256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
474 475 476 477 478
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
479
     TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256,
480
     TLS1_RFC_DHE_DSS_WITH_AES_128_GCM_SHA256,
R
Rich Salz 已提交
481
     TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256,
482
     SSL_kDHE,
R
Rich Salz 已提交
483 484 485 486 487 488 489
     SSL_aDSS,
     SSL_AES128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
490 491 492 493 494
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
495
     TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384,
496
     TLS1_RFC_DHE_DSS_WITH_AES_256_GCM_SHA384,
R
Rich Salz 已提交
497 498 499 500 501 502 503 504 505 506 507
     TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384,
     SSL_kDHE,
     SSL_aDSS,
     SSL_AES256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
508 509 510
     },
    {
     1,
R
Rich Salz 已提交
511
     TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256,
512
     TLS1_RFC_ADH_WITH_AES_128_GCM_SHA256,
R
Rich Salz 已提交
513 514 515 516 517 518 519 520 521
     TLS1_CK_ADH_WITH_AES_128_GCM_SHA256,
     SSL_kDHE,
     SSL_aNULL,
     SSL_AES128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
522 523 524 525 526
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
527
     TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384,
528
     TLS1_RFC_ADH_WITH_AES_256_GCM_SHA384,
R
Rich Salz 已提交
529 530 531 532 533 534 535 536 537
     TLS1_CK_ADH_WITH_AES_256_GCM_SHA384,
     SSL_kDHE,
     SSL_aNULL,
     SSL_AES256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
538 539 540
     256,
     256,
     },
541 542
    {
     1,
R
Rich Salz 已提交
543
     TLS1_TXT_RSA_WITH_AES_128_CCM,
544
     TLS1_RFC_RSA_WITH_AES_128_CCM,
R
Rich Salz 已提交
545 546 547 548 549 550 551 552 553
     TLS1_CK_RSA_WITH_AES_128_CCM,
     SSL_kRSA,
     SSL_aRSA,
     SSL_AES128CCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
554 555 556 557 558
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
559
     TLS1_TXT_RSA_WITH_AES_256_CCM,
560
     TLS1_RFC_RSA_WITH_AES_256_CCM,
R
Rich Salz 已提交
561 562 563 564 565 566 567 568 569 570 571
     TLS1_CK_RSA_WITH_AES_256_CCM,
     SSL_kRSA,
     SSL_aRSA,
     SSL_AES256CCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
572 573 574
     },
    {
     1,
R
Rich Salz 已提交
575
     TLS1_TXT_DHE_RSA_WITH_AES_128_CCM,
576
     TLS1_RFC_DHE_RSA_WITH_AES_128_CCM,
R
Rich Salz 已提交
577 578 579 580 581 582 583 584 585
     TLS1_CK_DHE_RSA_WITH_AES_128_CCM,
     SSL_kDHE,
     SSL_aRSA,
     SSL_AES128CCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
586 587 588 589 590
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
591
     TLS1_TXT_DHE_RSA_WITH_AES_256_CCM,
592
     TLS1_RFC_DHE_RSA_WITH_AES_256_CCM,
R
Rich Salz 已提交
593 594 595 596 597 598 599 600 601
     TLS1_CK_DHE_RSA_WITH_AES_256_CCM,
     SSL_kDHE,
     SSL_aRSA,
     SSL_AES256CCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
602 603 604 605 606
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
607
     TLS1_TXT_RSA_WITH_AES_128_CCM_8,
608
     TLS1_RFC_RSA_WITH_AES_128_CCM_8,
R
Rich Salz 已提交
609 610
     TLS1_CK_RSA_WITH_AES_128_CCM_8,
     SSL_kRSA,
611
     SSL_aRSA,
R
Rich Salz 已提交
612
     SSL_AES128CCM8,
613
     SSL_AEAD,
614 615
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
616
     SSL_NOT_DEFAULT | SSL_HIGH,
617 618 619 620 621 622
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
623
     TLS1_TXT_RSA_WITH_AES_256_CCM_8,
624
     TLS1_RFC_RSA_WITH_AES_256_CCM_8,
R
Rich Salz 已提交
625
     TLS1_CK_RSA_WITH_AES_256_CCM_8,
626 627
     SSL_kRSA,
     SSL_aRSA,
R
Rich Salz 已提交
628
     SSL_AES256CCM8,
629
     SSL_AEAD,
630 631
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
632 633
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
634 635 636 637 638
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
639
     TLS1_TXT_DHE_RSA_WITH_AES_128_CCM_8,
640
     TLS1_RFC_DHE_RSA_WITH_AES_128_CCM_8,
R
Rich Salz 已提交
641
     TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8,
642 643
     SSL_kDHE,
     SSL_aRSA,
R
Rich Salz 已提交
644
     SSL_AES128CCM8,
645
     SSL_AEAD,
646 647
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
648
     SSL_NOT_DEFAULT | SSL_HIGH,
649 650 651 652 653 654
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
655
     TLS1_TXT_DHE_RSA_WITH_AES_256_CCM_8,
656
     TLS1_RFC_DHE_RSA_WITH_AES_256_CCM_8,
R
Rich Salz 已提交
657
     TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8,
658 659
     SSL_kDHE,
     SSL_aRSA,
R
Rich Salz 已提交
660
     SSL_AES256CCM8,
661
     SSL_AEAD,
662 663
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
664 665
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
666 667 668 669 670
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
671
     TLS1_TXT_PSK_WITH_AES_128_CCM,
672
     TLS1_RFC_PSK_WITH_AES_128_CCM,
R
Rich Salz 已提交
673 674 675 676
     TLS1_CK_PSK_WITH_AES_128_CCM,
     SSL_kPSK,
     SSL_aPSK,
     SSL_AES128CCM,
677
     SSL_AEAD,
678 679
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
680
     SSL_NOT_DEFAULT | SSL_HIGH,
681 682 683 684 685 686
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
687
     TLS1_TXT_PSK_WITH_AES_256_CCM,
688
     TLS1_RFC_PSK_WITH_AES_256_CCM,
R
Rich Salz 已提交
689 690 691 692
     TLS1_CK_PSK_WITH_AES_256_CCM,
     SSL_kPSK,
     SSL_aPSK,
     SSL_AES256CCM,
693
     SSL_AEAD,
694 695
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
696 697
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
698 699 700 701 702
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
703
     TLS1_TXT_DHE_PSK_WITH_AES_128_CCM,
704
     TLS1_RFC_DHE_PSK_WITH_AES_128_CCM,
R
Rich Salz 已提交
705 706 707 708
     TLS1_CK_DHE_PSK_WITH_AES_128_CCM,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_AES128CCM,
709
     SSL_AEAD,
710 711
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
712
     SSL_NOT_DEFAULT | SSL_HIGH,
713 714 715 716 717 718
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
719
     TLS1_TXT_DHE_PSK_WITH_AES_256_CCM,
720
     TLS1_RFC_DHE_PSK_WITH_AES_256_CCM,
R
Rich Salz 已提交
721 722 723 724
     TLS1_CK_DHE_PSK_WITH_AES_256_CCM,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_AES256CCM,
725
     SSL_AEAD,
726 727
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
728 729
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
730 731 732
     256,
     256,
     },
733 734
    {
     1,
R
Rich Salz 已提交
735
     TLS1_TXT_PSK_WITH_AES_128_CCM_8,
736
     TLS1_RFC_PSK_WITH_AES_128_CCM_8,
R
Rich Salz 已提交
737
     TLS1_CK_PSK_WITH_AES_128_CCM_8,
738 739
     SSL_kPSK,
     SSL_aPSK,
R
Rich Salz 已提交
740
     SSL_AES128CCM8,
741
     SSL_AEAD,
742 743
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
744
     SSL_NOT_DEFAULT | SSL_HIGH,
745 746 747 748 749 750
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
751
     TLS1_TXT_PSK_WITH_AES_256_CCM_8,
752
     TLS1_RFC_PSK_WITH_AES_256_CCM_8,
R
Rich Salz 已提交
753
     TLS1_CK_PSK_WITH_AES_256_CCM_8,
754 755
     SSL_kPSK,
     SSL_aPSK,
R
Rich Salz 已提交
756
     SSL_AES256CCM8,
757
     SSL_AEAD,
758 759
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
760 761
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
762 763 764
     256,
     256,
     },
765 766
    {
     1,
R
Rich Salz 已提交
767
     TLS1_TXT_DHE_PSK_WITH_AES_128_CCM_8,
768
     TLS1_RFC_DHE_PSK_WITH_AES_128_CCM_8,
R
Rich Salz 已提交
769
     TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8,
770 771
     SSL_kDHEPSK,
     SSL_aPSK,
R
Rich Salz 已提交
772
     SSL_AES128CCM8,
773
     SSL_AEAD,
774 775
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
776
     SSL_NOT_DEFAULT | SSL_HIGH,
777 778 779 780 781 782
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
783
     TLS1_TXT_DHE_PSK_WITH_AES_256_CCM_8,
784
     TLS1_RFC_DHE_PSK_WITH_AES_256_CCM_8,
R
Rich Salz 已提交
785 786
     TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8,
     SSL_kDHEPSK,
787
     SSL_aPSK,
R
Rich Salz 已提交
788
     SSL_AES256CCM8,
789
     SSL_AEAD,
790 791
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
792 793
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
794 795 796 797 798
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
799
     TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM,
800
     TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM,
R
Rich Salz 已提交
801 802 803 804
     TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_AES128CCM,
805
     SSL_AEAD,
806 807
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
808
     SSL_NOT_DEFAULT | SSL_HIGH,
809 810 811 812 813 814
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
815
     TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM,
816
     TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM,
R
Rich Salz 已提交
817 818 819 820
     TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_AES256CCM,
821
     SSL_AEAD,
822 823
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
824 825
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
826 827 828 829 830
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
831
     TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM_8,
832
     TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM_8,
R
Rich Salz 已提交
833 834 835 836 837 838 839 840 841
     TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_AES128CCM8,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
842 843 844 845 846
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
847
     TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8,
848
     TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM_8,
R
Rich Salz 已提交
849 850 851 852 853 854 855 856 857
     TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_AES256CCM8,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
858 859 860
     256,
     256,
     },
861 862 863
    {
     1,
     TLS1_3_TXT_AES_128_GCM_SHA256,
864
     TLS1_3_RFC_AES_128_GCM_SHA256,
865
     TLS1_3_CK_AES_128_GCM_SHA256,
D
Dr. Stephen Henson 已提交
866
     0, 0,
867 868 869
     SSL_AES128GCM,
     SSL_AEAD,
     TLS1_3_VERSION, TLS1_3_VERSION,
870 871 872 873 874 875 876 877 878 879
     SSL_kANY,
     SSL_aANY,
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_3_TXT_AES_256_GCM_SHA384,
880
     TLS1_3_RFC_AES_256_GCM_SHA384,
881 882 883 884 885 886
     TLS1_3_CK_AES_256_GCM_SHA384,
     SSL_kANY,
     SSL_aANY,
     SSL_AES256GCM,
     SSL_AEAD,
     TLS1_3_VERSION, TLS1_3_VERSION,
887 888
     0, 0,
     SSL_HIGH,
889 890 891 892 893 894 895 896
     SSL_HANDSHAKE_MAC_SHA384,
     256,
     256,
     },
#if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
    {
     1,
     TLS1_3_TXT_CHACHA20_POLY1305_SHA256,
897
     TLS1_3_RFC_CHACHA20_POLY1305_SHA256,
898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913
     TLS1_3_CK_CHACHA20_POLY1305_SHA256,
     SSL_kANY,
     SSL_aANY,
     SSL_CHACHA20POLY1305,
     SSL_AEAD,
     TLS1_3_VERSION, TLS1_3_VERSION,
     0, 0,
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256,
     256,
     256,
     },
#endif
    {
     1,
     TLS1_3_TXT_AES_128_CCM_SHA256,
914
     TLS1_3_RFC_AES_128_CCM_SHA256,
915 916 917 918 919 920 921 922 923 924 925 926 927 928 929
     TLS1_3_CK_AES_128_CCM_SHA256,
     SSL_kANY,
     SSL_aANY,
     SSL_AES128CCM,
     SSL_AEAD,
     TLS1_3_VERSION, TLS1_3_VERSION,
     0, 0,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_3_TXT_AES_128_CCM_8_SHA256,
930
     TLS1_3_RFC_AES_128_CCM_8_SHA256,
931 932 933 934 935 936 937 938 939
     TLS1_3_CK_AES_128_CCM_8_SHA256,
     SSL_kANY,
     SSL_aANY,
     SSL_AES128CCM8,
     SSL_AEAD,
     TLS1_3_VERSION, TLS1_3_VERSION,
     0, 0,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256,
940 941 942
     128,
     128,
     },
943 944
    {
     1,
R
Rich Salz 已提交
945
     TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA,
946
     TLS1_RFC_ECDHE_ECDSA_WITH_NULL_SHA,
R
Rich Salz 已提交
947 948 949
     TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA,
     SSL_kECDHE,
     SSL_aECDSA,
950
     SSL_eNULL,
R
Rich Salz 已提交
951
     SSL_SHA1,
T
Todd Short 已提交
952
     TLS1_VERSION, TLS1_2_VERSION,
953
     DTLS1_BAD_VER, DTLS1_2_VERSION,
954
     SSL_STRONG_NONE | SSL_FIPS,
955 956 957 958
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
     },
959
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
960 961
    {
     1,
R
Rich Salz 已提交
962
     TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
963
     TLS1_RFC_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
R
Rich Salz 已提交
964 965 966 967 968
     TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_3DES,
     SSL_SHA1,
T
Todd Short 已提交
969
     TLS1_VERSION, TLS1_2_VERSION,
970
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
971
     SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
R
Rich Salz 已提交
972 973 974
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
975
     },
976
# endif
977 978
    {
     1,
R
Rich Salz 已提交
979
     TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
980
     TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
981 982 983
     TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
     SSL_kECDHE,
     SSL_aECDSA,
984
     SSL_AES128,
R
Rich Salz 已提交
985
     SSL_SHA1,
T
Todd Short 已提交
986
     TLS1_VERSION, TLS1_2_VERSION,
987
     DTLS1_BAD_VER, DTLS1_2_VERSION,
988
     SSL_HIGH | SSL_FIPS,
989 990 991 992 993 994
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
995
     TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
996
     TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
997 998 999
     TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
     SSL_kECDHE,
     SSL_aECDSA,
1000
     SSL_AES256,
R
Rich Salz 已提交
1001
     SSL_SHA1,
T
Todd Short 已提交
1002
     TLS1_VERSION, TLS1_2_VERSION,
1003
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1004
     SSL_HIGH | SSL_FIPS,
R
Rich Salz 已提交
1005
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1006 1007 1008 1009 1010
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
1011
     TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA,
1012
     TLS1_RFC_ECDHE_RSA_WITH_NULL_SHA,
R
Rich Salz 已提交
1013 1014 1015
     TLS1_CK_ECDHE_RSA_WITH_NULL_SHA,
     SSL_kECDHE,
     SSL_aRSA,
1016
     SSL_eNULL,
R
Rich Salz 已提交
1017
     SSL_SHA1,
T
Todd Short 已提交
1018
     TLS1_VERSION, TLS1_2_VERSION,
1019
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1020
     SSL_STRONG_NONE | SSL_FIPS,
1021 1022 1023 1024
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
     },
1025
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
1026 1027
    {
     1,
R
Rich Salz 已提交
1028
     TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
1029
     TLS1_RFC_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
R
Rich Salz 已提交
1030 1031 1032 1033 1034
     TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
     SSL_kECDHE,
     SSL_aRSA,
     SSL_3DES,
     SSL_SHA1,
T
Todd Short 已提交
1035
     TLS1_VERSION, TLS1_2_VERSION,
1036
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1037
     SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
R
Rich Salz 已提交
1038 1039 1040
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
1041
     },
1042
# endif
1043 1044
    {
     1,
R
Rich Salz 已提交
1045
     TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA,
1046
     TLS1_RFC_ECDHE_RSA_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
1047 1048
     TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA,
     SSL_kECDHE,
1049 1050
     SSL_aRSA,
     SSL_AES128,
R
Rich Salz 已提交
1051
     SSL_SHA1,
T
Todd Short 已提交
1052
     TLS1_VERSION, TLS1_2_VERSION,
1053
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1054
     SSL_HIGH | SSL_FIPS,
1055 1056 1057 1058 1059 1060
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
1061
     TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA,
1062
     TLS1_RFC_ECDHE_RSA_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
1063 1064
     TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA,
     SSL_kECDHE,
1065 1066
     SSL_aRSA,
     SSL_AES256,
R
Rich Salz 已提交
1067
     SSL_SHA1,
T
Todd Short 已提交
1068
     TLS1_VERSION, TLS1_2_VERSION,
1069
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1070
     SSL_HIGH | SSL_FIPS,
R
Rich Salz 已提交
1071
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1072 1073 1074 1075 1076
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
1077
     TLS1_TXT_ECDH_anon_WITH_NULL_SHA,
1078
     TLS1_RFC_ECDH_anon_WITH_NULL_SHA,
R
Rich Salz 已提交
1079 1080 1081
     TLS1_CK_ECDH_anon_WITH_NULL_SHA,
     SSL_kECDHE,
     SSL_aNULL,
1082
     SSL_eNULL,
R
Rich Salz 已提交
1083
     SSL_SHA1,
T
Todd Short 已提交
1084
     TLS1_VERSION, TLS1_2_VERSION,
1085
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1086
     SSL_STRONG_NONE | SSL_FIPS,
1087 1088 1089 1090
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
     },
1091
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
1092 1093
    {
     1,
R
Rich Salz 已提交
1094
     TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA,
1095
     TLS1_RFC_ECDH_anon_WITH_DES_192_CBC3_SHA,
R
Rich Salz 已提交
1096 1097 1098 1099 1100
     TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA,
     SSL_kECDHE,
     SSL_aNULL,
     SSL_3DES,
     SSL_SHA1,
T
Todd Short 已提交
1101
     TLS1_VERSION, TLS1_2_VERSION,
1102
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1103
     SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
R
Rich Salz 已提交
1104 1105 1106
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
1107
     },
1108
# endif
1109 1110
    {
     1,
R
Rich Salz 已提交
1111
     TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA,
1112
     TLS1_RFC_ECDH_anon_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
1113 1114 1115 1116 1117
     TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA,
     SSL_kECDHE,
     SSL_aNULL,
     SSL_AES128,
     SSL_SHA1,
T
Todd Short 已提交
1118
     TLS1_VERSION, TLS1_2_VERSION,
1119
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1120 1121 1122 1123 1124
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
1125 1126
    {
     1,
R
Rich Salz 已提交
1127
     TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA,
1128
     TLS1_RFC_ECDH_anon_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
1129 1130 1131 1132 1133
     TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA,
     SSL_kECDHE,
     SSL_aNULL,
     SSL_AES256,
     SSL_SHA1,
T
Todd Short 已提交
1134
     TLS1_VERSION, TLS1_2_VERSION,
1135
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1136 1137 1138 1139 1140 1141 1142 1143
     SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256,
1144
     TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_SHA256,
R
Rich Salz 已提交
1145 1146 1147 1148
     TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_AES128,
1149
     SSL_SHA256,
1150 1151
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
1152
     SSL_HIGH | SSL_FIPS,
1153 1154 1155 1156 1157 1158
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
1159
     TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384,
1160
     TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_SHA384,
R
Rich Salz 已提交
1161 1162 1163 1164 1165
     TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_AES256,
     SSL_SHA384,
1166 1167
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
1168 1169 1170 1171
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
1172 1173 1174
     },
    {
     1,
R
Rich Salz 已提交
1175
     TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256,
1176
     TLS1_RFC_ECDHE_RSA_WITH_AES_128_SHA256,
R
Rich Salz 已提交
1177 1178 1179 1180
     TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256,
     SSL_kECDHE,
     SSL_aRSA,
     SSL_AES128,
1181
     SSL_SHA256,
1182 1183
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
1184
     SSL_HIGH | SSL_FIPS,
1185 1186 1187 1188 1189 1190
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
1191
     TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384,
1192
     TLS1_RFC_ECDHE_RSA_WITH_AES_256_SHA384,
R
Rich Salz 已提交
1193 1194
     TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384,
     SSL_kECDHE,
1195
     SSL_aRSA,
R
Rich Salz 已提交
1196 1197
     SSL_AES256,
     SSL_SHA384,
1198 1199
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
1200 1201
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1202 1203 1204 1205 1206
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
1207
     TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
1208
     TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
R
Rich Salz 已提交
1209 1210 1211 1212 1213
     TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_AES128GCM,
     SSL_AEAD,
1214 1215
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
1216
     SSL_HIGH | SSL_FIPS,
1217
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
R
Rich Salz 已提交
1218 1219 1220 1221 1222 1223
     128,
     128,
     },
    {
     1,
     TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
1224
     TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
R
Rich Salz 已提交
1225 1226 1227 1228 1229 1230 1231 1232 1233
     TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_AES256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1234 1235 1236 1237 1238
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
1239
     TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
1240
     TLS1_RFC_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
R
Rich Salz 已提交
1241 1242
     TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
     SSL_kECDHE,
1243
     SSL_aRSA,
R
Rich Salz 已提交
1244 1245
     SSL_AES128GCM,
     SSL_AEAD,
1246 1247
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
1248
     SSL_HIGH | SSL_FIPS,
1249
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
R
Rich Salz 已提交
1250 1251
     128,
     128,
1252 1253 1254
     },
    {
     1,
R
Rich Salz 已提交
1255
     TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
1256
     TLS1_RFC_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
R
Rich Salz 已提交
1257 1258 1259 1260 1261
     TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
     SSL_kECDHE,
     SSL_aRSA,
     SSL_AES256GCM,
     SSL_AEAD,
1262 1263
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
R
Rich Salz 已提交
1264 1265
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1266 1267 1268 1269 1270
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
1271
     TLS1_TXT_PSK_WITH_NULL_SHA,
1272
     TLS1_RFC_PSK_WITH_NULL_SHA,
R
Rich Salz 已提交
1273 1274 1275
     TLS1_CK_PSK_WITH_NULL_SHA,
     SSL_kPSK,
     SSL_aPSK,
1276 1277
     SSL_eNULL,
     SSL_SHA1,
1278
     SSL3_VERSION, TLS1_2_VERSION,
1279
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1280
     SSL_STRONG_NONE | SSL_FIPS,
1281 1282 1283 1284 1285 1286
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
     },
    {
     1,
R
Rich Salz 已提交
1287
     TLS1_TXT_DHE_PSK_WITH_NULL_SHA,
1288
     TLS1_RFC_DHE_PSK_WITH_NULL_SHA,
R
Rich Salz 已提交
1289 1290 1291 1292
     TLS1_CK_DHE_PSK_WITH_NULL_SHA,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_eNULL,
1293
     SSL_SHA1,
1294
     SSL3_VERSION, TLS1_2_VERSION,
1295
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1296
     SSL_STRONG_NONE | SSL_FIPS,
1297
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
R
Rich Salz 已提交
1298 1299
     0,
     0,
1300 1301 1302
     },
    {
     1,
R
Rich Salz 已提交
1303
     TLS1_TXT_RSA_PSK_WITH_NULL_SHA,
1304
     TLS1_RFC_RSA_PSK_WITH_NULL_SHA,
R
Rich Salz 已提交
1305 1306 1307 1308 1309 1310
     TLS1_CK_RSA_PSK_WITH_NULL_SHA,
     SSL_kRSAPSK,
     SSL_aRSA,
     SSL_eNULL,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1311
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1312 1313 1314 1315 1316
     SSL_STRONG_NONE | SSL_FIPS,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
     },
1317
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
R
Rich Salz 已提交
1318 1319 1320
    {
     1,
     TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA,
1321
     TLS1_RFC_PSK_WITH_3DES_EDE_CBC_SHA,
R
Rich Salz 已提交
1322 1323 1324
     TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA,
     SSL_kPSK,
     SSL_aPSK,
1325 1326
     SSL_3DES,
     SSL_SHA1,
1327
     SSL3_VERSION, TLS1_2_VERSION,
1328
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1329
     SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
1330 1331 1332 1333
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
1334
# endif
1335 1336
    {
     1,
R
Rich Salz 已提交
1337
     TLS1_TXT_PSK_WITH_AES_128_CBC_SHA,
1338
     TLS1_RFC_PSK_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
1339 1340 1341
     TLS1_CK_PSK_WITH_AES_128_CBC_SHA,
     SSL_kPSK,
     SSL_aPSK,
1342 1343
     SSL_AES128,
     SSL_SHA1,
1344
     SSL3_VERSION, TLS1_2_VERSION,
1345
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1346
     SSL_HIGH | SSL_FIPS,
1347 1348 1349 1350 1351 1352
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
1353
     TLS1_TXT_PSK_WITH_AES_256_CBC_SHA,
1354
     TLS1_RFC_PSK_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
1355 1356 1357
     TLS1_CK_PSK_WITH_AES_256_CBC_SHA,
     SSL_kPSK,
     SSL_aPSK,
1358 1359
     SSL_AES256,
     SSL_SHA1,
1360
     SSL3_VERSION, TLS1_2_VERSION,
1361
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1362
     SSL_HIGH | SSL_FIPS,
1363 1364 1365 1366
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
1367
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
1368 1369
    {
     1,
R
Rich Salz 已提交
1370
     TLS1_TXT_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
1371
     TLS1_RFC_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
R
Rich Salz 已提交
1372 1373 1374 1375
     TLS1_CK_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_3DES,
1376
     SSL_SHA1,
1377
     SSL3_VERSION, TLS1_2_VERSION,
1378
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1379
     SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
1380
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
R
Rich Salz 已提交
1381 1382
     112,
     168,
1383
     },
1384
# endif
1385 1386
    {
     1,
R
Rich Salz 已提交
1387
     TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA,
1388
     TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
1389 1390 1391 1392 1393 1394
     TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_AES128,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1395
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1396
     SSL_HIGH | SSL_FIPS,
1397 1398 1399 1400 1401 1402
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
1403
     TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA,
1404
     TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
1405 1406 1407 1408 1409 1410
     TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_AES256,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1411
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1412 1413 1414 1415 1416
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
1417
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
R
Rich Salz 已提交
1418 1419 1420
    {
     1,
     TLS1_TXT_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
1421
     TLS1_RFC_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
R
Rich Salz 已提交
1422 1423
     TLS1_CK_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
     SSL_kRSAPSK,
1424 1425 1426
     SSL_aRSA,
     SSL_3DES,
     SSL_SHA1,
1427
     SSL3_VERSION, TLS1_2_VERSION,
1428
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1429
     SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
1430 1431 1432 1433
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
1434
# endif
1435 1436
    {
     1,
R
Rich Salz 已提交
1437
     TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA,
1438
     TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
1439 1440
     TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA,
     SSL_kRSAPSK,
1441 1442 1443
     SSL_aRSA,
     SSL_AES128,
     SSL_SHA1,
1444
     SSL3_VERSION, TLS1_2_VERSION,
1445
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1446
     SSL_HIGH | SSL_FIPS,
1447 1448 1449 1450 1451 1452
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
1453
     TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA,
1454
     TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
1455 1456
     TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA,
     SSL_kRSAPSK,
1457 1458 1459
     SSL_aRSA,
     SSL_AES256,
     SSL_SHA1,
1460
     SSL3_VERSION, TLS1_2_VERSION,
1461
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1462
     SSL_HIGH | SSL_FIPS,
1463 1464 1465 1466 1467 1468
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
1469
     TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256,
1470
     TLS1_RFC_PSK_WITH_AES_128_GCM_SHA256,
R
Rich Salz 已提交
1471 1472 1473 1474 1475 1476 1477 1478 1479
     TLS1_CK_PSK_WITH_AES_128_GCM_SHA256,
     SSL_kPSK,
     SSL_aPSK,
     SSL_AES128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1480 1481 1482 1483 1484
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
1485
     TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384,
1486
     TLS1_RFC_PSK_WITH_AES_256_GCM_SHA384,
R
Rich Salz 已提交
1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497
     TLS1_CK_PSK_WITH_AES_256_GCM_SHA384,
     SSL_kPSK,
     SSL_aPSK,
     SSL_AES256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
1498 1499 1500
     },
    {
     1,
R
Rich Salz 已提交
1501
     TLS1_TXT_DHE_PSK_WITH_AES_128_GCM_SHA256,
1502
     TLS1_RFC_DHE_PSK_WITH_AES_128_GCM_SHA256,
R
Rich Salz 已提交
1503 1504 1505 1506 1507 1508 1509 1510 1511
     TLS1_CK_DHE_PSK_WITH_AES_128_GCM_SHA256,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_AES128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
1512 1513 1514 1515 1516
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
1517
     TLS1_TXT_DHE_PSK_WITH_AES_256_GCM_SHA384,
1518
     TLS1_RFC_DHE_PSK_WITH_AES_256_GCM_SHA384,
R
Rich Salz 已提交
1519 1520 1521 1522 1523 1524 1525 1526 1527
     TLS1_CK_DHE_PSK_WITH_AES_256_GCM_SHA384,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_AES256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1528 1529 1530 1531 1532
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
1533
     TLS1_TXT_RSA_PSK_WITH_AES_128_GCM_SHA256,
1534
     TLS1_RFC_RSA_PSK_WITH_AES_128_GCM_SHA256,
R
Rich Salz 已提交
1535 1536
     TLS1_CK_RSA_PSK_WITH_AES_128_GCM_SHA256,
     SSL_kRSAPSK,
1537
     SSL_aRSA,
R
Rich Salz 已提交
1538 1539 1540 1541 1542 1543 1544 1545
     SSL_AES128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
1546 1547 1548
     },
    {
     1,
R
Rich Salz 已提交
1549
     TLS1_TXT_RSA_PSK_WITH_AES_256_GCM_SHA384,
1550
     TLS1_RFC_RSA_PSK_WITH_AES_256_GCM_SHA384,
R
Rich Salz 已提交
1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561
     TLS1_CK_RSA_PSK_WITH_AES_256_GCM_SHA384,
     SSL_kRSAPSK,
     SSL_aRSA,
     SSL_AES256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
1562 1563 1564
     },
    {
     1,
R
Rich Salz 已提交
1565
     TLS1_TXT_PSK_WITH_AES_128_CBC_SHA256,
1566
     TLS1_RFC_PSK_WITH_AES_128_CBC_SHA256,
R
Rich Salz 已提交
1567 1568 1569
     TLS1_CK_PSK_WITH_AES_128_CBC_SHA256,
     SSL_kPSK,
     SSL_aPSK,
1570
     SSL_AES128,
R
Rich Salz 已提交
1571 1572
     SSL_SHA256,
     TLS1_VERSION, TLS1_2_VERSION,
1573
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1574
     SSL_HIGH | SSL_FIPS,
1575 1576 1577 1578 1579 1580
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
1581
     TLS1_TXT_PSK_WITH_AES_256_CBC_SHA384,
1582
     TLS1_RFC_PSK_WITH_AES_256_CBC_SHA384,
R
Rich Salz 已提交
1583 1584 1585 1586 1587 1588
     TLS1_CK_PSK_WITH_AES_256_CBC_SHA384,
     SSL_kPSK,
     SSL_aPSK,
     SSL_AES256,
     SSL_SHA384,
     TLS1_VERSION, TLS1_2_VERSION,
1589
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1590 1591 1592 1593
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
1594 1595 1596
     },
    {
     1,
R
Rich Salz 已提交
1597
     TLS1_TXT_PSK_WITH_NULL_SHA256,
1598
     TLS1_RFC_PSK_WITH_NULL_SHA256,
R
Rich Salz 已提交
1599 1600 1601 1602 1603 1604
     TLS1_CK_PSK_WITH_NULL_SHA256,
     SSL_kPSK,
     SSL_aPSK,
     SSL_eNULL,
     SSL_SHA256,
     TLS1_VERSION, TLS1_2_VERSION,
1605
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1606
     SSL_STRONG_NONE | SSL_FIPS,
1607
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
R
Rich Salz 已提交
1608 1609
     0,
     0,
1610 1611 1612
     },
    {
     1,
R
Rich Salz 已提交
1613
     TLS1_TXT_PSK_WITH_NULL_SHA384,
1614
     TLS1_RFC_PSK_WITH_NULL_SHA384,
R
Rich Salz 已提交
1615 1616 1617 1618 1619 1620
     TLS1_CK_PSK_WITH_NULL_SHA384,
     SSL_kPSK,
     SSL_aPSK,
     SSL_eNULL,
     SSL_SHA384,
     TLS1_VERSION, TLS1_2_VERSION,
1621
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1622 1623 1624 1625
     SSL_STRONG_NONE | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     0,
     0,
1626 1627 1628
     },
    {
     1,
R
Rich Salz 已提交
1629
     TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA256,
1630
     TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA256,
R
Rich Salz 已提交
1631 1632 1633 1634 1635 1636
     TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA256,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_AES128,
     SSL_SHA256,
     TLS1_VERSION, TLS1_2_VERSION,
1637
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1638
     SSL_HIGH | SSL_FIPS,
1639
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
R
Rich Salz 已提交
1640 1641
     128,
     128,
1642 1643 1644
     },
    {
     1,
R
Rich Salz 已提交
1645
     TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA384,
1646
     TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA384,
R
Rich Salz 已提交
1647 1648 1649
     TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA384,
     SSL_kDHEPSK,
     SSL_aPSK,
1650
     SSL_AES256,
R
Rich Salz 已提交
1651 1652
     SSL_SHA384,
     TLS1_VERSION, TLS1_2_VERSION,
1653
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1654 1655
     SSL_HIGH | SSL_FIPS,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
1656 1657 1658 1659 1660
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
1661
     TLS1_TXT_DHE_PSK_WITH_NULL_SHA256,
1662
     TLS1_RFC_DHE_PSK_WITH_NULL_SHA256,
R
Rich Salz 已提交
1663 1664 1665 1666
     TLS1_CK_DHE_PSK_WITH_NULL_SHA256,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_eNULL,
1667
     SSL_SHA256,
R
Rich Salz 已提交
1668
     TLS1_VERSION, TLS1_2_VERSION,
1669
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1670 1671 1672 1673
     SSL_STRONG_NONE | SSL_FIPS,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
1674 1675 1676
     },
    {
     1,
R
Rich Salz 已提交
1677
     TLS1_TXT_DHE_PSK_WITH_NULL_SHA384,
1678
     TLS1_RFC_DHE_PSK_WITH_NULL_SHA384,
R
Rich Salz 已提交
1679 1680 1681 1682
     TLS1_CK_DHE_PSK_WITH_NULL_SHA384,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_eNULL,
1683
     SSL_SHA384,
R
Rich Salz 已提交
1684
     TLS1_VERSION, TLS1_2_VERSION,
1685
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1686
     SSL_STRONG_NONE | SSL_FIPS,
1687
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
R
Rich Salz 已提交
1688 1689
     0,
     0,
1690 1691 1692
     },
    {
     1,
R
Rich Salz 已提交
1693
     TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA256,
1694
     TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA256,
R
Rich Salz 已提交
1695 1696
     TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA256,
     SSL_kRSAPSK,
1697 1698 1699
     SSL_aRSA,
     SSL_AES128,
     SSL_SHA256,
R
Rich Salz 已提交
1700
     TLS1_VERSION, TLS1_2_VERSION,
1701
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1702
     SSL_HIGH | SSL_FIPS,
R
Rich Salz 已提交
1703
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
1704 1705 1706 1707 1708
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
1709
     TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA384,
1710
     TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA384,
R
Rich Salz 已提交
1711 1712
     TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA384,
     SSL_kRSAPSK,
1713 1714 1715
     SSL_aRSA,
     SSL_AES256,
     SSL_SHA384,
R
Rich Salz 已提交
1716
     TLS1_VERSION, TLS1_2_VERSION,
1717
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1718
     SSL_HIGH | SSL_FIPS,
1719 1720 1721 1722 1723 1724
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
     },
    {
     1,
R
Rich Salz 已提交
1725
     TLS1_TXT_RSA_PSK_WITH_NULL_SHA256,
1726
     TLS1_RFC_RSA_PSK_WITH_NULL_SHA256,
R
Rich Salz 已提交
1727 1728
     TLS1_CK_RSA_PSK_WITH_NULL_SHA256,
     SSL_kRSAPSK,
1729
     SSL_aRSA,
R
Rich Salz 已提交
1730 1731 1732
     SSL_eNULL,
     SSL_SHA256,
     TLS1_VERSION, TLS1_2_VERSION,
1733
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1734 1735 1736 1737
     SSL_STRONG_NONE | SSL_FIPS,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
1738 1739 1740
     },
    {
     1,
R
Rich Salz 已提交
1741
     TLS1_TXT_RSA_PSK_WITH_NULL_SHA384,
1742
     TLS1_RFC_RSA_PSK_WITH_NULL_SHA384,
R
Rich Salz 已提交
1743 1744
     TLS1_CK_RSA_PSK_WITH_NULL_SHA384,
     SSL_kRSAPSK,
1745
     SSL_aRSA,
R
Rich Salz 已提交
1746 1747 1748
     SSL_eNULL,
     SSL_SHA384,
     TLS1_VERSION, TLS1_2_VERSION,
1749
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1750
     SSL_STRONG_NONE | SSL_FIPS,
1751
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
R
Rich Salz 已提交
1752 1753
     0,
     0,
1754
     },
1755
#  ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
1756 1757 1758
    {
     1,
     TLS1_TXT_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
1759
     TLS1_RFC_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
1760 1761 1762 1763 1764
     TLS1_CK_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
     SSL_kECDHEPSK,
     SSL_aPSK,
     SSL_3DES,
     SSL_SHA1,
T
Todd Short 已提交
1765
     TLS1_VERSION, TLS1_2_VERSION,
1766
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1767
     SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
1768 1769 1770 1771
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
1772
#  endif
1773 1774 1775
    {
     1,
     TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA,
1776
     TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA,
1777 1778 1779 1780 1781
     TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA,
     SSL_kECDHEPSK,
     SSL_aPSK,
     SSL_AES128,
     SSL_SHA1,
T
Todd Short 已提交
1782
     TLS1_VERSION, TLS1_2_VERSION,
1783
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1784
     SSL_HIGH | SSL_FIPS,
1785 1786 1787 1788 1789 1790 1791
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA,
1792
     TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA,
1793 1794 1795 1796 1797
     TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA,
     SSL_kECDHEPSK,
     SSL_aPSK,
     SSL_AES256,
     SSL_SHA1,
T
Todd Short 已提交
1798
     TLS1_VERSION, TLS1_2_VERSION,
1799
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1800
     SSL_HIGH | SSL_FIPS,
1801 1802 1803 1804 1805 1806 1807
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
1808
     TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
1809 1810 1811 1812 1813
     TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
     SSL_kECDHEPSK,
     SSL_aPSK,
     SSL_AES128,
     SSL_SHA256,
1814
     TLS1_VERSION, TLS1_2_VERSION,
1815
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1816
     SSL_HIGH | SSL_FIPS,
1817 1818 1819 1820 1821 1822 1823
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
1824
     TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
1825 1826 1827 1828 1829
     TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
     SSL_kECDHEPSK,
     SSL_aPSK,
     SSL_AES256,
     SSL_SHA384,
1830
     TLS1_VERSION, TLS1_2_VERSION,
1831
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1832
     SSL_HIGH | SSL_FIPS,
1833 1834 1835 1836 1837 1838 1839
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA,
1840
     TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA,
1841 1842 1843 1844 1845
     TLS1_CK_ECDHE_PSK_WITH_NULL_SHA,
     SSL_kECDHEPSK,
     SSL_aPSK,
     SSL_eNULL,
     SSL_SHA1,
T
Todd Short 已提交
1846
     TLS1_VERSION, TLS1_2_VERSION,
1847
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1848
     SSL_STRONG_NONE | SSL_FIPS,
1849 1850 1851 1852 1853 1854 1855
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
     },
    {
     1,
     TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA256,
1856
     TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA256,
1857 1858 1859 1860 1861
     TLS1_CK_ECDHE_PSK_WITH_NULL_SHA256,
     SSL_kECDHEPSK,
     SSL_aPSK,
     SSL_eNULL,
     SSL_SHA256,
1862
     TLS1_VERSION, TLS1_2_VERSION,
1863
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1864
     SSL_STRONG_NONE | SSL_FIPS,
1865 1866 1867 1868 1869 1870 1871
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     0,
     0,
     },
    {
     1,
     TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA384,
1872
     TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA384,
1873 1874 1875 1876 1877
     TLS1_CK_ECDHE_PSK_WITH_NULL_SHA384,
     SSL_kECDHEPSK,
     SSL_aPSK,
     SSL_eNULL,
     SSL_SHA384,
1878
     TLS1_VERSION, TLS1_2_VERSION,
1879
     DTLS1_BAD_VER, DTLS1_2_VERSION,
1880
     SSL_STRONG_NONE | SSL_FIPS,
1881 1882 1883 1884 1885
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     0,
     0,
     },

1886
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
R
Rich Salz 已提交
1887 1888 1889
    {
     1,
     TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
1890
     TLS1_RFC_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
R
Rich Salz 已提交
1891 1892 1893 1894 1895 1896
     TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
     SSL_kSRP,
     SSL_aSRP,
     SSL_3DES,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1897
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1898
     SSL_NOT_DEFAULT | SSL_MEDIUM,
R
Rich Salz 已提交
1899 1900 1901 1902 1903 1904 1905
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
1906
     TLS1_RFC_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
R
Rich Salz 已提交
1907 1908 1909 1910 1911 1912
     TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
     SSL_kSRP,
     SSL_aRSA,
     SSL_3DES,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1913
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1914
     SSL_NOT_DEFAULT | SSL_MEDIUM,
R
Rich Salz 已提交
1915 1916 1917 1918 1919 1920 1921
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
1922
     TLS1_RFC_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
R
Rich Salz 已提交
1923 1924 1925 1926 1927 1928
     TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
     SSL_kSRP,
     SSL_aDSS,
     SSL_3DES,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1929
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1930
     SSL_NOT_DEFAULT | SSL_MEDIUM,
R
Rich Salz 已提交
1931 1932 1933 1934
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
1935
# endif
R
Rich Salz 已提交
1936 1937 1938
    {
     1,
     TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA,
1939
     TLS1_RFC_SRP_SHA_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
1940 1941 1942 1943 1944 1945
     TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA,
     SSL_kSRP,
     SSL_aSRP,
     SSL_AES128,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1946
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1947 1948 1949 1950 1951 1952 1953 1954
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
1955
     TLS1_RFC_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
1956 1957 1958 1959 1960 1961
     TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
     SSL_kSRP,
     SSL_aRSA,
     SSL_AES128,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1962
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1963 1964 1965 1966 1967 1968 1969 1970
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
1971
     TLS1_RFC_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
1972 1973 1974 1975 1976 1977
     TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
     SSL_kSRP,
     SSL_aDSS,
     SSL_AES128,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1978
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1979 1980 1981 1982 1983 1984 1985 1986
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA,
1987
     TLS1_RFC_SRP_SHA_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
1988 1989 1990 1991 1992 1993
     TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA,
     SSL_kSRP,
     SSL_aSRP,
     SSL_AES256,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1994
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1995 1996 1997 1998 1999 2000 2001 2002
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
2003
     TLS1_RFC_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
2004 2005 2006 2007 2008 2009
     TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
     SSL_kSRP,
     SSL_aRSA,
     SSL_AES256,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2010
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2011 2012 2013 2014 2015 2016 2017 2018
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
2019
     TLS1_RFC_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
2020 2021 2022 2023 2024 2025
     TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
     SSL_kSRP,
     SSL_aDSS,
     SSL_AES256,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2026
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2027 2028 2029 2030 2031 2032 2033 2034 2035 2036
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },

#if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
    {
     1,
     TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305,
2037
     TLS1_RFC_DHE_RSA_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052
     TLS1_CK_DHE_RSA_WITH_CHACHA20_POLY1305,
     SSL_kDHE,
     SSL_aRSA,
     SSL_CHACHA20POLY1305,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305,
2053
     TLS1_RFC_ECDHE_RSA_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068
     TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305,
     SSL_kECDHE,
     SSL_aRSA,
     SSL_CHACHA20POLY1305,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
2069
     TLS1_RFC_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084
     TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_CHACHA20POLY1305,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_PSK_WITH_CHACHA20_POLY1305,
2085
     TLS1_RFC_PSK_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100
     TLS1_CK_PSK_WITH_CHACHA20_POLY1305,
     SSL_kPSK,
     SSL_aPSK,
     SSL_CHACHA20POLY1305,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305,
2101
     TLS1_RFC_ECDHE_PSK_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116
     TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305,
     SSL_kECDHEPSK,
     SSL_aPSK,
     SSL_CHACHA20POLY1305,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_PSK_WITH_CHACHA20_POLY1305,
2117
     TLS1_RFC_DHE_PSK_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132
     TLS1_CK_DHE_PSK_WITH_CHACHA20_POLY1305,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_CHACHA20POLY1305,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_RSA_PSK_WITH_CHACHA20_POLY1305,
2133
     TLS1_RFC_RSA_PSK_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145
     TLS1_CK_RSA_PSK_WITH_CHACHA20_POLY1305,
     SSL_kRSAPSK,
     SSL_aRSA,
     SSL_CHACHA20POLY1305,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
     },
E
Emilia Kasper 已提交
2146 2147
#endif                          /* !defined(OPENSSL_NO_CHACHA) &&
                                 * !defined(OPENSSL_NO_POLY1305) */
R
Rich Salz 已提交
2148 2149 2150 2151 2152

#ifndef OPENSSL_NO_CAMELLIA
    {
     1,
     TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2153
     TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA256,
R
Rich Salz 已提交
2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168
     TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256,
     SSL_kRSA,
     SSL_aRSA,
     SSL_CAMELLIA128,
     SSL_SHA256,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
2169
     TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
R
Rich Salz 已提交
2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184
     TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
     SSL_kEDH,
     SSL_aDSS,
     SSL_CAMELLIA128,
     SSL_SHA256,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2185
     TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
R
Rich Salz 已提交
2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200
     TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
     SSL_kEDH,
     SSL_aRSA,
     SSL_CAMELLIA128,
     SSL_SHA256,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA256,
2201
     TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA256,
R
Rich Salz 已提交
2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216
     TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA256,
     SSL_kEDH,
     SSL_aNULL,
     SSL_CAMELLIA128,
     SSL_SHA256,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA256,
2217
     TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA256,
R
Rich Salz 已提交
2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232
     TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA256,
     SSL_kRSA,
     SSL_aRSA,
     SSL_CAMELLIA256,
     SSL_SHA256,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
2233
     TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
R
Rich Salz 已提交
2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248
     TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
     SSL_kEDH,
     SSL_aDSS,
     SSL_CAMELLIA256,
     SSL_SHA256,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
2249
     TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
R
Rich Salz 已提交
2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264
     TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
     SSL_kEDH,
     SSL_aRSA,
     SSL_CAMELLIA256,
     SSL_SHA256,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA256,
2265
     TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA256,
R
Rich Salz 已提交
2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280
     TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256,
     SSL_kEDH,
     SSL_aNULL,
     SSL_CAMELLIA256,
     SSL_SHA256,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA,
2281
     TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA,
R
Rich Salz 已提交
2282 2283 2284 2285 2286 2287
     TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA,
     SSL_kRSA,
     SSL_aRSA,
     SSL_CAMELLIA256,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2288
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2289 2290 2291 2292 2293 2294 2295 2296
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
2297
     TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
R
Rich Salz 已提交
2298 2299 2300 2301 2302 2303
     TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
     SSL_kDHE,
     SSL_aDSS,
     SSL_CAMELLIA256,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2304
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2305 2306 2307 2308 2309 2310 2311 2312
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
2313
     TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
R
Rich Salz 已提交
2314 2315 2316 2317 2318 2319
     TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
     SSL_kDHE,
     SSL_aRSA,
     SSL_CAMELLIA256,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2320
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2321 2322 2323 2324 2325 2326 2327 2328
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA,
2329
     TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA,
R
Rich Salz 已提交
2330 2331 2332 2333 2334 2335
     TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA,
     SSL_kDHE,
     SSL_aNULL,
     SSL_CAMELLIA256,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2336
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2337 2338 2339 2340 2341 2342 2343 2344
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA,
2345
     TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA,
R
Rich Salz 已提交
2346 2347 2348 2349 2350 2351
     TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA,
     SSL_kRSA,
     SSL_aRSA,
     SSL_CAMELLIA128,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2352
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2353 2354 2355 2356 2357 2358 2359 2360
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
2361
     TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
R
Rich Salz 已提交
2362 2363 2364 2365 2366 2367
     TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
     SSL_kDHE,
     SSL_aDSS,
     SSL_CAMELLIA128,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2368
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2369 2370 2371 2372 2373 2374 2375 2376
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
2377
     TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
R
Rich Salz 已提交
2378 2379 2380 2381 2382 2383
     TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
     SSL_kDHE,
     SSL_aRSA,
     SSL_CAMELLIA128,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2384
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2385 2386 2387 2388 2389 2390 2391 2392
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA,
2393
     TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA,
R
Rich Salz 已提交
2394 2395 2396 2397 2398 2399
     TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA,
     SSL_kDHE,
     SSL_aNULL,
     SSL_CAMELLIA128,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2400
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2401 2402 2403 2404 2405 2406
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
2407 2408
     1,
     TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
2409
     TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
2410 2411 2412 2413 2414
     TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_CAMELLIA128,
     SSL_SHA256,
2415 2416
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2417
     SSL_NOT_DEFAULT | SSL_HIGH,
2418 2419
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
E
Emilia Kasper 已提交
2420 2421
     128,
     },
R
Rich Salz 已提交
2422
    {
2423 2424
     1,
     TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
2425
     TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
2426 2427 2428 2429 2430
     TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_CAMELLIA256,
     SSL_SHA384,
2431 2432
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2433
     SSL_NOT_DEFAULT | SSL_HIGH,
2434 2435
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
E
Emilia Kasper 已提交
2436 2437
     256,
     },
R
Rich Salz 已提交
2438
    {
2439 2440
     1,
     TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2441
     TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
2442 2443 2444 2445 2446
     TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
     SSL_kECDHE,
     SSL_aRSA,
     SSL_CAMELLIA128,
     SSL_SHA256,
2447 2448
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2449
     SSL_NOT_DEFAULT | SSL_HIGH,
2450 2451
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
E
Emilia Kasper 已提交
2452 2453
     128,
     },
R
Rich Salz 已提交
2454
    {
2455 2456
     1,
     TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
2457
     TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
2458 2459 2460 2461 2462
     TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
     SSL_kECDHE,
     SSL_aRSA,
     SSL_CAMELLIA256,
     SSL_SHA384,
2463 2464
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2465
     SSL_NOT_DEFAULT | SSL_HIGH,
2466 2467
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
E
Emilia Kasper 已提交
2468 2469
     256,
     },
R
Rich Salz 已提交
2470
    {
2471 2472
     1,
     TLS1_TXT_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2473
     TLS1_RFC_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2474 2475 2476 2477 2478
     TLS1_CK_PSK_WITH_CAMELLIA_128_CBC_SHA256,
     SSL_kPSK,
     SSL_aPSK,
     SSL_CAMELLIA128,
     SSL_SHA256,
2479
     TLS1_VERSION, TLS1_2_VERSION,
2480
     DTLS1_BAD_VER, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2481
     SSL_NOT_DEFAULT | SSL_HIGH,
2482 2483
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
E
Emilia Kasper 已提交
2484 2485
     128,
     },
R
Rich Salz 已提交
2486
    {
2487 2488
     1,
     TLS1_TXT_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2489
     TLS1_RFC_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2490 2491 2492 2493 2494
     TLS1_CK_PSK_WITH_CAMELLIA_256_CBC_SHA384,
     SSL_kPSK,
     SSL_aPSK,
     SSL_CAMELLIA256,
     SSL_SHA384,
2495
     TLS1_VERSION, TLS1_2_VERSION,
2496
     DTLS1_BAD_VER, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2497
     SSL_NOT_DEFAULT | SSL_HIGH,
2498 2499
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
E
Emilia Kasper 已提交
2500 2501
     256,
     },
R
Rich Salz 已提交
2502
    {
2503 2504
     1,
     TLS1_TXT_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2505
     TLS1_RFC_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2506 2507 2508 2509 2510
     TLS1_CK_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_CAMELLIA128,
     SSL_SHA256,
2511
     TLS1_VERSION, TLS1_2_VERSION,
2512
     DTLS1_BAD_VER, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2513
     SSL_NOT_DEFAULT | SSL_HIGH,
2514 2515
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
E
Emilia Kasper 已提交
2516 2517
     128,
     },
R
Rich Salz 已提交
2518
    {
2519 2520
     1,
     TLS1_TXT_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2521
     TLS1_RFC_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2522 2523 2524 2525 2526
     TLS1_CK_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_CAMELLIA256,
     SSL_SHA384,
2527
     TLS1_VERSION, TLS1_2_VERSION,
2528
     DTLS1_BAD_VER, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2529
     SSL_NOT_DEFAULT | SSL_HIGH,
2530 2531
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
E
Emilia Kasper 已提交
2532 2533
     256,
     },
R
Rich Salz 已提交
2534
    {
2535 2536
     1,
     TLS1_TXT_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2537
     TLS1_RFC_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2538 2539 2540 2541 2542
     TLS1_CK_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
     SSL_kRSAPSK,
     SSL_aRSA,
     SSL_CAMELLIA128,
     SSL_SHA256,
2543
     TLS1_VERSION, TLS1_2_VERSION,
2544
     DTLS1_BAD_VER, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2545
     SSL_NOT_DEFAULT | SSL_HIGH,
2546 2547
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
E
Emilia Kasper 已提交
2548 2549
     128,
     },
R
Rich Salz 已提交
2550
    {
2551 2552
     1,
     TLS1_TXT_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2553
     TLS1_RFC_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2554 2555 2556 2557 2558
     TLS1_CK_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
     SSL_kRSAPSK,
     SSL_aRSA,
     SSL_CAMELLIA256,
     SSL_SHA384,
2559
     TLS1_VERSION, TLS1_2_VERSION,
2560
     DTLS1_BAD_VER, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2561
     SSL_NOT_DEFAULT | SSL_HIGH,
2562 2563
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
E
Emilia Kasper 已提交
2564 2565
     256,
     },
2566 2567
    {
     1,
R
Rich Salz 已提交
2568
     TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
2569
     TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
R
Rich Salz 已提交
2570 2571
     TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
     SSL_kECDHEPSK,
2572
     SSL_aPSK,
R
Rich Salz 已提交
2573 2574 2575
     SSL_CAMELLIA128,
     SSL_SHA256,
     TLS1_VERSION, TLS1_2_VERSION,
2576
     DTLS1_BAD_VER, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2577
     SSL_NOT_DEFAULT | SSL_HIGH,
R
Rich Salz 已提交
2578
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2579
     128,
E
Emilia Kasper 已提交
2580 2581
     128,
     },
2582 2583
    {
     1,
R
Rich Salz 已提交
2584
     TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
2585
     TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
R
Rich Salz 已提交
2586 2587
     TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
     SSL_kECDHEPSK,
2588
     SSL_aPSK,
R
Rich Salz 已提交
2589 2590 2591
     SSL_CAMELLIA256,
     SSL_SHA384,
     TLS1_VERSION, TLS1_2_VERSION,
2592
     DTLS1_BAD_VER, DTLS1_2_VERSION,
E
Emilia Kasper 已提交
2593
     SSL_NOT_DEFAULT | SSL_HIGH,
R
Rich Salz 已提交
2594
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
2595
     256,
E
Emilia Kasper 已提交
2596 2597 2598
     256,
     },
#endif                          /* OPENSSL_NO_CAMELLIA */
2599

P
Pauli 已提交
2600
#ifndef OPENSSL_NO_GOST
2601 2602
    {
     1,
R
Rich Salz 已提交
2603
     "GOST2001-GOST89-GOST89",
2604
     "TLS_GOSTR341001_WITH_28147_CNT_IMIT",
R
Rich Salz 已提交
2605 2606 2607 2608 2609 2610
     0x3000081,
     SSL_kGOST,
     SSL_aGOST01,
     SSL_eGOST2814789CNT,
     SSL_GOST89MAC,
     TLS1_VERSION, TLS1_2_VERSION,
2611
     0, 0,
R
Rich Salz 已提交
2612 2613
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94 | TLS1_STREAM_MAC,
2614
     256,
E
Emilia Kasper 已提交
2615 2616
     256,
     },
R
Rich Salz 已提交
2617 2618 2619
    {
     1,
     "GOST2001-NULL-GOST94",
2620
     "TLS_GOSTR341001_WITH_NULL_GOSTR3411",
R
Rich Salz 已提交
2621 2622 2623 2624 2625 2626
     0x3000083,
     SSL_kGOST,
     SSL_aGOST01,
     SSL_eNULL,
     SSL_GOST94,
     TLS1_VERSION, TLS1_2_VERSION,
2627
     0, 0,
R
Rich Salz 已提交
2628 2629 2630
     SSL_STRONG_NONE,
     SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94,
     0,
E
Emilia Kasper 已提交
2631 2632
     0,
     },
R
Rich Salz 已提交
2633 2634 2635
    {
     1,
     "GOST2012-GOST8912-GOST8912",
2636
     NULL,
R
Rich Salz 已提交
2637 2638 2639 2640 2641 2642
     0x0300ff85,
     SSL_kGOST,
     SSL_aGOST12 | SSL_aGOST01,
     SSL_eGOST2814789CNT12,
     SSL_GOST89MAC12,
     TLS1_VERSION, TLS1_2_VERSION,
2643
     0, 0,
R
Rich Salz 已提交
2644 2645
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_STREAM_MAC,
2646
     256,
E
Emilia Kasper 已提交
2647 2648
     256,
     },
R
Rich Salz 已提交
2649 2650 2651
    {
     1,
     "GOST2012-NULL-GOST12",
2652
     NULL,
R
Rich Salz 已提交
2653 2654 2655 2656 2657 2658
     0x0300ff87,
     SSL_kGOST,
     SSL_aGOST12 | SSL_aGOST01,
     SSL_eNULL,
     SSL_GOST12_256,
     TLS1_VERSION, TLS1_2_VERSION,
2659
     0, 0,
R
Rich Salz 已提交
2660 2661 2662
     SSL_STRONG_NONE,
     SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_STREAM_MAC,
     0,
E
Emilia Kasper 已提交
2663 2664 2665
     0,
     },
#endif                          /* OPENSSL_NO_GOST */
2666

R
Rich Salz 已提交
2667
#ifndef OPENSSL_NO_IDEA
2668 2669
    {
     1,
R
Rich Salz 已提交
2670
     SSL3_TXT_RSA_IDEA_128_SHA,
2671
     SSL3_RFC_RSA_IDEA_128_SHA,
R
Rich Salz 已提交
2672 2673 2674 2675 2676 2677
     SSL3_CK_RSA_IDEA_128_SHA,
     SSL_kRSA,
     SSL_aRSA,
     SSL_IDEA,
     SSL_SHA1,
     SSL3_VERSION, TLS1_1_VERSION,
2678
     DTLS1_BAD_VER, DTLS1_VERSION,
R
Rich Salz 已提交
2679 2680
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2681 2682 2683
     128,
     128,
     },
R
Rich Salz 已提交
2684
#endif
2685

R
Rich Salz 已提交
2686
#ifndef OPENSSL_NO_SEED
2687 2688
    {
     1,
R
Rich Salz 已提交
2689
     TLS1_TXT_RSA_WITH_SEED_SHA,
2690
     TLS1_RFC_RSA_WITH_SEED_SHA,
R
Rich Salz 已提交
2691 2692 2693 2694 2695 2696
     TLS1_CK_RSA_WITH_SEED_SHA,
     SSL_kRSA,
     SSL_aRSA,
     SSL_SEED,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2697
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2698 2699 2700 2701
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
2702 2703 2704
     },
    {
     1,
R
Rich Salz 已提交
2705
     TLS1_TXT_DHE_DSS_WITH_SEED_SHA,
2706
     TLS1_RFC_DHE_DSS_WITH_SEED_SHA,
R
Rich Salz 已提交
2707 2708 2709 2710 2711 2712
     TLS1_CK_DHE_DSS_WITH_SEED_SHA,
     SSL_kDHE,
     SSL_aDSS,
     SSL_SEED,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2713
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2714 2715
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2716 2717 2718 2719 2720
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
2721
     TLS1_TXT_DHE_RSA_WITH_SEED_SHA,
2722
     TLS1_RFC_DHE_RSA_WITH_SEED_SHA,
R
Rich Salz 已提交
2723 2724 2725 2726 2727 2728
     TLS1_CK_DHE_RSA_WITH_SEED_SHA,
     SSL_kDHE,
     SSL_aRSA,
     SSL_SEED,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2729
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2730 2731 2732 2733
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
2734 2735 2736
     },
    {
     1,
R
Rich Salz 已提交
2737
     TLS1_TXT_ADH_WITH_SEED_SHA,
2738
     TLS1_RFC_ADH_WITH_SEED_SHA,
R
Rich Salz 已提交
2739 2740 2741 2742 2743 2744
     TLS1_CK_ADH_WITH_SEED_SHA,
     SSL_kDHE,
     SSL_aNULL,
     SSL_SEED,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2745
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2746 2747
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2748 2749 2750
     128,
     128,
     },
E
Emilia Kasper 已提交
2751
#endif                          /* OPENSSL_NO_SEED */
2752

R
Rich Salz 已提交
2753 2754 2755 2756
#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
    {
     1,
     SSL3_TXT_RSA_RC4_128_MD5,
2757
     SSL3_RFC_RSA_RC4_128_MD5,
R
Rich Salz 已提交
2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769
     SSL3_CK_RSA_RC4_128_MD5,
     SSL_kRSA,
     SSL_aRSA,
     SSL_RC4,
     SSL_MD5,
     SSL3_VERSION, TLS1_2_VERSION,
     0, 0,
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
2770 2771
    {
     1,
R
Rich Salz 已提交
2772
     SSL3_TXT_RSA_RC4_128_SHA,
2773
     SSL3_RFC_RSA_RC4_128_SHA,
R
Rich Salz 已提交
2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784
     SSL3_CK_RSA_RC4_128_SHA,
     SSL_kRSA,
     SSL_aRSA,
     SSL_RC4,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
     0, 0,
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
2785 2786 2787
     },
    {
     1,
R
Rich Salz 已提交
2788
     SSL3_TXT_ADH_RC4_128_MD5,
2789
     SSL3_RFC_ADH_RC4_128_MD5,
R
Rich Salz 已提交
2790 2791 2792 2793 2794 2795 2796 2797 2798
     SSL3_CK_ADH_RC4_128_MD5,
     SSL_kDHE,
     SSL_aNULL,
     SSL_RC4,
     SSL_MD5,
     SSL3_VERSION, TLS1_2_VERSION,
     0, 0,
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
2799 2800 2801 2802 2803
     128,
     128,
     },
    {
     1,
R
Rich Salz 已提交
2804
     TLS1_TXT_ECDHE_PSK_WITH_RC4_128_SHA,
2805
     TLS1_RFC_ECDHE_PSK_WITH_RC4_128_SHA,
R
Rich Salz 已提交
2806 2807 2808 2809 2810
     TLS1_CK_ECDHE_PSK_WITH_RC4_128_SHA,
     SSL_kECDHEPSK,
     SSL_aPSK,
     SSL_RC4,
     SSL_SHA1,
T
Todd Short 已提交
2811
     TLS1_VERSION, TLS1_2_VERSION,
R
Rich Salz 已提交
2812 2813 2814 2815 2816
     0, 0,
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
2817
     },
A
Andy Polyakov 已提交
2818 2819
    {
     1,
R
Rich Salz 已提交
2820
     TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA,
2821
     TLS1_RFC_ECDH_anon_WITH_RC4_128_SHA,
R
Rich Salz 已提交
2822
     TLS1_CK_ECDH_anon_WITH_RC4_128_SHA,
A
Andy Polyakov 已提交
2823
     SSL_kECDHE,
R
Rich Salz 已提交
2824 2825 2826
     SSL_aNULL,
     SSL_RC4,
     SSL_SHA1,
T
Todd Short 已提交
2827
     TLS1_VERSION, TLS1_2_VERSION,
R
Rich Salz 已提交
2828 2829 2830 2831 2832
     0, 0,
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
A
Andy Polyakov 已提交
2833 2834 2835
     },
    {
     1,
R
Rich Salz 已提交
2836
     TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA,
2837
     TLS1_RFC_ECDHE_ECDSA_WITH_RC4_128_SHA,
R
Rich Salz 已提交
2838
     TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA,
A
Andy Polyakov 已提交
2839 2840
     SSL_kECDHE,
     SSL_aECDSA,
R
Rich Salz 已提交
2841 2842
     SSL_RC4,
     SSL_SHA1,
T
Todd Short 已提交
2843
     TLS1_VERSION, TLS1_2_VERSION,
R
Rich Salz 已提交
2844 2845 2846 2847 2848
     0, 0,
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
A
Andy Polyakov 已提交
2849 2850 2851
     },
    {
     1,
R
Rich Salz 已提交
2852
     TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA,
2853
     TLS1_RFC_ECDHE_RSA_WITH_RC4_128_SHA,
R
Rich Salz 已提交
2854 2855
     TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA,
     SSL_kECDHE,
A
Andy Polyakov 已提交
2856
     SSL_aRSA,
R
Rich Salz 已提交
2857 2858
     SSL_RC4,
     SSL_SHA1,
T
Todd Short 已提交
2859
     TLS1_VERSION, TLS1_2_VERSION,
R
Rich Salz 已提交
2860 2861 2862 2863 2864
     0, 0,
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
A
Andy Polyakov 已提交
2865 2866 2867
     },
    {
     1,
R
Rich Salz 已提交
2868
     TLS1_TXT_PSK_WITH_RC4_128_SHA,
2869
     TLS1_RFC_PSK_WITH_RC4_128_SHA,
R
Rich Salz 已提交
2870
     TLS1_CK_PSK_WITH_RC4_128_SHA,
A
Andy Polyakov 已提交
2871 2872
     SSL_kPSK,
     SSL_aPSK,
R
Rich Salz 已提交
2873 2874 2875 2876 2877 2878 2879 2880
     SSL_RC4,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
     0, 0,
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
A
Andy Polyakov 已提交
2881 2882 2883
     },
    {
     1,
R
Rich Salz 已提交
2884
     TLS1_TXT_RSA_PSK_WITH_RC4_128_SHA,
2885
     TLS1_RFC_RSA_PSK_WITH_RC4_128_SHA,
R
Rich Salz 已提交
2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896
     TLS1_CK_RSA_PSK_WITH_RC4_128_SHA,
     SSL_kRSAPSK,
     SSL_aRSA,
     SSL_RC4,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
     0, 0,
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
A
Andy Polyakov 已提交
2897 2898 2899
     },
    {
     1,
R
Rich Salz 已提交
2900
     TLS1_TXT_DHE_PSK_WITH_RC4_128_SHA,
2901
     TLS1_RFC_DHE_PSK_WITH_RC4_128_SHA,
R
Rich Salz 已提交
2902
     TLS1_CK_DHE_PSK_WITH_RC4_128_SHA,
A
Andy Polyakov 已提交
2903 2904
     SSL_kDHEPSK,
     SSL_aPSK,
R
Rich Salz 已提交
2905 2906 2907 2908 2909 2910 2911 2912
     SSL_RC4,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
     0, 0,
     SSL_NOT_DEFAULT | SSL_MEDIUM,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
A
Andy Polyakov 已提交
2913
     },
E
Emilia Kasper 已提交
2914
#endif                          /* OPENSSL_NO_WEAK_SSL_CIPHERS */
2915

2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173
#ifndef OPENSSL_NO_ARIA
    {
     1,
     TLS1_TXT_RSA_WITH_ARIA_128_GCM_SHA256,
     TLS1_RFC_RSA_WITH_ARIA_128_GCM_SHA256,
     TLS1_CK_RSA_WITH_ARIA_128_GCM_SHA256,
     SSL_kRSA,
     SSL_aRSA,
     SSL_ARIA128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_RSA_WITH_ARIA_256_GCM_SHA384,
     TLS1_RFC_RSA_WITH_ARIA_256_GCM_SHA384,
     TLS1_CK_RSA_WITH_ARIA_256_GCM_SHA384,
     SSL_kRSA,
     SSL_aRSA,
     SSL_ARIA256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_RSA_WITH_ARIA_128_GCM_SHA256,
     TLS1_RFC_DHE_RSA_WITH_ARIA_128_GCM_SHA256,
     TLS1_CK_DHE_RSA_WITH_ARIA_128_GCM_SHA256,
     SSL_kDHE,
     SSL_aRSA,
     SSL_ARIA128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
     TLS1_RFC_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
     TLS1_CK_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
     SSL_kDHE,
     SSL_aRSA,
     SSL_ARIA256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_DSS_WITH_ARIA_128_GCM_SHA256,
     TLS1_RFC_DHE_DSS_WITH_ARIA_128_GCM_SHA256,
     TLS1_CK_DHE_DSS_WITH_ARIA_128_GCM_SHA256,
     SSL_kDHE,
     SSL_aDSS,
     SSL_ARIA128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_DHE_DSS_WITH_ARIA_256_GCM_SHA384,
     TLS1_RFC_DHE_DSS_WITH_ARIA_256_GCM_SHA384,
     TLS1_CK_DHE_DSS_WITH_ARIA_256_GCM_SHA384,
     SSL_kDHE,
     SSL_aDSS,
     SSL_ARIA256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256,
     TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256,
     TLS1_CK_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_ARIA128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384,
     TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384,
     TLS1_CK_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384,
     SSL_kECDHE,
     SSL_aECDSA,
     SSL_ARIA256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256,
     TLS1_RFC_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256,
     TLS1_CK_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256,
     SSL_kECDHE,
     SSL_aRSA,
     SSL_ARIA128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
     TLS1_RFC_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
     TLS1_CK_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
     SSL_kECDHE,
     SSL_aRSA,
     SSL_ARIA256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_PSK_WITH_ARIA_128_GCM_SHA256,
     TLS1_RFC_PSK_WITH_ARIA_128_GCM_SHA256,
     TLS1_CK_PSK_WITH_ARIA_128_GCM_SHA256,
     SSL_kPSK,
     SSL_aPSK,
     SSL_ARIA128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_PSK_WITH_ARIA_256_GCM_SHA384,
     TLS1_RFC_PSK_WITH_ARIA_256_GCM_SHA384,
     TLS1_CK_PSK_WITH_ARIA_256_GCM_SHA384,
     SSL_kPSK,
     SSL_aPSK,
     SSL_ARIA256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
     TLS1_RFC_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
     TLS1_CK_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_ARIA128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
     TLS1_RFC_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
     TLS1_CK_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
     SSL_kDHEPSK,
     SSL_aPSK,
     SSL_ARIA256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_RSA_PSK_WITH_ARIA_128_GCM_SHA256,
     TLS1_RFC_RSA_PSK_WITH_ARIA_128_GCM_SHA256,
     TLS1_CK_RSA_PSK_WITH_ARIA_128_GCM_SHA256,
     SSL_kRSAPSK,
     SSL_aRSA,
     SSL_ARIA128GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_RSA_PSK_WITH_ARIA_256_GCM_SHA384,
     TLS1_RFC_RSA_PSK_WITH_ARIA_256_GCM_SHA384,
     TLS1_CK_RSA_PSK_WITH_ARIA_256_GCM_SHA384,
     SSL_kRSAPSK,
     SSL_aRSA,
     SSL_ARIA256GCM,
     SSL_AEAD,
     TLS1_2_VERSION, TLS1_2_VERSION,
     DTLS1_2_VERSION, DTLS1_2_VERSION,
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
     256,
     256,
     },
#endif /* OPENSSL_NO_ARIA */
3174 3175
};

3176 3177 3178 3179 3180 3181 3182 3183 3184
/*
 * The list of known Signalling Cipher-Suite Value "ciphers", non-valid
 * values stuffed into the ciphers field of the wire protocol for signalling
 * purposes.
 */
static SSL_CIPHER ssl3_scsvs[] = {
    {
     0,
     "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
3185
     "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
3186 3187 3188 3189 3190 3191
     SSL3_CK_SCSV,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    },
    {
     0,
     "TLS_FALLBACK_SCSV",
3192
     "TLS_FALLBACK_SCSV",
3193 3194 3195 3196 3197
     SSL3_CK_FALLBACK_SCSV,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    },
};

R
Rich Salz 已提交
3198 3199 3200 3201 3202
static int cipher_compare(const void *a, const void *b)
{
    const SSL_CIPHER *ap = (const SSL_CIPHER *)a;
    const SSL_CIPHER *bp = (const SSL_CIPHER *)b;

R
Richard Levitte 已提交
3203 3204 3205
    if (ap->id == bp->id)
        return 0;
    return ap->id < bp->id ? -1 : 1;
R
Rich Salz 已提交
3206 3207 3208 3209
}

void ssl_sort_cipher_list(void)
{
R
Rich Salz 已提交
3210
    qsort(ssl3_ciphers, SSL3_NUM_CIPHERS, sizeof(ssl3_ciphers[0]),
R
Rich Salz 已提交
3211
          cipher_compare);
R
Rich Salz 已提交
3212
    qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
R
Rich Salz 已提交
3213 3214
}

B
Bernd Edlinger 已提交
3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228
static int ssl_undefined_function_1(SSL *ssl, unsigned char *r, size_t s,
                                    const char * t, size_t u,
                                    const unsigned char * v, size_t w, int x)
{
    (void)r;
    (void)s;
    (void)t;
    (void)u;
    (void)v;
    (void)w;
    (void)x;
    return ssl_undefined_function(ssl);
}

3229 3230 3231 3232 3233 3234 3235 3236 3237 3238
const SSL3_ENC_METHOD SSLv3_enc_data = {
    ssl3_enc,
    n_ssl3_mac,
    ssl3_setup_key_block,
    ssl3_generate_master_secret,
    ssl3_change_cipher_state,
    ssl3_final_finish_mac,
    SSL3_MD_CLIENT_FINISHED_CONST, 4,
    SSL3_MD_SERVER_FINISHED_CONST, 4,
    ssl3_alert_code,
B
Bernd Edlinger 已提交
3239
    ssl_undefined_function_1,
3240
    0,
M
Matt Caswell 已提交
3241
    ssl3_set_handshake_header,
3242
    tls_close_construct_packet,
3243 3244
    ssl3_handshake_write
};
3245

3246
long ssl3_default_timeout(void)
3247 3248 3249 3250 3251 3252 3253
{
    /*
     * 2 hours, the 24 hours mentioned in the SSLv3 spec is way too long for
     * http, the cache would over fill
     */
    return (60 * 60 * 2);
}
3254

U
Ulf Möller 已提交
3255
int ssl3_num_ciphers(void)
3256
{
K
KaoruToda 已提交
3257
    return SSL3_NUM_CIPHERS;
3258
}
3259

3260
const SSL_CIPHER *ssl3_get_cipher(unsigned int u)
3261 3262
{
    if (u < SSL3_NUM_CIPHERS)
K
KaoruToda 已提交
3263
        return &(ssl3_ciphers[SSL3_NUM_CIPHERS - 1 - u]);
3264
    else
K
KaoruToda 已提交
3265
        return NULL;
3266
}
3267

M
Matt Caswell 已提交
3268
int ssl3_set_handshake_header(SSL *s, WPACKET *pkt, int htype)
3269
{
3270 3271 3272 3273
    /* No header in the event of a CCS */
    if (htype == SSL3_MT_CHANGE_CIPHER_SPEC)
        return 1;

3274
    /* Set the content type and 3 bytes for the message len */
3275
    if (!WPACKET_put_bytes_u8(pkt, htype)
M
Matt Caswell 已提交
3276
            || !WPACKET_start_sub_packet_u24(pkt))
3277 3278 3279 3280 3281
        return 0;

    return 1;
}

D
Dr. Stephen Henson 已提交
3282
int ssl3_handshake_write(SSL *s)
3283 3284 3285
{
    return ssl3_do_write(s, SSL3_RT_HANDSHAKE);
}
D
Dr. Stephen Henson 已提交
3286

U
Ulf Möller 已提交
3287
int ssl3_new(SSL *s)
3288 3289
{
    SSL3_STATE *s3;
3290

R
Rich Salz 已提交
3291
    if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
3292 3293
        goto err;
    s->s3 = s3;
B
Ben Laurie 已提交
3294

B
Ben Laurie 已提交
3295
#ifndef OPENSSL_NO_SRP
V
Viktor Dukhovni 已提交
3296
    if (!SSL_SRP_CTX_init(s))
E
Emilia Kasper 已提交
3297
        goto err;
B
Ben Laurie 已提交
3298
#endif
3299 3300 3301 3302

    if (!s->method->ssl_clear(s))
        return 0;

M
Matt Caswell 已提交
3303
    return 1;
3304
 err:
M
Matt Caswell 已提交
3305
    return 0;
3306
}
3307

U
Ulf Möller 已提交
3308
void ssl3_free(SSL *s)
3309
{
3310
    if (s == NULL || s->s3 == NULL)
3311
        return;
B
Ben Laurie 已提交
3312

3313
    ssl3_cleanup_key_block(s);
3314

D
Dr. Stephen Henson 已提交
3315
#if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH)
3316 3317
    EVP_PKEY_free(s->s3->peer_tmp);
    s->s3->peer_tmp = NULL;
D
Dr. Stephen Henson 已提交
3318 3319
    EVP_PKEY_free(s->s3->tmp.pkey);
    s->s3->tmp.pkey = NULL;
B
Bodo Möller 已提交
3320 3321
#endif

3322
    OPENSSL_free(s->s3->tmp.ctype);
3323
    sk_X509_NAME_pop_free(s->s3->tmp.peer_ca_names, X509_NAME_free);
D
Dr. Stephen Henson 已提交
3324 3325 3326
    OPENSSL_free(s->s3->tmp.ciphers_raw);
    OPENSSL_clear_free(s->s3->tmp.pms, s->s3->tmp.pmslen);
    OPENSSL_free(s->s3->tmp.peer_sigalgs);
3327
    OPENSSL_free(s->s3->tmp.peer_cert_sigalgs);
3328
    ssl3_free_digest_list(s);
R
Rich Salz 已提交
3329
    OPENSSL_free(s->s3->alpn_selected);
T
Todd Short 已提交
3330
    OPENSSL_free(s->s3->alpn_proposed);
A
Adam Langley 已提交
3331

B
Ben Laurie 已提交
3332
#ifndef OPENSSL_NO_SRP
3333
    SSL_SRP_CTX_free(s);
B
Ben Laurie 已提交
3334
#endif
R
Rich Salz 已提交
3335
    OPENSSL_clear_free(s->s3, sizeof(*s->s3));
3336 3337
    s->s3 = NULL;
}
3338

3339
int ssl3_clear(SSL *s)
3340 3341
{
    ssl3_cleanup_key_block(s);
3342
    OPENSSL_free(s->s3->tmp.ctype);
3343
    sk_X509_NAME_pop_free(s->s3->tmp.peer_ca_names, X509_NAME_free);
D
Dr. Stephen Henson 已提交
3344 3345 3346
    OPENSSL_free(s->s3->tmp.ciphers_raw);
    OPENSSL_clear_free(s->s3->tmp.pms, s->s3->tmp.pmslen);
    OPENSSL_free(s->s3->tmp.peer_sigalgs);
3347
    OPENSSL_free(s->s3->tmp.peer_cert_sigalgs);
3348

D
Dr. Stephen Henson 已提交
3349
#if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH)
D
Dr. Stephen Henson 已提交
3350
    EVP_PKEY_free(s->s3->tmp.pkey);
3351
    EVP_PKEY_free(s->s3->peer_tmp);
E
Emilia Kasper 已提交
3352
#endif                          /* !OPENSSL_NO_EC */
3353

3354
    ssl3_free_digest_list(s);
3355

T
Todd Short 已提交
3356 3357
    OPENSSL_free(s->s3->alpn_selected);
    OPENSSL_free(s->s3->alpn_proposed);
3358

T
Todd Short 已提交
3359
    /* NULL/zero-out everything in the s3 struct */
R
Rich Salz 已提交
3360
    memset(s->s3, 0, sizeof(*s->s3));
3361

3362 3363
    if (!ssl_free_wbio_buffer(s))
        return 0;
3364 3365

    s->version = SSL3_VERSION;
B
Ben Laurie 已提交
3366

3367
#if !defined(OPENSSL_NO_NEXTPROTONEG)
R
Rich Salz 已提交
3368 3369 3370
    OPENSSL_free(s->ext.npn);
    s->ext.npn = NULL;
    s->ext.npn_len = 0;
B
Ben Laurie 已提交
3371
#endif
3372 3373

    return 1;
3374
}
3375

B
Ben Laurie 已提交
3376
#ifndef OPENSSL_NO_SRP
3377 3378
static char *srp_password_from_info_cb(SSL *s, void *arg)
{
R
Rich Salz 已提交
3379
    return OPENSSL_strdup(s->srp_ctx.info);
3380
}
B
Ben Laurie 已提交
3381 3382
#endif

E
Emilia Kasper 已提交
3383
static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p, size_t len);
3384

3385
long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
3386 3387
{
    int ret = 0;
3388

3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404
    switch (cmd) {
    case SSL_CTRL_GET_CLIENT_CERT_REQUEST:
        break;
    case SSL_CTRL_GET_NUM_RENEGOTIATIONS:
        ret = s->s3->num_renegotiations;
        break;
    case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS:
        ret = s->s3->num_renegotiations;
        s->s3->num_renegotiations = 0;
        break;
    case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS:
        ret = s->s3->total_renegotiations;
        break;
    case SSL_CTRL_GET_FLAGS:
        ret = (int)(s->s3->flags);
        break;
3405
#ifndef OPENSSL_NO_DH
3406 3407 3408
    case SSL_CTRL_SET_TMP_DH:
        {
            DH *dh = (DH *)parg;
3409
            EVP_PKEY *pkdh = NULL;
3410 3411
            if (dh == NULL) {
                SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
K
KaoruToda 已提交
3412
                return ret;
3413
            }
3414 3415 3416 3417 3418
            pkdh = ssl_dh_to_pkey(dh);
            if (pkdh == NULL) {
                SSLerr(SSL_F_SSL3_CTRL, ERR_R_MALLOC_FAILURE);
                return 0;
            }
3419
            if (!ssl_security(s, SSL_SECOP_TMP_DH,
3420
                              EVP_PKEY_security_bits(pkdh), 0, pkdh)) {
3421
                SSLerr(SSL_F_SSL3_CTRL, SSL_R_DH_KEY_TOO_SMALL);
3422 3423
                EVP_PKEY_free(pkdh);
                return ret;
3424
            }
3425 3426
            EVP_PKEY_free(s->cert->dh_tmp);
            s->cert->dh_tmp = pkdh;
3427 3428 3429 3430 3431 3432
            ret = 1;
        }
        break;
    case SSL_CTRL_SET_TMP_DH_CB:
        {
            SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
K
KaoruToda 已提交
3433
            return ret;
3434 3435 3436 3437
        }
    case SSL_CTRL_SET_DH_AUTO:
        s->cert->dh_tmp_auto = larg;
        return 1;
3438
#endif
3439
#ifndef OPENSSL_NO_EC
3440 3441
    case SSL_CTRL_SET_TMP_ECDH:
        {
3442 3443
            const EC_GROUP *group = NULL;
            int nid;
3444 3445 3446

            if (parg == NULL) {
                SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3447
                return 0;
3448
            }
3449 3450 3451 3452
            group = EC_KEY_get0_group((const EC_KEY *)parg);
            if (group == NULL) {
                SSLerr(SSL_F_SSL3_CTRL, EC_R_MISSING_PARAMETERS);
                return 0;
3453
            }
3454 3455 3456
            nid = EC_GROUP_get_curve_name(group);
            if (nid == NID_undef)
                return 0;
R
Rich Salz 已提交
3457 3458
            return tls1_set_groups(&s->ext.supportedgroups,
                                   &s->ext.supportedgroups_len,
3459
                                   &nid, 1);
3460 3461
        }
        break;
3462
#endif                          /* !OPENSSL_NO_EC */
3463 3464
    case SSL_CTRL_SET_TLSEXT_HOSTNAME:
        if (larg == TLSEXT_NAMETYPE_host_name) {
V
Viktor Dukhovni 已提交
3465 3466
            size_t len;

R
Rich Salz 已提交
3467 3468
            OPENSSL_free(s->ext.hostname);
            s->ext.hostname = NULL;
3469 3470 3471 3472

            ret = 1;
            if (parg == NULL)
                break;
V
Viktor Dukhovni 已提交
3473 3474
            len = strlen((char *)parg);
            if (len == 0 || len > TLSEXT_MAXLEN_host_name) {
3475 3476 3477
                SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME);
                return 0;
            }
R
Rich Salz 已提交
3478
            if ((s->ext.hostname = OPENSSL_strdup((char *)parg)) == NULL) {
3479 3480 3481 3482 3483 3484 3485 3486 3487
                SSLerr(SSL_F_SSL3_CTRL, ERR_R_INTERNAL_ERROR);
                return 0;
            }
        } else {
            SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE);
            return 0;
        }
        break;
    case SSL_CTRL_SET_TLSEXT_DEBUG_ARG:
R
Rich Salz 已提交
3488
        s->ext.debug_arg = parg;
3489 3490 3491
        ret = 1;
        break;

3492
    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
R
Rich Salz 已提交
3493
        ret = s->ext.status_type;
3494 3495
        break;

3496
    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
R
Rich Salz 已提交
3497
        s->ext.status_type = larg;
3498 3499 3500 3501
        ret = 1;
        break;

    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS:
R
Rich Salz 已提交
3502
        *(STACK_OF(X509_EXTENSION) **)parg = s->ext.ocsp.exts;
3503 3504 3505 3506
        ret = 1;
        break;

    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS:
R
Rich Salz 已提交
3507
        s->ext.ocsp.exts = parg;
3508 3509 3510 3511
        ret = 1;
        break;

    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS:
R
Rich Salz 已提交
3512
        *(STACK_OF(OCSP_RESPID) **)parg = s->ext.ocsp.ids;
3513 3514 3515 3516
        ret = 1;
        break;

    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS:
R
Rich Salz 已提交
3517
        s->ext.ocsp.ids = parg;
3518 3519 3520 3521
        ret = 1;
        break;

    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP:
R
Rich Salz 已提交
3522 3523 3524
        *(unsigned char **)parg = s->ext.ocsp.resp;
        if (s->ext.ocsp.resp_len == 0
                || s->ext.ocsp.resp_len > LONG_MAX)
M
Matt Caswell 已提交
3525
            return -1;
R
Rich Salz 已提交
3526
        return (long)s->ext.ocsp.resp_len;
3527 3528

    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
R
Rich Salz 已提交
3529 3530 3531
        OPENSSL_free(s->ext.ocsp.resp);
        s->ext.ocsp.resp = parg;
        s->ext.ocsp.resp_len = larg;
3532 3533 3534
        ret = 1;
        break;

3535 3536 3537 3538 3539 3540 3541
#ifndef OPENSSL_NO_HEARTBEATS
    case SSL_CTRL_DTLS_EXT_SEND_HEARTBEAT:
    case SSL_CTRL_GET_DTLS_EXT_HEARTBEAT_PENDING:
    case SSL_CTRL_SET_DTLS_EXT_HEARTBEAT_NO_REQUESTS:
        break;
#endif

3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566
    case SSL_CTRL_CHAIN:
        if (larg)
            return ssl_cert_set1_chain(s, NULL, (STACK_OF(X509) *)parg);
        else
            return ssl_cert_set0_chain(s, NULL, (STACK_OF(X509) *)parg);

    case SSL_CTRL_CHAIN_CERT:
        if (larg)
            return ssl_cert_add1_chain_cert(s, NULL, (X509 *)parg);
        else
            return ssl_cert_add0_chain_cert(s, NULL, (X509 *)parg);

    case SSL_CTRL_GET_CHAIN_CERTS:
        *(STACK_OF(X509) **)parg = s->cert->key->chain;
        break;

    case SSL_CTRL_SELECT_CURRENT_CERT:
        return ssl_cert_select_current(s->cert, (X509 *)parg);

    case SSL_CTRL_SET_CURRENT_CERT:
        if (larg == SSL_CERT_SET_SERVER) {
            const SSL_CIPHER *cipher;
            if (!s->server)
                return 0;
            cipher = s->s3->tmp.new_cipher;
D
Dr. Stephen Henson 已提交
3567
            if (cipher == NULL)
3568 3569 3570 3571 3572 3573 3574
                return 0;
            /*
             * No certificate for unauthenticated ciphersuites or using SRP
             * authentication
             */
            if (cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP))
                return 2;
3575
            if (s->s3->tmp.cert == NULL)
3576
                return 0;
3577
            s->cert->key = s->s3->tmp.cert;
3578 3579 3580
            return 1;
        }
        return ssl_cert_set_current(s->cert, larg);
3581

3582
#ifndef OPENSSL_NO_EC
3583
    case SSL_CTRL_GET_GROUPS:
3584
        {
D
Dr. Stephen Henson 已提交
3585
            uint16_t *clist;
3586
            size_t clistlen;
R
Rich Salz 已提交
3587

3588 3589
            if (!s->session)
                return 0;
R
Rich Salz 已提交
3590
            clist = s->session->ext.supportedgroups;
D
Dr. Stephen Henson 已提交
3591
            clistlen = s->session->ext.supportedgroups_len;
3592 3593 3594
            if (parg) {
                size_t i;
                int *cptr = parg;
3595

3596
                for (i = 0; i < clistlen; i++) {
3597 3598 3599 3600
                    const TLS_GROUP_INFO *cinf = tls1_group_id_lookup(clist[i]);

                    if (cinf != NULL)
                        cptr[i] = cinf->nid;
3601
                    else
D
Dr. Stephen Henson 已提交
3602
                        cptr[i] = TLSEXT_nid_unknown | clist[i];
3603 3604 3605 3606 3607
                }
            }
            return (int)clistlen;
        }

3608
    case SSL_CTRL_SET_GROUPS:
R
Rich Salz 已提交
3609 3610
        return tls1_set_groups(&s->ext.supportedgroups,
                               &s->ext.supportedgroups_len, parg, larg);
3611

3612
    case SSL_CTRL_SET_GROUPS_LIST:
R
Rich Salz 已提交
3613 3614
        return tls1_set_groups_list(&s->ext.supportedgroups,
                                    &s->ext.supportedgroups_len, parg);
3615

3616
    case SSL_CTRL_GET_SHARED_GROUP:
3617 3618
        {
            uint16_t id = tls1_shared_group(s, larg);
3619

3620 3621 3622 3623 3624 3625 3626
            if (larg != -1) {
                const TLS_GROUP_INFO *ginf = tls1_group_id_lookup(id);

                return ginf == NULL ? 0 : ginf->nid;
            }
            return id;
        }
3627
#endif
3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645
    case SSL_CTRL_SET_SIGALGS:
        return tls1_set_sigalgs(s->cert, parg, larg, 0);

    case SSL_CTRL_SET_SIGALGS_LIST:
        return tls1_set_sigalgs_list(s->cert, parg, 0);

    case SSL_CTRL_SET_CLIENT_SIGALGS:
        return tls1_set_sigalgs(s->cert, parg, larg, 1);

    case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
        return tls1_set_sigalgs_list(s->cert, parg, 1);

    case SSL_CTRL_GET_CLIENT_CERT_TYPES:
        {
            const unsigned char **pctype = parg;
            if (s->server || !s->s3->tmp.cert_req)
                return 0;
            if (pctype)
3646 3647
                *pctype = s->s3->tmp.ctype;
            return s->s3->tmp.ctype_len;
3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664
        }

    case SSL_CTRL_SET_CLIENT_CERT_TYPES:
        if (!s->server)
            return 0;
        return ssl3_set_req_cert_type(s->cert, parg, larg);

    case SSL_CTRL_BUILD_CERT_CHAIN:
        return ssl_build_cert_chain(s, NULL, larg);

    case SSL_CTRL_SET_VERIFY_CERT_STORE:
        return ssl_cert_set_cert_store(s->cert, parg, 0, larg);

    case SSL_CTRL_SET_CHAIN_CERT_STORE:
        return ssl_cert_set_cert_store(s->cert, parg, 1, larg);

    case SSL_CTRL_GET_PEER_SIGNATURE_NID:
3665
        if (s->s3->tmp.peer_sigalg == NULL)
3666
            return 0;
3667 3668
        *(int *)parg = s->s3->tmp.peer_sigalg->hash;
        return 1;
3669 3670

    case SSL_CTRL_GET_SERVER_TMP_KEY:
D
Dr. Stephen Henson 已提交
3671 3672
#if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC)
        if (s->server || s->session == NULL || s->s3->peer_tmp == NULL) {
3673
            return 0;
D
Dr. Stephen Henson 已提交
3674 3675 3676 3677
        } else {
            EVP_PKEY_up_ref(s->s3->peer_tmp);
            *(EVP_PKEY **)parg = s->s3->peer_tmp;
            return 1;
3678
        }
D
Dr. Stephen Henson 已提交
3679 3680 3681
#else
        return 0;
#endif
3682
#ifndef OPENSSL_NO_EC
3683 3684 3685 3686
    case SSL_CTRL_GET_EC_POINT_FORMATS:
        {
            SSL_SESSION *sess = s->session;
            const unsigned char **pformat = parg;
R
Rich Salz 已提交
3687 3688

            if (sess == NULL || sess->ext.ecpointformats == NULL)
3689
                return 0;
R
Rich Salz 已提交
3690 3691
            *pformat = sess->ext.ecpointformats;
            return (int)sess->ext.ecpointformats_len;
3692
        }
3693
#endif
B
Bodo Moeller 已提交
3694

3695 3696 3697
    default:
        break;
    }
K
KaoruToda 已提交
3698
    return ret;
3699 3700 3701 3702 3703
}

long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp) (void))
{
    int ret = 0;
3704

3705
    switch (cmd) {
3706
#ifndef OPENSSL_NO_DH
3707 3708 3709 3710 3711
    case SSL_CTRL_SET_TMP_DH_CB:
        {
            s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
        }
        break;
3712
#endif
3713
    case SSL_CTRL_SET_TLSEXT_DEBUG_CB:
R
Rich Salz 已提交
3714
        s->ext.debug_cb = (void (*)(SSL *, int, int,
R
Rich Salz 已提交
3715
                                    const unsigned char *, int, void *))fp;
3716
        break;
3717

3718 3719 3720 3721 3722 3723 3724 3725
    case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
        {
            s->not_resumable_session_cb = (int (*)(SSL *, int))fp;
        }
        break;
    default:
        break;
    }
K
KaoruToda 已提交
3726
    return ret;
3727
}
3728

3729
long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
3730 3731
{
    switch (cmd) {
3732
#ifndef OPENSSL_NO_DH
3733 3734
    case SSL_CTRL_SET_TMP_DH:
        {
3735 3736 3737 3738
            DH *dh = (DH *)parg;
            EVP_PKEY *pkdh = NULL;
            if (dh == NULL) {
                SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3739 3740
                return 0;
            }
3741 3742 3743
            pkdh = ssl_dh_to_pkey(dh);
            if (pkdh == NULL) {
                SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_MALLOC_FAILURE);
3744 3745
                return 0;
            }
3746 3747 3748 3749 3750
            if (!ssl_ctx_security(ctx, SSL_SECOP_TMP_DH,
                                  EVP_PKEY_security_bits(pkdh), 0, pkdh)) {
                SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_DH_KEY_TOO_SMALL);
                EVP_PKEY_free(pkdh);
                return 1;
3751
            }
3752 3753
            EVP_PKEY_free(ctx->cert->dh_tmp);
            ctx->cert->dh_tmp = pkdh;
3754 3755 3756 3757 3758
            return 1;
        }
    case SSL_CTRL_SET_TMP_DH_CB:
        {
            SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
K
KaoruToda 已提交
3759
            return 0;
3760 3761 3762 3763
        }
    case SSL_CTRL_SET_DH_AUTO:
        ctx->cert->dh_tmp_auto = larg;
        return 1;
3764
#endif
3765
#ifndef OPENSSL_NO_EC
3766 3767
    case SSL_CTRL_SET_TMP_ECDH:
        {
3768 3769
            const EC_GROUP *group = NULL;
            int nid;
3770 3771

            if (parg == NULL) {
3772
                SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3773 3774
                return 0;
            }
3775 3776 3777
            group = EC_KEY_get0_group((const EC_KEY *)parg);
            if (group == NULL) {
                SSLerr(SSL_F_SSL3_CTX_CTRL, EC_R_MISSING_PARAMETERS);
3778 3779
                return 0;
            }
3780 3781 3782
            nid = EC_GROUP_get_curve_name(group);
            if (nid == NID_undef)
                return 0;
R
Rich Salz 已提交
3783 3784
            return tls1_set_groups(&ctx->ext.supportedgroups,
                                   &ctx->ext.supportedgroups_len,
3785
                                   &nid, 1);
3786
        }
3787
#endif                          /* !OPENSSL_NO_EC */
3788
    case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG:
R
Rich Salz 已提交
3789
        ctx->ext.servername_arg = parg;
3790 3791 3792 3793 3794
        break;
    case SSL_CTRL_SET_TLSEXT_TICKET_KEYS:
    case SSL_CTRL_GET_TLSEXT_TICKET_KEYS:
        {
            unsigned char *keys = parg;
R
Rich Salz 已提交
3795 3796 3797
            long tick_keylen = (sizeof(ctx->ext.tick_key_name) +
                                sizeof(ctx->ext.tick_hmac_key) +
                                sizeof(ctx->ext.tick_aes_key));
K
Kurt Roeckx 已提交
3798
            if (keys == NULL)
R
Rich Salz 已提交
3799 3800
                return tick_keylen;
            if (larg != tick_keylen) {
3801 3802 3803 3804
                SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_TICKET_KEYS_LENGTH);
                return 0;
            }
            if (cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEYS) {
R
Rich Salz 已提交
3805 3806 3807 3808 3809 3810 3811 3812 3813
                memcpy(ctx->ext.tick_key_name, keys,
                       sizeof(ctx->ext.tick_key_name));
                memcpy(ctx->ext.tick_hmac_key,
                       keys + sizeof(ctx->ext.tick_key_name),
                       sizeof(ctx->ext.tick_hmac_key));
                memcpy(ctx->ext.tick_aes_key,
                       keys + sizeof(ctx->ext.tick_key_name) +
                       sizeof(ctx->ext.tick_hmac_key),
                       sizeof(ctx->ext.tick_aes_key));
3814
            } else {
R
Rich Salz 已提交
3815 3816 3817 3818 3819 3820 3821 3822 3823
                memcpy(keys, ctx->ext.tick_key_name,
                       sizeof(ctx->ext.tick_key_name));
                memcpy(keys + sizeof(ctx->ext.tick_key_name),
                       ctx->ext.tick_hmac_key,
                       sizeof(ctx->ext.tick_hmac_key));
                memcpy(keys + sizeof(ctx->ext.tick_key_name) +
                       sizeof(ctx->ext.tick_hmac_key),
                       ctx->ext.tick_aes_key,
                       sizeof(ctx->ext.tick_aes_key));
3824 3825 3826 3827
            }
            return 1;
        }

3828
    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
R
Rich Salz 已提交
3829
        return ctx->ext.status_type;
3830

3831
    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
R
Rich Salz 已提交
3832
        ctx->ext.status_type = larg;
3833 3834
        break;

3835
    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
R
Rich Salz 已提交
3836
        ctx->ext.status_arg = parg;
3837 3838
        return 1;

3839
    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG:
R
Rich Salz 已提交
3840
        *(void**)parg = ctx->ext.status_arg;
3841 3842 3843
        break;

    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB:
R
Rich Salz 已提交
3844
        *(int (**)(SSL*, void*))parg = ctx->ext.status_cb;
3845 3846
        break;

3847
#ifndef OPENSSL_NO_SRP
3848 3849
    case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
        ctx->srp_ctx.srp_Mask |= SSL_kSRP;
R
Rich Salz 已提交
3850
        OPENSSL_free(ctx->srp_ctx.login);
3851 3852 3853
        ctx->srp_ctx.login = NULL;
        if (parg == NULL)
            break;
E
Emilia Kasper 已提交
3854
        if (strlen((const char *)parg) > 255 || strlen((const char *)parg) < 1) {
3855 3856 3857
            SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_SRP_USERNAME);
            return 0;
        }
R
Rich Salz 已提交
3858
        if ((ctx->srp_ctx.login = OPENSSL_strdup((char *)parg)) == NULL) {
3859 3860 3861 3862 3863 3864 3865
            SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_INTERNAL_ERROR);
            return 0;
        }
        break;
    case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD:
        ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
            srp_password_from_info_cb;
3866 3867 3868 3869 3870 3871
        if (ctx->srp_ctx.info != NULL)
            OPENSSL_free(ctx->srp_ctx.info);
        if ((ctx->srp_ctx.info = BUF_strdup((char *)parg)) == NULL) {
            SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_INTERNAL_ERROR);
            return 0;
        }
3872 3873 3874 3875 3876 3877 3878 3879 3880
        break;
    case SSL_CTRL_SET_SRP_ARG:
        ctx->srp_ctx.srp_Mask |= SSL_kSRP;
        ctx->srp_ctx.SRP_cb_arg = parg;
        break;

    case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH:
        ctx->srp_ctx.strength = larg;
        break;
3881
#endif
3882

3883
#ifndef OPENSSL_NO_EC
3884
    case SSL_CTRL_SET_GROUPS:
R
Rich Salz 已提交
3885 3886
        return tls1_set_groups(&ctx->ext.supportedgroups,
                               &ctx->ext.supportedgroups_len,
3887 3888
                               parg, larg);

3889
    case SSL_CTRL_SET_GROUPS_LIST:
R
Rich Salz 已提交
3890 3891
        return tls1_set_groups_list(&ctx->ext.supportedgroups,
                                    &ctx->ext.supportedgroups_len,
3892
                                    parg);
3893
#endif
3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920
    case SSL_CTRL_SET_SIGALGS:
        return tls1_set_sigalgs(ctx->cert, parg, larg, 0);

    case SSL_CTRL_SET_SIGALGS_LIST:
        return tls1_set_sigalgs_list(ctx->cert, parg, 0);

    case SSL_CTRL_SET_CLIENT_SIGALGS:
        return tls1_set_sigalgs(ctx->cert, parg, larg, 1);

    case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
        return tls1_set_sigalgs_list(ctx->cert, parg, 1);

    case SSL_CTRL_SET_CLIENT_CERT_TYPES:
        return ssl3_set_req_cert_type(ctx->cert, parg, larg);

    case SSL_CTRL_BUILD_CERT_CHAIN:
        return ssl_build_cert_chain(NULL, ctx, larg);

    case SSL_CTRL_SET_VERIFY_CERT_STORE:
        return ssl_cert_set_cert_store(ctx->cert, parg, 0, larg);

    case SSL_CTRL_SET_CHAIN_CERT_STORE:
        return ssl_cert_set_cert_store(ctx->cert, parg, 1, larg);

        /* A Thawte special :-) */
    case SSL_CTRL_EXTRA_CHAIN_CERT:
        if (ctx->extra_certs == NULL) {
3921 3922 3923 3924 3925 3926 3927 3928
            if ((ctx->extra_certs = sk_X509_new_null()) == NULL) {
                SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_MALLOC_FAILURE);
                return 0;
            }
        }
        if (!sk_X509_push(ctx->extra_certs, (X509 *)parg)) {
            SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_MALLOC_FAILURE);
            return 0;
3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939
        }
        break;

    case SSL_CTRL_GET_EXTRA_CHAIN_CERTS:
        if (ctx->extra_certs == NULL && larg == 0)
            *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
        else
            *(STACK_OF(X509) **)parg = ctx->extra_certs;
        break;

    case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS:
R
Rich Salz 已提交
3940 3941
        sk_X509_pop_free(ctx->extra_certs, X509_free);
        ctx->extra_certs = NULL;
3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966
        break;

    case SSL_CTRL_CHAIN:
        if (larg)
            return ssl_cert_set1_chain(NULL, ctx, (STACK_OF(X509) *)parg);
        else
            return ssl_cert_set0_chain(NULL, ctx, (STACK_OF(X509) *)parg);

    case SSL_CTRL_CHAIN_CERT:
        if (larg)
            return ssl_cert_add1_chain_cert(NULL, ctx, (X509 *)parg);
        else
            return ssl_cert_add0_chain_cert(NULL, ctx, (X509 *)parg);

    case SSL_CTRL_GET_CHAIN_CERTS:
        *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
        break;

    case SSL_CTRL_SELECT_CURRENT_CERT:
        return ssl_cert_select_current(ctx->cert, (X509 *)parg);

    case SSL_CTRL_SET_CURRENT_CERT:
        return ssl_cert_set_current(ctx->cert, larg);

    default:
K
KaoruToda 已提交
3967
        return 0;
3968
    }
3969
    return 1;
3970 3971 3972 3973 3974
}

long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp) (void))
{
    switch (cmd) {
3975
#ifndef OPENSSL_NO_DH
3976 3977
    case SSL_CTRL_SET_TMP_DH_CB:
        {
M
Matt Caswell 已提交
3978
            ctx->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
3979 3980
        }
        break;
3981
#endif
3982
    case SSL_CTRL_SET_TLSEXT_SERVERNAME_CB:
R
Rich Salz 已提交
3983
        ctx->ext.servername_cb = (int (*)(SSL *, int *, void *))fp;
3984 3985 3986
        break;

    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB:
R
Rich Salz 已提交
3987
        ctx->ext.status_cb = (int (*)(SSL *, void *))fp;
3988 3989 3990
        break;

    case SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB:
R
Rich Salz 已提交
3991
        ctx->ext.ticket_key_cb = (int (*)(SSL *, unsigned char *,
3992 3993 3994 3995 3996
                                             unsigned char *,
                                             EVP_CIPHER_CTX *,
                                             HMAC_CTX *, int))fp;
        break;

3997
#ifndef OPENSSL_NO_SRP
3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011
    case SSL_CTRL_SET_SRP_VERIFY_PARAM_CB:
        ctx->srp_ctx.srp_Mask |= SSL_kSRP;
        ctx->srp_ctx.SRP_verify_param_callback = (int (*)(SSL *, void *))fp;
        break;
    case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB:
        ctx->srp_ctx.srp_Mask |= SSL_kSRP;
        ctx->srp_ctx.TLS_ext_srp_username_callback =
            (int (*)(SSL *, int *, void *))fp;
        break;
    case SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB:
        ctx->srp_ctx.srp_Mask |= SSL_kSRP;
        ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
            (char *(*)(SSL *, void *))fp;
        break;
4012
#endif
4013 4014 4015 4016 4017 4018
    case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
        {
            ctx->not_resumable_session_cb = (int (*)(SSL *, int))fp;
        }
        break;
    default:
K
KaoruToda 已提交
4019
        return 0;
4020
    }
4021
    return 1;
4022
}
4023

4024 4025 4026
const SSL_CIPHER *ssl3_get_cipher_by_id(uint32_t id)
{
    SSL_CIPHER c;
4027
    const SSL_CIPHER *cp;
4028 4029

    c.id = id;
4030 4031 4032 4033
    cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS);
    if (cp != NULL)
        return cp;
    return OBJ_bsearch_ssl_cipher_id(&c, ssl3_scsvs, SSL3_NUM_SCSVS);
4034 4035
}

4036 4037 4038 4039 4040 4041
const SSL_CIPHER *ssl3_get_cipher_by_std_name(const char *stdname)
{
    SSL_CIPHER *c = NULL;
    SSL_CIPHER *tbl = ssl3_ciphers;
    size_t i;

4042
    /* this is not efficient, necessary to optimize this? */
4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062
    for (i = 0; i < SSL3_NUM_CIPHERS; i++, tbl++) {
        if (tbl->stdname == NULL)
            continue;
        if (strcmp(stdname, tbl->stdname) == 0) {
            c = tbl;
            break;
        }
    }
    if (c == NULL) {
        tbl = ssl3_scsvs;
        for (i = 0; i < SSL3_NUM_SCSVS; i++, tbl++) {
            if (strcmp(stdname, tbl->stdname) == 0) {
                c = tbl;
                break;
            }
        }
    }
    return c;
}

4063 4064 4065 4066
/*
 * This function needs to check if the ciphers required are actually
 * available
 */
4067
const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p)
4068
{
4069
    return ssl3_get_cipher_by_id(SSL3_CK_CIPHERSUITE_FLAG
4070 4071
                                 | ((uint32_t)p[0] << 8L)
                                 | (uint32_t)p[1]);
4072
}
4073

M
Matt Caswell 已提交
4074
int ssl3_put_cipher_by_char(const SSL_CIPHER *c, WPACKET *pkt, size_t *len)
4075
{
4076
    if ((c->id & 0xff000000) != SSL3_CK_CIPHERSUITE_FLAG) {
4077 4078 4079 4080
        *len = 0;
        return 1;
    }

4081
    if (!WPACKET_put_bytes_u16(pkt, c->id & 0xffff))
4082 4083 4084 4085 4086 4087
        return 0;

    *len = 2;
    return 1;
}

4088 4089 4090 4091 4092 4093 4094 4095
/*
 * ssl3_choose_cipher - choose a cipher from those offered by the client
 * @s: SSL connection
 * @clnt: ciphers offered by the client
 * @srvr: ciphers enabled on the server?
 *
 * Returns the selected cipher or NULL when no common ciphers.
 */
4096
const SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
E
Emilia Kasper 已提交
4097
                                     STACK_OF(SSL_CIPHER) *srvr)
4098
{
4099
    const SSL_CIPHER *c, *ret = NULL;
4100 4101
    STACK_OF(SSL_CIPHER) *prio, *allow;
    int i, ii, ok;
4102
    unsigned long alg_k = 0, alg_a = 0, mask_k = 0, mask_a = 0;
4103 4104 4105
#ifndef OPENSSL_NO_CHACHA
    STACK_OF(SSL_CIPHER) *prio_chacha = NULL;
#endif
4106

4107
    /* Let's see which ciphers we can support */
4108

4109 4110 4111 4112 4113 4114
    /*
     * Do not set the compare functions, because this may lead to a
     * reordering by "id". We want to keep the original ordering. We may pay
     * a price in performance during sk_SSL_CIPHER_find(), but would have to
     * pay with the price of sk_SSL_CIPHER_dup().
     */
4115

B
Ben Laurie 已提交
4116
#ifdef CIPHER_DEBUG
4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128
    fprintf(stderr, "Server has %d from %p:\n", sk_SSL_CIPHER_num(srvr),
            (void *)srvr);
    for (i = 0; i < sk_SSL_CIPHER_num(srvr); ++i) {
        c = sk_SSL_CIPHER_value(srvr, i);
        fprintf(stderr, "%p:%s\n", (void *)c, c->name);
    }
    fprintf(stderr, "Client sent %d from %p:\n", sk_SSL_CIPHER_num(clnt),
            (void *)clnt);
    for (i = 0; i < sk_SSL_CIPHER_num(clnt); ++i) {
        c = sk_SSL_CIPHER_value(clnt, i);
        fprintf(stderr, "%p:%s\n", (void *)c, c->name);
    }
B
Ben Laurie 已提交
4129 4130
#endif

4131 4132 4133 4134 4135
    /* SUITE-B takes precedence over server preference and ChaCha priortiy */
    if (tls1_suiteb(s)) {
        prio = srvr;
        allow = clnt;
    } else if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE) {
4136 4137
        prio = srvr;
        allow = clnt;
4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155
#ifndef OPENSSL_NO_CHACHA
        /* If ChaCha20 is at the top of the client preference list,
           and there are ChaCha20 ciphers in the server list, then
           temporarily prioritize all ChaCha20 ciphers in the servers list. */
        if (s->options & SSL_OP_PRIORITIZE_CHACHA && sk_SSL_CIPHER_num(clnt) > 0) {
            c = sk_SSL_CIPHER_value(clnt, 0);
            if (c->algorithm_enc == SSL_CHACHA20POLY1305) {
                /* ChaCha20 is client preferred, check server... */
                int num = sk_SSL_CIPHER_num(srvr);
                int found = 0;
                for (i = 0; i < num; i++) {
                    c = sk_SSL_CIPHER_value(srvr, i);
                    if (c->algorithm_enc == SSL_CHACHA20POLY1305) {
                        found = 1;
                        break;
                    }
                }
                if (found) {
T
Todd Short 已提交
4156
                    prio_chacha = sk_SSL_CIPHER_new_reserve(NULL, num);
4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177
                    /* if reserve fails, then there's likely a memory issue */
                    if (prio_chacha != NULL) {
                        /* Put all ChaCha20 at the top, starting with the one we just found */
                        sk_SSL_CIPHER_push(prio_chacha, c);
                        for (i++; i < num; i++) {
                            c = sk_SSL_CIPHER_value(srvr, i);
                            if (c->algorithm_enc == SSL_CHACHA20POLY1305)
                                sk_SSL_CIPHER_push(prio_chacha, c);
                        }
                        /* Pull in the rest */
                        for (i = 0; i < num; i++) {
                            c = sk_SSL_CIPHER_value(srvr, i);
                            if (c->algorithm_enc != SSL_CHACHA20POLY1305)
                                sk_SSL_CIPHER_push(prio_chacha, c);
                        }
                        prio = prio_chacha;
                    }
                }
            }
        }
# endif
4178 4179 4180 4181 4182
    } else {
        prio = clnt;
        allow = srvr;
    }

4183 4184 4185 4186
    if (!SSL_IS_TLS13(s)) {
        tls1_set_cert_validity(s);
        ssl_set_masks(s);
    }
4187 4188 4189 4190

    for (i = 0; i < sk_SSL_CIPHER_num(prio); i++) {
        c = sk_SSL_CIPHER_value(prio, i);

4191 4192
        /* Skip ciphers not supported by the protocol version */
        if (!SSL_IS_DTLS(s) &&
E
Emilia Kasper 已提交
4193
            ((s->version < c->min_tls) || (s->version > c->max_tls)))
4194
            continue;
4195
        if (SSL_IS_DTLS(s) &&
E
Emilia Kasper 已提交
4196 4197
            (DTLS_VERSION_LT(s->version, c->min_dtls) ||
             DTLS_VERSION_GT(s->version, c->max_dtls)))
4198
            continue;
4199

4200 4201 4202 4203 4204
        /*
         * Since TLS 1.3 ciphersuites can be used with any auth or
         * key exchange scheme skip tests.
         */
        if (!SSL_IS_TLS13(s)) {
4205 4206
            mask_k = s->s3->tmp.mask_k;
            mask_a = s->s3->tmp.mask_a;
B
Ben Laurie 已提交
4207
#ifndef OPENSSL_NO_SRP
4208 4209 4210 4211
            if (s->srp_ctx.srp_Mask & SSL_kSRP) {
                mask_k |= SSL_kSRP;
                mask_a |= SSL_aSRP;
            }
B
Ben Laurie 已提交
4212
#endif
4213

4214 4215
            alg_k = c->algorithm_mkey;
            alg_a = c->algorithm_auth;
4216

4217
#ifndef OPENSSL_NO_PSK
4218 4219 4220
            /* with PSK there must be server callback set */
            if ((alg_k & SSL_PSK) && s->psk_server_callback == NULL)
                continue;
4221 4222
#endif                          /* OPENSSL_NO_PSK */

4223
            ok = (alg_k & mask_k) && (alg_a & mask_a);
4224
#ifdef CIPHER_DEBUG
4225 4226
            fprintf(stderr, "%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n", ok, alg_k,
                    alg_a, mask_k, mask_a, (void *)c, c->name);
4227 4228
#endif

E
Emilia Kasper 已提交
4229
#ifndef OPENSSL_NO_EC
4230 4231 4232 4233 4234 4235
            /*
             * if we are considering an ECC cipher suite that uses an ephemeral
             * EC key check it
             */
            if (alg_k & SSL_kECDHE)
                ok = ok && tls1_check_ec_tmp_key(s, c->id);
E
Emilia Kasper 已提交
4236
#endif                          /* OPENSSL_NO_EC */
4237

4238 4239 4240
            if (!ok)
                continue;
        }
4241 4242 4243 4244
        ii = sk_SSL_CIPHER_find(allow, c);
        if (ii >= 0) {
            /* Check security callback permits this cipher */
            if (!ssl_security(s, SSL_SECOP_CIPHER_SHARED,
4245
                              c->strength_bits, 0, (void *)c))
4246
                continue;
4247
#if !defined(OPENSSL_NO_EC)
4248 4249 4250 4251 4252 4253
            if ((alg_k & SSL_kECDHE) && (alg_a & SSL_aECDSA)
                && s->s3->is_probably_safari) {
                if (!ret)
                    ret = sk_SSL_CIPHER_value(allow, ii);
                continue;
            }
4254
#endif
4255 4256 4257 4258
            ret = sk_SSL_CIPHER_value(allow, ii);
            break;
        }
    }
4259 4260 4261
#ifndef OPENSSL_NO_CHACHA
    sk_SSL_CIPHER_free(prio_chacha);
#endif
K
KaoruToda 已提交
4262
    return ret;
4263
}
4264

4265
int ssl3_get_req_cert_type(SSL *s, WPACKET *pkt)
4266
{
4267
    uint32_t alg_k, alg_a = 0;
4268 4269

    /* If we have custom certificate types set, use them */
4270 4271
    if (s->cert->ctype)
        return WPACKET_memcpy(pkt, s->cert->ctype, s->cert->ctype_len);
4272 4273 4274 4275
    /* Get mask of algorithms disabled by signature list */
    ssl_set_sig_mask(&alg_a, s, SSL_SECOP_SIGALG_MASK);

    alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
4276

D
Dr. Stephen Henson 已提交
4277
#ifndef OPENSSL_NO_GOST
4278 4279 4280 4281
    if (s->version >= TLS1_VERSION && (alg_k & SSL_kGOST))
            return WPACKET_put_bytes_u8(pkt, TLS_CT_GOST01_SIGN)
                    && WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_SIGN)
                    && WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_512_SIGN);
D
Dr. Stephen Henson 已提交
4282 4283
#endif

D
Dr. Stephen Henson 已提交
4284
    if ((s->version == SSL3_VERSION) && (alg_k & SSL_kDHE)) {
4285
#ifndef OPENSSL_NO_DH
4286
# ifndef OPENSSL_NO_RSA
4287 4288
        if (!WPACKET_put_bytes_u8(pkt, SSL3_CT_RSA_EPHEMERAL_DH))
            return 0;
4289 4290
# endif
# ifndef OPENSSL_NO_DSA
4291 4292
        if (!WPACKET_put_bytes_u8(pkt, SSL3_CT_DSS_EPHEMERAL_DH))
            return 0;
4293 4294
# endif
#endif                          /* !OPENSSL_NO_DH */
B
Ben Laurie 已提交
4295
    }
4296
#ifndef OPENSSL_NO_RSA
4297 4298
    if (!(alg_a & SSL_aRSA) && !WPACKET_put_bytes_u8(pkt, SSL3_CT_RSA_SIGN))
        return 0;
4299
#endif
4300
#ifndef OPENSSL_NO_DSA
4301 4302
    if (!(alg_a & SSL_aDSS) && !WPACKET_put_bytes_u8(pkt, SSL3_CT_DSS_SIGN))
        return 0;
4303
#endif
4304
#ifndef OPENSSL_NO_EC
4305
    /*
D
Dr. Stephen Henson 已提交
4306
     * ECDSA certs can be used with RSA cipher suites too so we don't
4307 4308
     * need to check for SSL_kECDH or SSL_kECDHE
     */
4309 4310 4311 4312
    if (s->version >= TLS1_VERSION
            && !(alg_a & SSL_aECDSA)
            && !WPACKET_put_bytes_u8(pkt, TLS_CT_ECDSA_SIGN))
        return 0;
4313
#endif
4314
    return 1;
4315
}
4316

4317
static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p, size_t len)
4318
{
4319 4320 4321 4322
    OPENSSL_free(c->ctype);
    c->ctype = NULL;
    c->ctype_len = 0;
    if (p == NULL || len == 0)
4323 4324 4325
        return 1;
    if (len > 0xff)
        return 0;
4326 4327
    c->ctype = OPENSSL_memdup(p, len);
    if (c->ctype == NULL)
4328
        return 0;
4329
    c->ctype_len = len;
4330 4331
    return 1;
}
4332

U
Ulf Möller 已提交
4333
int ssl3_shutdown(SSL *s)
4334 4335 4336 4337 4338 4339 4340
{
    int ret;

    /*
     * Don't do anything much if we have not done the handshake or we don't
     * want to send messages :-)
     */
M
Matt Caswell 已提交
4341
    if (s->quiet_shutdown || SSL_in_before(s)) {
4342
        s->shutdown = (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
4343
        return 1;
4344 4345 4346 4347 4348 4349 4350 4351 4352 4353
    }

    if (!(s->shutdown & SSL_SENT_SHUTDOWN)) {
        s->shutdown |= SSL_SENT_SHUTDOWN;
        ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY);
        /*
         * our shutdown alert has been sent now, and if it still needs to be
         * written, s->s3->alert_dispatch will be true
         */
        if (s->s3->alert_dispatch)
K
KaoruToda 已提交
4354
            return -1;        /* return WANT_WRITE */
4355 4356 4357 4358 4359 4360
    } else if (s->s3->alert_dispatch) {
        /* resend it if not sent */
        ret = s->method->ssl_dispatch_alert(s);
        if (ret == -1) {
            /*
             * we only get to return -1 here the 2nd/Nth invocation, we must
F
FdaSilvaYY 已提交
4361
             * have already signalled return 0 upon a previous invocation,
4362 4363
             * return WANT_WRITE
             */
K
KaoruToda 已提交
4364
            return ret;
4365 4366
        }
    } else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) {
4367
        size_t readbytes;
4368 4369 4370
        /*
         * If we are waiting for a close from our peer, we are closed
         */
4371
        s->method->ssl_read_bytes(s, 0, NULL, NULL, 0, 0, &readbytes);
4372
        if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) {
4373
            return -1;        /* return WANT_READ */
4374 4375 4376 4377 4378
        }
    }

    if ((s->shutdown == (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN)) &&
        !s->s3->alert_dispatch)
4379
        return 1;
4380
    else
K
KaoruToda 已提交
4381
        return 0;
4382
}
4383

M
Matt Caswell 已提交
4384
int ssl3_write(SSL *s, const void *buf, size_t len, size_t *written)
4385 4386 4387
{
    clear_sys_error();
    if (s->s3->renegotiate)
4388
        ssl3_renegotiate_check(s, 0);
4389

M
Matt Caswell 已提交
4390 4391
    return s->method->ssl_write_bytes(s, SSL3_RT_APPLICATION_DATA, buf, len,
                                      written);
4392
}
4393

4394
static int ssl3_read_internal(SSL *s, void *buf, size_t len, int peek,
4395
                              size_t *readbytes)
4396 4397 4398 4399 4400
{
    int ret;

    clear_sys_error();
    if (s->s3->renegotiate)
4401
        ssl3_renegotiate_check(s, 0);
4402 4403
    s->s3->in_read_app_data = 1;
    ret =
4404
        s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf, len,
4405
                                  peek, readbytes);
4406 4407 4408 4409 4410 4411 4412 4413
    if ((ret == -1) && (s->s3->in_read_app_data == 2)) {
        /*
         * ssl3_read_bytes decided to call s->handshake_func, which called
         * ssl3_read_bytes to read handshake data. However, ssl3_read_bytes
         * actually found application data and thinks that application data
         * makes sense here; so disable handshake processing and try to read
         * application data again.
         */
M
Matt Caswell 已提交
4414
        ossl_statem_set_in_handshake(s, 1);
4415
        ret =
4416
            s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf,
4417
                                      len, peek, readbytes);
M
Matt Caswell 已提交
4418
        ossl_statem_set_in_handshake(s, 0);
4419 4420 4421
    } else
        s->s3->in_read_app_data = 0;

4422
    return ret;
4423
}
4424

4425
int ssl3_read(SSL *s, void *buf, size_t len, size_t *readbytes)
4426
{
4427
    return ssl3_read_internal(s, buf, len, 0, readbytes);
4428
}
4429

4430
int ssl3_peek(SSL *s, void *buf, size_t len, size_t *readbytes)
4431
{
4432
    return ssl3_read_internal(s, buf, len, 1, readbytes);
4433
}
4434

U
Ulf Möller 已提交
4435
int ssl3_renegotiate(SSL *s)
4436 4437
{
    if (s->handshake_func == NULL)
4438
        return 1;
4439

4440
    s->s3->renegotiate = 1;
4441
    return 1;
4442
}
4443

4444 4445 4446 4447 4448 4449 4450 4451 4452
/*
 * Check if we are waiting to do a renegotiation and if so whether now is a
 * good time to do it. If |initok| is true then we are being called from inside
 * the state machine so ignore the result of SSL_in_init(s). Otherwise we
 * should not do a renegotiation if SSL_in_init(s) is true. Returns 1 if we
 * should do a renegotiation now and sets up the state machine for it. Otherwise
 * returns 0.
 */
int ssl3_renegotiate_check(SSL *s, int initok)
4453 4454 4455 4456
{
    int ret = 0;

    if (s->s3->renegotiate) {
4457 4458
        if (!RECORD_LAYER_read_pending(&s->rlayer)
            && !RECORD_LAYER_write_pending(&s->rlayer)
4459
            && (initok || !SSL_in_init(s))) {
4460 4461
            /*
             * if we are the server, and we have sent a 'RENEGOTIATE'
M
Matt Caswell 已提交
4462 4463
             * message, we need to set the state machine into the renegotiate
             * state.
4464
             */
M
Matt Caswell 已提交
4465
            ossl_statem_set_renegotiate(s);
4466 4467 4468 4469 4470 4471
            s->s3->renegotiate = 0;
            s->s3->num_renegotiations++;
            s->s3->total_renegotiations++;
            ret = 1;
        }
    }
4472
    return ret;
4473 4474
}

4475
/*
4476 4477
 * If we are using default SHA1+MD5 algorithms switch to new SHA256 PRF and
 * handshake macs if required.
D
Dr. Stephen Henson 已提交
4478 4479
 *
 * If PSK and using SHA384 for TLS < 1.2 switch to default.
4480 4481
 */
long ssl_get_algorithm2(SSL *s)
4482
{
4483 4484 4485 4486
    long alg2;
    if (s->s3 == NULL || s->s3->tmp.new_cipher == NULL)
        return -1;
    alg2 = s->s3->tmp.new_cipher->algorithm2;
D
Dr. Stephen Henson 已提交
4487 4488 4489 4490 4491 4492 4493
    if (s->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_SHA256_PRF) {
        if (alg2 == (SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF))
            return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256;
    } else if (s->s3->tmp.new_cipher->algorithm_mkey & SSL_PSK) {
        if (alg2 == (SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384))
            return SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF;
    }
4494 4495
    return alg2;
}
4496 4497 4498 4499 4500

/*
 * Fill a ClientRandom or ServerRandom field of length len. Returns <= 0 on
 * failure, 1 on success.
 */
4501 4502
int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, size_t len,
                          DOWNGRADE dgrd)
4503
{
4504
    int send_time = 0, ret;
4505 4506 4507 4508 4509 4510 4511 4512 4513 4514

    if (len < 4)
        return 0;
    if (server)
        send_time = (s->mode & SSL_MODE_SEND_SERVERHELLO_TIME) != 0;
    else
        send_time = (s->mode & SSL_MODE_SEND_CLIENTHELLO_TIME) != 0;
    if (send_time) {
        unsigned long Time = (unsigned long)time(NULL);
        unsigned char *p = result;
R
Rich Salz 已提交
4515

4516
        l2n(Time, p);
R
Rich Salz 已提交
4517
        ret = ssl_randbytes(s, p, len - 4);
4518
    } else {
R
Rich Salz 已提交
4519
        ret = ssl_randbytes(s, result, len);
4520 4521 4522
    }
#ifndef OPENSSL_NO_TLS13DOWNGRADE
    if (ret) {
4523 4524 4525
        if (!ossl_assert(sizeof(tls11downgrade) < len)
                || !ossl_assert(sizeof(tls12downgrade) < len))
             return 0;
4526 4527 4528 4529 4530 4531 4532 4533 4534
        if (dgrd == DOWNGRADE_TO_1_2)
            memcpy(result + len - sizeof(tls12downgrade), tls12downgrade,
                   sizeof(tls12downgrade));
        else if (dgrd == DOWNGRADE_TO_1_1)
            memcpy(result + len - sizeof(tls11downgrade), tls11downgrade,
                   sizeof(tls11downgrade));
    }
#endif
    return ret;
4535
}
4536 4537 4538 4539

int ssl_generate_master_secret(SSL *s, unsigned char *pms, size_t pmslen,
                               int free_pms)
{
4540
    unsigned long alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
4541 4542
    int ret = 0;

4543
    if (alg_k & SSL_PSK) {
4544
#ifndef OPENSSL_NO_PSK
4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556
        unsigned char *pskpms, *t;
        size_t psklen = s->s3->tmp.psklen;
        size_t pskpmslen;

        /* create PSK premaster_secret */

        /* For plain PSK "other_secret" is psklen zeroes */
        if (alg_k & SSL_kPSK)
            pmslen = psklen;

        pskpmslen = 4 + pmslen + psklen;
        pskpms = OPENSSL_malloc(pskpmslen);
4557
        if (pskpms == NULL)
4558
            goto err;
4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570
        t = pskpms;
        s2n(pmslen, t);
        if (alg_k & SSL_kPSK)
            memset(t, 0, pmslen);
        else
            memcpy(t, pms, pmslen);
        t += pmslen;
        s2n(psklen, t);
        memcpy(t, s->s3->tmp.psk, psklen);

        OPENSSL_clear_free(s->s3->tmp.psk, psklen);
        s->s3->tmp.psk = NULL;
4571 4572
        if (!s->method->ssl3_enc->generate_master_secret(s,
                    s->session->master_key,pskpms, pskpmslen,
4573 4574
                    &s->session->master_key_length)) {
            /* SSLfatal() already called */
4575
            goto err;
4576
        }
4577
        OPENSSL_clear_free(pskpms, pskpmslen);
4578 4579 4580
#else
        /* Should never happen */
        goto err;
4581
#endif
4582
    } else {
4583 4584
        if (!s->method->ssl3_enc->generate_master_secret(s,
                s->session->master_key, pms, pmslen,
4585 4586
                &s->session->master_key_length)) {
            /* SSLfatal() already called */
4587
            goto err;
4588
        }
4589 4590
    }

4591
    ret = 1;
4592
 err:
4593 4594 4595 4596 4597 4598
    if (pms) {
        if (free_pms)
            OPENSSL_clear_free(pms, pmslen);
        else
            OPENSSL_cleanse(pms, pmslen);
    }
4599 4600
    if (s->server == 0)
        s->s3->tmp.pms = NULL;
4601
    return ret;
4602
}
4603

D
Dr. Stephen Henson 已提交
4604 4605
/* Generate a private key from parameters */
EVP_PKEY *ssl_generate_pkey(EVP_PKEY *pm)
4606 4607 4608
{
    EVP_PKEY_CTX *pctx = NULL;
    EVP_PKEY *pkey = NULL;
D
Dr. Stephen Henson 已提交
4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626

    if (pm == NULL)
        return NULL;
    pctx = EVP_PKEY_CTX_new(pm, NULL);
    if (pctx == NULL)
        goto err;
    if (EVP_PKEY_keygen_init(pctx) <= 0)
        goto err;
    if (EVP_PKEY_keygen(pctx, &pkey) <= 0) {
        EVP_PKEY_free(pkey);
        pkey = NULL;
    }

    err:
    EVP_PKEY_CTX_free(pctx);
    return pkey;
}
#ifndef OPENSSL_NO_EC
4627
/* Generate a private key from a group ID */
4628
EVP_PKEY *ssl_generate_pkey_group(SSL *s, uint16_t id)
D
Dr. Stephen Henson 已提交
4629 4630 4631
{
    EVP_PKEY_CTX *pctx = NULL;
    EVP_PKEY *pkey = NULL;
4632 4633
    const TLS_GROUP_INFO *ginf = tls1_group_id_lookup(id);
    uint16_t gtype;
D
Dr. Stephen Henson 已提交
4634

4635 4636 4637
    if (ginf == NULL) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_GENERATE_PKEY_GROUP,
                 ERR_R_INTERNAL_ERROR);
D
Dr. Stephen Henson 已提交
4638
        goto err;
4639
    }
4640 4641 4642 4643
    gtype = ginf->flags & TLS_CURVE_TYPE;
    if (gtype == TLS_CURVE_CUSTOM)
        pctx = EVP_PKEY_CTX_new_id(ginf->nid, NULL);
    else
D
Dr. Stephen Henson 已提交
4644
        pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL);
4645 4646 4647
    if (pctx == NULL) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_GENERATE_PKEY_GROUP,
                 ERR_R_MALLOC_FAILURE);
4648
        goto err;
4649 4650 4651 4652
    }
    if (EVP_PKEY_keygen_init(pctx) <= 0) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_GENERATE_PKEY_GROUP,
                 ERR_R_EVP_LIB);
4653
        goto err;
4654
    }
4655
    if (gtype != TLS_CURVE_CUSTOM
4656 4657 4658
            && EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, ginf->nid) <= 0) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_GENERATE_PKEY_GROUP,
                 ERR_R_EVP_LIB);
4659
        goto err;
4660
    }
4661
    if (EVP_PKEY_keygen(pctx, &pkey) <= 0) {
4662 4663
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_GENERATE_PKEY_GROUP,
                 ERR_R_EVP_LIB);
4664 4665 4666 4667
        EVP_PKEY_free(pkey);
        pkey = NULL;
    }

E
Emilia Kasper 已提交
4668
 err:
4669 4670 4671
    EVP_PKEY_CTX_free(pctx);
    return pkey;
}
4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708

/*
 * Generate parameters from a group ID
 */
EVP_PKEY *ssl_generate_param_group(uint16_t id)
{
    EVP_PKEY_CTX *pctx = NULL;
    EVP_PKEY *pkey = NULL;
    const TLS_GROUP_INFO *ginf = tls1_group_id_lookup(id);

    if (ginf == NULL)
        goto err;

    if ((ginf->flags & TLS_CURVE_TYPE) == TLS_CURVE_CUSTOM) {
        pkey = EVP_PKEY_new();
        if (pkey != NULL && EVP_PKEY_set_type(pkey, ginf->nid))
            return pkey;
        EVP_PKEY_free(pkey);
        return NULL;
    }

    pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL);
    if (pctx == NULL)
        goto err;
    if (EVP_PKEY_paramgen_init(pctx) <= 0)
        goto err;
    if (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, ginf->nid) <= 0)
        goto err;
    if (EVP_PKEY_paramgen(pctx, &pkey) <= 0) {
        EVP_PKEY_free(pkey);
        pkey = NULL;
    }

 err:
    EVP_PKEY_CTX_free(pctx);
    return pkey;
}
D
Dr. Stephen Henson 已提交
4709
#endif
E
Emilia Kasper 已提交
4710

4711 4712
/* Derive secrets for ECDH/DH */
int ssl_derive(SSL *s, EVP_PKEY *privkey, EVP_PKEY *pubkey, int gensecret)
4713 4714 4715 4716 4717 4718
{
    int rv = 0;
    unsigned char *pms = NULL;
    size_t pmslen = 0;
    EVP_PKEY_CTX *pctx;

4719 4720 4721
    if (privkey == NULL || pubkey == NULL) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_DERIVE,
                 ERR_R_INTERNAL_ERROR);
4722
        return 0;
4723
    }
4724 4725 4726 4727 4728 4729

    pctx = EVP_PKEY_CTX_new(privkey, NULL);

    if (EVP_PKEY_derive_init(pctx) <= 0
        || EVP_PKEY_derive_set_peer(pctx, pubkey) <= 0
        || EVP_PKEY_derive(pctx, NULL, &pmslen) <= 0) {
4730 4731
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_DERIVE,
                 ERR_R_INTERNAL_ERROR);
4732 4733 4734 4735
        goto err;
    }

    pms = OPENSSL_malloc(pmslen);
4736 4737 4738
    if (pms == NULL) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_DERIVE,
                 ERR_R_MALLOC_FAILURE);
4739
        goto err;
4740
    }
4741

4742 4743 4744
    if (EVP_PKEY_derive(pctx, pms, &pmslen) <= 0) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_DERIVE,
                 ERR_R_INTERNAL_ERROR);
4745
        goto err;
4746
    }
4747

4748
    if (gensecret) {
4749
        /* SSLfatal() called as appropriate in the below functions */
4750 4751
        if (SSL_IS_TLS13(s)) {
            /*
4752 4753
             * If we are resuming then we already generated the early secret
             * when we created the ClientHello, so don't recreate it.
4754
             */
4755 4756 4757 4758
            if (!s->hit)
                rv = tls13_generate_secret(s, ssl_handshake_md(s), NULL, NULL,
                                           0,
                                           (unsigned char *)&s->early_secret);
4759 4760 4761
            else
                rv = 1;

4762
            rv = rv && tls13_generate_handshake_secret(s, pms, pmslen);
4763
        } else {
4764
            rv = ssl_generate_master_secret(s, pms, pmslen, 0);
4765
        }
4766
    } else {
4767
        /* Save premaster secret */
4768 4769 4770 4771 4772 4773
        s->s3->tmp.pms = pms;
        s->s3->tmp.pmslen = pmslen;
        pms = NULL;
        rv = 1;
    }

E
Emilia Kasper 已提交
4774
 err:
4775 4776 4777 4778
    OPENSSL_clear_free(pms, pmslen);
    EVP_PKEY_CTX_free(pctx);
    return rv;
}
D
Dr. Stephen Henson 已提交
4779

B
Ben Laurie 已提交
4780
#ifndef OPENSSL_NO_DH
D
Dr. Stephen Henson 已提交
4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792
EVP_PKEY *ssl_dh_to_pkey(DH *dh)
{
    EVP_PKEY *ret;
    if (dh == NULL)
        return NULL;
    ret = EVP_PKEY_new();
    if (EVP_PKEY_set1_DH(ret, dh) <= 0) {
        EVP_PKEY_free(ret);
        return NULL;
    }
    return ret;
}
B
Ben Laurie 已提交
4793
#endif