s3_lib.c 124.3 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

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

25 26 27 28 29 30 31 32
/* 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
};

33 34 35 36 37 38 39
/* The list of available TLSv1.3 ciphers */
static SSL_CIPHER tls13_ciphers[] = {
    {
        1,
        TLS1_3_RFC_AES_128_GCM_SHA256,
        TLS1_3_RFC_AES_128_GCM_SHA256,
        TLS1_3_CK_AES_128_GCM_SHA256,
40 41
        SSL_kANY,
        SSL_aANY,
42 43 44
        SSL_AES128GCM,
        SSL_AEAD,
        TLS1_3_VERSION, TLS1_3_VERSION,
45
        0, 0,
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
        SSL_HIGH,
        SSL_HANDSHAKE_MAC_SHA256,
        128,
        128,
    }, {
        1,
        TLS1_3_RFC_AES_256_GCM_SHA384,
        TLS1_3_RFC_AES_256_GCM_SHA384,
        TLS1_3_CK_AES_256_GCM_SHA384,
        SSL_kANY,
        SSL_aANY,
        SSL_AES256GCM,
        SSL_AEAD,
        TLS1_3_VERSION, TLS1_3_VERSION,
        0, 0,
        SSL_HIGH,
        SSL_HANDSHAKE_MAC_SHA384,
        256,
        256,
    },
#if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
    {
        1,
        TLS1_3_RFC_CHACHA20_POLY1305_SHA256,
        TLS1_3_RFC_CHACHA20_POLY1305_SHA256,
        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_RFC_AES_128_CCM_SHA256,
        TLS1_3_RFC_AES_128_CCM_SHA256,
        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_RFC_AES_128_CCM_8_SHA256,
        TLS1_3_RFC_AES_128_CCM_8_SHA256,
        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,
        128,
        128,
    }
};

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

1889
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
R
Rich Salz 已提交
1890 1891 1892
    {
     1,
     TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
1893
     TLS1_RFC_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
R
Rich Salz 已提交
1894 1895 1896 1897 1898 1899
     TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
     SSL_kSRP,
     SSL_aSRP,
     SSL_3DES,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1900
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1901
     SSL_NOT_DEFAULT | SSL_MEDIUM,
R
Rich Salz 已提交
1902 1903 1904 1905 1906 1907 1908
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
1909
     TLS1_RFC_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
R
Rich Salz 已提交
1910 1911 1912 1913 1914 1915
     TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
     SSL_kSRP,
     SSL_aRSA,
     SSL_3DES,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1916
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1917
     SSL_NOT_DEFAULT | SSL_MEDIUM,
R
Rich Salz 已提交
1918 1919 1920 1921 1922 1923 1924
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
1925
     TLS1_RFC_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
R
Rich Salz 已提交
1926 1927 1928 1929 1930 1931
     TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
     SSL_kSRP,
     SSL_aDSS,
     SSL_3DES,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1932
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1933
     SSL_NOT_DEFAULT | SSL_MEDIUM,
R
Rich Salz 已提交
1934 1935 1936 1937
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     112,
     168,
     },
1938
# endif
R
Rich Salz 已提交
1939 1940 1941
    {
     1,
     TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA,
1942
     TLS1_RFC_SRP_SHA_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
1943 1944 1945 1946 1947 1948
     TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA,
     SSL_kSRP,
     SSL_aSRP,
     SSL_AES128,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1949
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1950 1951 1952 1953 1954 1955 1956 1957
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
1958
     TLS1_RFC_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
1959 1960 1961 1962 1963 1964
     TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
     SSL_kSRP,
     SSL_aRSA,
     SSL_AES128,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1965
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1966 1967 1968 1969 1970 1971 1972 1973
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
1974
     TLS1_RFC_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
R
Rich Salz 已提交
1975 1976 1977 1978 1979 1980
     TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
     SSL_kSRP,
     SSL_aDSS,
     SSL_AES128,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1981
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1982 1983 1984 1985 1986 1987 1988 1989
     SSL_NOT_DEFAULT | SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     128,
     128,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA,
1990
     TLS1_RFC_SRP_SHA_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
1991 1992 1993 1994 1995 1996
     TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA,
     SSL_kSRP,
     SSL_aSRP,
     SSL_AES256,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
1997
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
1998 1999 2000 2001 2002 2003 2004 2005
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
2006
     TLS1_RFC_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
2007 2008 2009 2010 2011 2012
     TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
     SSL_kSRP,
     SSL_aRSA,
     SSL_AES256,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2013
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2014 2015 2016 2017 2018 2019 2020 2021
     SSL_HIGH,
     SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
     256,
     256,
     },
    {
     1,
     TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
2022
     TLS1_RFC_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
R
Rich Salz 已提交
2023 2024 2025 2026 2027 2028
     TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
     SSL_kSRP,
     SSL_aDSS,
     SSL_AES256,
     SSL_SHA1,
     SSL3_VERSION, TLS1_2_VERSION,
2029
     DTLS1_BAD_VER, DTLS1_2_VERSION,
R
Rich Salz 已提交
2030 2031 2032 2033 2034 2035 2036 2037 2038 2039
     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,
2040
     TLS1_RFC_DHE_RSA_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055
     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,
2056
     TLS1_RFC_ECDHE_RSA_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071
     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,
2072
     TLS1_RFC_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087
     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,
2088
     TLS1_RFC_PSK_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103
     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,
2104
     TLS1_RFC_ECDHE_PSK_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119
     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,
2120
     TLS1_RFC_DHE_PSK_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135
     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,
2136
     TLS1_RFC_RSA_PSK_WITH_CHACHA20_POLY1305,
R
Rich Salz 已提交
2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148
     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 已提交
2149 2150
#endif                          /* !defined(OPENSSL_NO_CHACHA) &&
                                 * !defined(OPENSSL_NO_POLY1305) */
R
Rich Salz 已提交
2151 2152 2153 2154 2155

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

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

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

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

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

3179 3180 3181 3182 3183 3184 3185 3186 3187
/*
 * 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",
3188
     "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
3189 3190 3191 3192 3193 3194
     SSL3_CK_SCSV,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    },
    {
     0,
     "TLS_FALLBACK_SCSV",
3195
     "TLS_FALLBACK_SCSV",
3196 3197 3198 3199 3200
     SSL3_CK_FALLBACK_SCSV,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    },
};

R
Rich Salz 已提交
3201 3202 3203 3204 3205
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 已提交
3206 3207 3208
    if (ap->id == bp->id)
        return 0;
    return ap->id < bp->id ? -1 : 1;
R
Rich Salz 已提交
3209 3210 3211 3212
}

void ssl_sort_cipher_list(void)
{
3213 3214
    qsort(tls13_ciphers, TLS13_NUM_CIPHERS, sizeof(tls13_ciphers[0]),
          cipher_compare);
R
Rich Salz 已提交
3215
    qsort(ssl3_ciphers, SSL3_NUM_CIPHERS, sizeof(ssl3_ciphers[0]),
R
Rich Salz 已提交
3216
          cipher_compare);
R
Rich Salz 已提交
3217
    qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
R
Rich Salz 已提交
3218 3219
}

B
Bernd Edlinger 已提交
3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233
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);
}

3234 3235 3236 3237 3238 3239 3240 3241 3242 3243
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 已提交
3244
    ssl_undefined_function_1,
3245
    0,
M
Matt Caswell 已提交
3246
    ssl3_set_handshake_header,
3247
    tls_close_construct_packet,
3248 3249
    ssl3_handshake_write
};
3250

3251
long ssl3_default_timeout(void)
3252 3253 3254 3255 3256 3257 3258
{
    /*
     * 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);
}
3259

U
Ulf Möller 已提交
3260
int ssl3_num_ciphers(void)
3261
{
K
KaoruToda 已提交
3262
    return SSL3_NUM_CIPHERS;
3263
}
3264

3265
const SSL_CIPHER *ssl3_get_cipher(unsigned int u)
3266 3267
{
    if (u < SSL3_NUM_CIPHERS)
K
KaoruToda 已提交
3268
        return &(ssl3_ciphers[SSL3_NUM_CIPHERS - 1 - u]);
3269
    else
K
KaoruToda 已提交
3270
        return NULL;
3271
}
3272

M
Matt Caswell 已提交
3273
int ssl3_set_handshake_header(SSL *s, WPACKET *pkt, int htype)
3274
{
3275 3276 3277 3278
    /* No header in the event of a CCS */
    if (htype == SSL3_MT_CHANGE_CIPHER_SPEC)
        return 1;

3279
    /* Set the content type and 3 bytes for the message len */
3280
    if (!WPACKET_put_bytes_u8(pkt, htype)
M
Matt Caswell 已提交
3281
            || !WPACKET_start_sub_packet_u24(pkt))
3282 3283 3284 3285 3286
        return 0;

    return 1;
}

D
Dr. Stephen Henson 已提交
3287
int ssl3_handshake_write(SSL *s)
3288 3289 3290
{
    return ssl3_do_write(s, SSL3_RT_HANDSHAKE);
}
D
Dr. Stephen Henson 已提交
3291

U
Ulf Möller 已提交
3292
int ssl3_new(SSL *s)
3293 3294
{
    SSL3_STATE *s3;
3295

R
Rich Salz 已提交
3296
    if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
3297 3298
        goto err;
    s->s3 = s3;
B
Ben Laurie 已提交
3299

B
Ben Laurie 已提交
3300
#ifndef OPENSSL_NO_SRP
V
Viktor Dukhovni 已提交
3301
    if (!SSL_SRP_CTX_init(s))
E
Emilia Kasper 已提交
3302
        goto err;
B
Ben Laurie 已提交
3303
#endif
3304 3305 3306 3307

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

M
Matt Caswell 已提交
3308
    return 1;
3309
 err:
M
Matt Caswell 已提交
3310
    return 0;
3311
}
3312

U
Ulf Möller 已提交
3313
void ssl3_free(SSL *s)
3314
{
R
Rich Salz 已提交
3315
    if (s == NULL || s->s3 == NULL)
3316
        return;
B
Ben Laurie 已提交
3317

3318
    ssl3_cleanup_key_block(s);
3319

D
Dr. Stephen Henson 已提交
3320
#if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH)
3321 3322
    EVP_PKEY_free(s->s3->peer_tmp);
    s->s3->peer_tmp = NULL;
D
Dr. Stephen Henson 已提交
3323 3324
    EVP_PKEY_free(s->s3->tmp.pkey);
    s->s3->tmp.pkey = NULL;
B
Bodo Möller 已提交
3325 3326
#endif

3327
    OPENSSL_free(s->s3->tmp.ctype);
3328
    sk_X509_NAME_pop_free(s->s3->tmp.peer_ca_names, X509_NAME_free);
D
Dr. Stephen Henson 已提交
3329 3330 3331
    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);
3332
    OPENSSL_free(s->s3->tmp.peer_cert_sigalgs);
3333
    ssl3_free_digest_list(s);
R
Rich Salz 已提交
3334
    OPENSSL_free(s->s3->alpn_selected);
T
Todd Short 已提交
3335
    OPENSSL_free(s->s3->alpn_proposed);
A
Adam Langley 已提交
3336

B
Ben Laurie 已提交
3337
#ifndef OPENSSL_NO_SRP
3338
    SSL_SRP_CTX_free(s);
B
Ben Laurie 已提交
3339
#endif
R
Rich Salz 已提交
3340
    OPENSSL_clear_free(s->s3, sizeof(*s->s3));
3341 3342
    s->s3 = NULL;
}
3343

3344
int ssl3_clear(SSL *s)
3345 3346
{
    ssl3_cleanup_key_block(s);
3347
    OPENSSL_free(s->s3->tmp.ctype);
3348
    sk_X509_NAME_pop_free(s->s3->tmp.peer_ca_names, X509_NAME_free);
D
Dr. Stephen Henson 已提交
3349 3350 3351
    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);
3352
    OPENSSL_free(s->s3->tmp.peer_cert_sigalgs);
3353

D
Dr. Stephen Henson 已提交
3354
#if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH)
D
Dr. Stephen Henson 已提交
3355
    EVP_PKEY_free(s->s3->tmp.pkey);
3356
    EVP_PKEY_free(s->s3->peer_tmp);
E
Emilia Kasper 已提交
3357
#endif                          /* !OPENSSL_NO_EC */
3358

3359
    ssl3_free_digest_list(s);
3360

T
Todd Short 已提交
3361 3362
    OPENSSL_free(s->s3->alpn_selected);
    OPENSSL_free(s->s3->alpn_proposed);
3363

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

3367 3368
    if (!ssl_free_wbio_buffer(s))
        return 0;
3369 3370

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

3372
#if !defined(OPENSSL_NO_NEXTPROTONEG)
R
Rich Salz 已提交
3373 3374 3375
    OPENSSL_free(s->ext.npn);
    s->ext.npn = NULL;
    s->ext.npn_len = 0;
B
Ben Laurie 已提交
3376
#endif
3377 3378

    return 1;
3379
}
3380

B
Ben Laurie 已提交
3381
#ifndef OPENSSL_NO_SRP
3382 3383
static char *srp_password_from_info_cb(SSL *s, void *arg)
{
R
Rich Salz 已提交
3384
    return OPENSSL_strdup(s->srp_ctx.info);
3385
}
B
Ben Laurie 已提交
3386 3387
#endif

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

3390
long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
3391 3392
{
    int ret = 0;
3393

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

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

R
Rich Salz 已提交
3472 3473
            OPENSSL_free(s->ext.hostname);
            s->ext.hostname = NULL;
3474 3475 3476 3477

            ret = 1;
            if (parg == NULL)
                break;
V
Viktor Dukhovni 已提交
3478 3479
            len = strlen((char *)parg);
            if (len == 0 || len > TLSEXT_MAXLEN_host_name) {
3480 3481 3482
                SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME);
                return 0;
            }
R
Rich Salz 已提交
3483
            if ((s->ext.hostname = OPENSSL_strdup((char *)parg)) == NULL) {
3484 3485 3486 3487 3488 3489 3490 3491 3492
                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 已提交
3493
        s->ext.debug_arg = parg;
3494 3495 3496
        ret = 1;
        break;

3497
    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
R
Rich Salz 已提交
3498
        ret = s->ext.status_type;
3499 3500
        break;

3501
    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
R
Rich Salz 已提交
3502
        s->ext.status_type = larg;
3503 3504 3505 3506
        ret = 1;
        break;

    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS:
R
Rich Salz 已提交
3507
        *(STACK_OF(X509_EXTENSION) **)parg = s->ext.ocsp.exts;
3508 3509 3510 3511
        ret = 1;
        break;

    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS:
R
Rich Salz 已提交
3512
        s->ext.ocsp.exts = parg;
3513 3514 3515 3516
        ret = 1;
        break;

    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS:
R
Rich Salz 已提交
3517
        *(STACK_OF(OCSP_RESPID) **)parg = s->ext.ocsp.ids;
3518 3519 3520 3521
        ret = 1;
        break;

    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS:
R
Rich Salz 已提交
3522
        s->ext.ocsp.ids = parg;
3523 3524 3525 3526
        ret = 1;
        break;

    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP:
R
Rich Salz 已提交
3527 3528 3529
        *(unsigned char **)parg = s->ext.ocsp.resp;
        if (s->ext.ocsp.resp_len == 0
                || s->ext.ocsp.resp_len > LONG_MAX)
M
Matt Caswell 已提交
3530
            return -1;
R
Rich Salz 已提交
3531
        return (long)s->ext.ocsp.resp_len;
3532 3533

    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
R
Rich Salz 已提交
3534 3535 3536
        OPENSSL_free(s->ext.ocsp.resp);
        s->ext.ocsp.resp = parg;
        s->ext.ocsp.resp_len = larg;
3537 3538 3539
        ret = 1;
        break;

3540 3541 3542 3543 3544 3545 3546
#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

3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571
    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 已提交
3572
            if (cipher == NULL)
3573 3574 3575 3576 3577 3578 3579
                return 0;
            /*
             * No certificate for unauthenticated ciphersuites or using SRP
             * authentication
             */
            if (cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP))
                return 2;
3580
            if (s->s3->tmp.cert == NULL)
3581
                return 0;
3582
            s->cert->key = s->s3->tmp.cert;
3583 3584 3585
            return 1;
        }
        return ssl_cert_set_current(s->cert, larg);
3586

3587
#ifndef OPENSSL_NO_EC
3588
    case SSL_CTRL_GET_GROUPS:
3589
        {
D
Dr. Stephen Henson 已提交
3590
            uint16_t *clist;
3591
            size_t clistlen;
R
Rich Salz 已提交
3592

3593 3594
            if (!s->session)
                return 0;
R
Rich Salz 已提交
3595
            clist = s->session->ext.supportedgroups;
D
Dr. Stephen Henson 已提交
3596
            clistlen = s->session->ext.supportedgroups_len;
3597 3598 3599
            if (parg) {
                size_t i;
                int *cptr = parg;
3600

3601
                for (i = 0; i < clistlen; i++) {
3602 3603 3604 3605
                    const TLS_GROUP_INFO *cinf = tls1_group_id_lookup(clist[i]);

                    if (cinf != NULL)
                        cptr[i] = cinf->nid;
3606
                    else
D
Dr. Stephen Henson 已提交
3607
                        cptr[i] = TLSEXT_nid_unknown | clist[i];
3608 3609 3610 3611 3612
                }
            }
            return (int)clistlen;
        }

3613
    case SSL_CTRL_SET_GROUPS:
R
Rich Salz 已提交
3614 3615
        return tls1_set_groups(&s->ext.supportedgroups,
                               &s->ext.supportedgroups_len, parg, larg);
3616

3617
    case SSL_CTRL_SET_GROUPS_LIST:
R
Rich Salz 已提交
3618 3619
        return tls1_set_groups_list(&s->ext.supportedgroups,
                                    &s->ext.supportedgroups_len, parg);
3620

3621
    case SSL_CTRL_GET_SHARED_GROUP:
3622 3623
        {
            uint16_t id = tls1_shared_group(s, larg);
3624

3625 3626 3627 3628 3629 3630 3631
            if (larg != -1) {
                const TLS_GROUP_INFO *ginf = tls1_group_id_lookup(id);

                return ginf == NULL ? 0 : ginf->nid;
            }
            return id;
        }
3632
#endif
3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650
    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)
3651 3652
                *pctype = s->s3->tmp.ctype;
            return s->s3->tmp.ctype_len;
3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669
        }

    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:
3670
        if (s->s3->tmp.peer_sigalg == NULL)
3671
            return 0;
3672 3673
        *(int *)parg = s->s3->tmp.peer_sigalg->hash;
        return 1;
3674 3675

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

            if (sess == NULL || sess->ext.ecpointformats == NULL)
3694
                return 0;
R
Rich Salz 已提交
3695 3696
            *pformat = sess->ext.ecpointformats;
            return (int)sess->ext.ecpointformats_len;
3697
        }
3698
#endif
B
Bodo Moeller 已提交
3699

3700 3701 3702
    default:
        break;
    }
K
KaoruToda 已提交
3703
    return ret;
3704 3705 3706 3707 3708
}

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

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

3723 3724 3725 3726 3727 3728 3729 3730
    case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
        {
            s->not_resumable_session_cb = (int (*)(SSL *, int))fp;
        }
        break;
    default:
        break;
    }
K
KaoruToda 已提交
3731
    return ret;
3732
}
3733

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

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

3833
    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
R
Rich Salz 已提交
3834
        return ctx->ext.status_type;
3835

3836
    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
R
Rich Salz 已提交
3837
        ctx->ext.status_type = larg;
3838 3839
        break;

3840
    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
R
Rich Salz 已提交
3841
        ctx->ext.status_arg = parg;
3842 3843
        return 1;

3844
    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG:
R
Rich Salz 已提交
3845
        *(void**)parg = ctx->ext.status_arg;
3846 3847 3848
        break;

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

3852
#ifndef OPENSSL_NO_SRP
3853 3854
    case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
        ctx->srp_ctx.srp_Mask |= SSL_kSRP;
R
Rich Salz 已提交
3855
        OPENSSL_free(ctx->srp_ctx.login);
3856 3857 3858
        ctx->srp_ctx.login = NULL;
        if (parg == NULL)
            break;
E
Emilia Kasper 已提交
3859
        if (strlen((const char *)parg) > 255 || strlen((const char *)parg) < 1) {
3860 3861 3862
            SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_SRP_USERNAME);
            return 0;
        }
R
Rich Salz 已提交
3863
        if ((ctx->srp_ctx.login = OPENSSL_strdup((char *)parg)) == NULL) {
3864 3865 3866 3867 3868 3869 3870
            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;
3871 3872 3873 3874 3875 3876
        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;
        }
3877 3878 3879 3880 3881 3882 3883 3884 3885
        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;
3886
#endif
3887

3888
#ifndef OPENSSL_NO_EC
3889
    case SSL_CTRL_SET_GROUPS:
R
Rich Salz 已提交
3890 3891
        return tls1_set_groups(&ctx->ext.supportedgroups,
                               &ctx->ext.supportedgroups_len,
3892 3893
                               parg, larg);

3894
    case SSL_CTRL_SET_GROUPS_LIST:
R
Rich Salz 已提交
3895 3896
        return tls1_set_groups_list(&ctx->ext.supportedgroups,
                                    &ctx->ext.supportedgroups_len,
3897
                                    parg);
3898
#endif
3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925
    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) {
3926 3927 3928 3929 3930 3931 3932 3933
            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;
3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944
        }
        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 已提交
3945 3946
        sk_X509_pop_free(ctx->extra_certs, X509_free);
        ctx->extra_certs = NULL;
3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971
        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 已提交
3972
        return 0;
3973
    }
3974
    return 1;
3975 3976 3977 3978 3979
}

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

    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB:
R
Rich Salz 已提交
3992
        ctx->ext.status_cb = (int (*)(SSL *, void *))fp;
3993 3994 3995
        break;

    case SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB:
R
Rich Salz 已提交
3996
        ctx->ext.ticket_key_cb = (int (*)(SSL *, unsigned char *,
3997 3998 3999 4000 4001
                                             unsigned char *,
                                             EVP_CIPHER_CTX *,
                                             HMAC_CTX *, int))fp;
        break;

4002
#ifndef OPENSSL_NO_SRP
4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016
    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;
4017
#endif
4018 4019 4020 4021 4022 4023
    case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
        {
            ctx->not_resumable_session_cb = (int (*)(SSL *, int))fp;
        }
        break;
    default:
K
KaoruToda 已提交
4024
        return 0;
4025
    }
4026
    return 1;
4027
}
4028

4029 4030 4031
const SSL_CIPHER *ssl3_get_cipher_by_id(uint32_t id)
{
    SSL_CIPHER c;
4032
    const SSL_CIPHER *cp;
4033 4034

    c.id = id;
4035 4036 4037
    cp = OBJ_bsearch_ssl_cipher_id(&c, tls13_ciphers, TLS13_NUM_CIPHERS);
    if (cp != NULL)
        return cp;
4038 4039 4040 4041
    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);
4042 4043
}

4044 4045
const SSL_CIPHER *ssl3_get_cipher_by_std_name(const char *stdname)
{
4046 4047 4048
    SSL_CIPHER *c = NULL, *tbl;
    SSL_CIPHER *alltabs[] = {tls13_ciphers, ssl3_ciphers};
    size_t i, j, tblsize[] = {TLS13_NUM_CIPHERS, SSL3_NUM_CIPHERS};
4049

4050
    /* this is not efficient, necessary to optimize this? */
4051 4052 4053 4054 4055 4056 4057 4058
    for (j = 0; j < OSSL_NELEM(alltabs); j++) {
        for (i = 0, tbl = alltabs[j]; i < tblsize[j]; i++, tbl++) {
            if (tbl->stdname == NULL)
                continue;
            if (strcmp(stdname, tbl->stdname) == 0) {
                c = tbl;
                break;
            }
4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072
        }
    }
    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;
}

4073 4074 4075 4076
/*
 * This function needs to check if the ciphers required are actually
 * available
 */
4077
const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p)
4078
{
4079
    return ssl3_get_cipher_by_id(SSL3_CK_CIPHERSUITE_FLAG
4080 4081
                                 | ((uint32_t)p[0] << 8L)
                                 | (uint32_t)p[1]);
4082
}
4083

M
Matt Caswell 已提交
4084
int ssl3_put_cipher_by_char(const SSL_CIPHER *c, WPACKET *pkt, size_t *len)
4085
{
4086
    if ((c->id & 0xff000000) != SSL3_CK_CIPHERSUITE_FLAG) {
4087 4088 4089 4090
        *len = 0;
        return 1;
    }

4091
    if (!WPACKET_put_bytes_u16(pkt, c->id & 0xffff))
4092 4093 4094 4095 4096 4097
        return 0;

    *len = 2;
    return 1;
}

4098 4099 4100 4101 4102 4103 4104 4105
/*
 * 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.
 */
4106
const SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
E
Emilia Kasper 已提交
4107
                                     STACK_OF(SSL_CIPHER) *srvr)
4108
{
4109
    const SSL_CIPHER *c, *ret = NULL;
4110
    STACK_OF(SSL_CIPHER) *prio, *allow;
4111
    int i, ii, ok, prefer_sha256 = 0;
4112
    unsigned long alg_k = 0, alg_a = 0, mask_k = 0, mask_a = 0;
4113
    const EVP_MD *mdsha256 = EVP_sha256();
4114 4115 4116
#ifndef OPENSSL_NO_CHACHA
    STACK_OF(SSL_CIPHER) *prio_chacha = NULL;
#endif
4117

4118
    /* Let's see which ciphers we can support */
4119

4120 4121 4122 4123 4124 4125
    /*
     * 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().
     */
4126

B
Ben Laurie 已提交
4127
#ifdef CIPHER_DEBUG
4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139
    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 已提交
4140 4141
#endif

4142 4143 4144 4145 4146
    /* 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) {
4147 4148
        prio = srvr;
        allow = clnt;
4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166
#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 已提交
4167
                    prio_chacha = sk_SSL_CIPHER_new_reserve(NULL, num);
4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188
                    /* 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
4189 4190 4191 4192 4193
    } else {
        prio = clnt;
        allow = srvr;
    }

4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211
    if (SSL_IS_TLS13(s)) {
        int j;

        /*
         * If we allow "old" style PSK callbacks, and we have no certificate (so
         * we're not going to succeed without a PSK anyway), and we're in
         * TLSv1.3 then the default hash for a PSK is SHA-256 (as per the
         * TLSv1.3 spec). Therefore we should prioritise ciphersuites using
         * that.
         */
        if (s->psk_server_callback != NULL) {
            for (j = 0; j < SSL_PKEY_NUM && !ssl_has_cert(s, j); j++);
            if (j == SSL_PKEY_NUM) {
                /* There are no certificates */
                prefer_sha256 = 1;
            }
        }
    } else {
4212 4213 4214
        tls1_set_cert_validity(s);
        ssl_set_masks(s);
    }
4215 4216 4217 4218

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

4219 4220
        /* Skip ciphers not supported by the protocol version */
        if (!SSL_IS_DTLS(s) &&
E
Emilia Kasper 已提交
4221
            ((s->version < c->min_tls) || (s->version > c->max_tls)))
4222
            continue;
4223
        if (SSL_IS_DTLS(s) &&
E
Emilia Kasper 已提交
4224 4225
            (DTLS_VERSION_LT(s->version, c->min_dtls) ||
             DTLS_VERSION_GT(s->version, c->max_dtls)))
4226
            continue;
4227

4228 4229 4230 4231 4232
        /*
         * Since TLS 1.3 ciphersuites can be used with any auth or
         * key exchange scheme skip tests.
         */
        if (!SSL_IS_TLS13(s)) {
4233 4234
            mask_k = s->s3->tmp.mask_k;
            mask_a = s->s3->tmp.mask_a;
B
Ben Laurie 已提交
4235
#ifndef OPENSSL_NO_SRP
4236 4237 4238 4239
            if (s->srp_ctx.srp_Mask & SSL_kSRP) {
                mask_k |= SSL_kSRP;
                mask_a |= SSL_aSRP;
            }
B
Ben Laurie 已提交
4240
#endif
4241

4242 4243
            alg_k = c->algorithm_mkey;
            alg_a = c->algorithm_auth;
4244

4245
#ifndef OPENSSL_NO_PSK
4246 4247 4248
            /* with PSK there must be server callback set */
            if ((alg_k & SSL_PSK) && s->psk_server_callback == NULL)
                continue;
4249 4250
#endif                          /* OPENSSL_NO_PSK */

4251
            ok = (alg_k & mask_k) && (alg_a & mask_a);
4252
#ifdef CIPHER_DEBUG
4253 4254
            fprintf(stderr, "%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n", ok, alg_k,
                    alg_a, mask_k, mask_a, (void *)c, c->name);
4255 4256
#endif

E
Emilia Kasper 已提交
4257
#ifndef OPENSSL_NO_EC
4258 4259 4260 4261 4262 4263
            /*
             * 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 已提交
4264
#endif                          /* OPENSSL_NO_EC */
4265

4266 4267 4268
            if (!ok)
                continue;
        }
4269 4270 4271 4272
        ii = sk_SSL_CIPHER_find(allow, c);
        if (ii >= 0) {
            /* Check security callback permits this cipher */
            if (!ssl_security(s, SSL_SECOP_CIPHER_SHARED,
4273
                              c->strength_bits, 0, (void *)c))
4274
                continue;
4275
#if !defined(OPENSSL_NO_EC)
4276 4277 4278 4279 4280 4281
            if ((alg_k & SSL_kECDHE) && (alg_a & SSL_aECDSA)
                && s->s3->is_probably_safari) {
                if (!ret)
                    ret = sk_SSL_CIPHER_value(allow, ii);
                continue;
            }
4282
#endif
4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293
            if (prefer_sha256) {
                const SSL_CIPHER *tmp = sk_SSL_CIPHER_value(allow, ii);

                if (ssl_md(tmp->algorithm2) == mdsha256) {
                    ret = tmp;
                    break;
                }
                if (ret == NULL)
                    ret = tmp;
                continue;
            }
4294 4295 4296 4297
            ret = sk_SSL_CIPHER_value(allow, ii);
            break;
        }
    }
4298 4299 4300
#ifndef OPENSSL_NO_CHACHA
    sk_SSL_CIPHER_free(prio_chacha);
#endif
K
KaoruToda 已提交
4301
    return ret;
4302
}
4303

4304
int ssl3_get_req_cert_type(SSL *s, WPACKET *pkt)
4305
{
4306
    uint32_t alg_k, alg_a = 0;
4307 4308

    /* If we have custom certificate types set, use them */
4309 4310
    if (s->cert->ctype)
        return WPACKET_memcpy(pkt, s->cert->ctype, s->cert->ctype_len);
4311 4312 4313 4314
    /* 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;
4315

D
Dr. Stephen Henson 已提交
4316
#ifndef OPENSSL_NO_GOST
4317 4318 4319 4320
    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 已提交
4321 4322
#endif

D
Dr. Stephen Henson 已提交
4323
    if ((s->version == SSL3_VERSION) && (alg_k & SSL_kDHE)) {
4324
#ifndef OPENSSL_NO_DH
4325
# ifndef OPENSSL_NO_RSA
4326 4327
        if (!WPACKET_put_bytes_u8(pkt, SSL3_CT_RSA_EPHEMERAL_DH))
            return 0;
4328 4329
# endif
# ifndef OPENSSL_NO_DSA
4330 4331
        if (!WPACKET_put_bytes_u8(pkt, SSL3_CT_DSS_EPHEMERAL_DH))
            return 0;
4332 4333
# endif
#endif                          /* !OPENSSL_NO_DH */
B
Ben Laurie 已提交
4334
    }
4335
#ifndef OPENSSL_NO_RSA
4336 4337
    if (!(alg_a & SSL_aRSA) && !WPACKET_put_bytes_u8(pkt, SSL3_CT_RSA_SIGN))
        return 0;
4338
#endif
4339
#ifndef OPENSSL_NO_DSA
4340 4341
    if (!(alg_a & SSL_aDSS) && !WPACKET_put_bytes_u8(pkt, SSL3_CT_DSS_SIGN))
        return 0;
4342
#endif
4343
#ifndef OPENSSL_NO_EC
4344
    /*
D
Dr. Stephen Henson 已提交
4345
     * ECDSA certs can be used with RSA cipher suites too so we don't
4346 4347
     * need to check for SSL_kECDH or SSL_kECDHE
     */
4348 4349 4350 4351
    if (s->version >= TLS1_VERSION
            && !(alg_a & SSL_aECDSA)
            && !WPACKET_put_bytes_u8(pkt, TLS_CT_ECDSA_SIGN))
        return 0;
4352
#endif
4353
    return 1;
4354
}
4355

4356
static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p, size_t len)
4357
{
4358 4359 4360 4361
    OPENSSL_free(c->ctype);
    c->ctype = NULL;
    c->ctype_len = 0;
    if (p == NULL || len == 0)
4362 4363 4364
        return 1;
    if (len > 0xff)
        return 0;
4365 4366
    c->ctype = OPENSSL_memdup(p, len);
    if (c->ctype == NULL)
4367
        return 0;
4368
    c->ctype_len = len;
4369 4370
    return 1;
}
4371

U
Ulf Möller 已提交
4372
int ssl3_shutdown(SSL *s)
4373 4374 4375 4376 4377 4378 4379
{
    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 已提交
4380
    if (s->quiet_shutdown || SSL_in_before(s)) {
4381
        s->shutdown = (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
4382
        return 1;
4383 4384 4385 4386 4387 4388 4389 4390 4391 4392
    }

    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 已提交
4393
            return -1;        /* return WANT_WRITE */
4394 4395 4396 4397 4398 4399
    } 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 已提交
4400
             * have already signalled return 0 upon a previous invocation,
4401 4402
             * return WANT_WRITE
             */
K
KaoruToda 已提交
4403
            return ret;
4404 4405
        }
    } else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) {
4406
        size_t readbytes;
4407 4408 4409
        /*
         * If we are waiting for a close from our peer, we are closed
         */
4410
        s->method->ssl_read_bytes(s, 0, NULL, NULL, 0, 0, &readbytes);
4411
        if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) {
4412
            return -1;        /* return WANT_READ */
4413 4414 4415 4416 4417
        }
    }

    if ((s->shutdown == (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN)) &&
        !s->s3->alert_dispatch)
4418
        return 1;
4419
    else
K
KaoruToda 已提交
4420
        return 0;
4421
}
4422

M
Matt Caswell 已提交
4423
int ssl3_write(SSL *s, const void *buf, size_t len, size_t *written)
4424 4425 4426
{
    clear_sys_error();
    if (s->s3->renegotiate)
4427
        ssl3_renegotiate_check(s, 0);
4428

M
Matt Caswell 已提交
4429 4430
    return s->method->ssl_write_bytes(s, SSL3_RT_APPLICATION_DATA, buf, len,
                                      written);
4431
}
4432

4433
static int ssl3_read_internal(SSL *s, void *buf, size_t len, int peek,
4434
                              size_t *readbytes)
4435 4436 4437 4438 4439
{
    int ret;

    clear_sys_error();
    if (s->s3->renegotiate)
4440
        ssl3_renegotiate_check(s, 0);
4441 4442
    s->s3->in_read_app_data = 1;
    ret =
4443
        s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf, len,
4444
                                  peek, readbytes);
4445 4446 4447 4448 4449 4450 4451 4452
    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 已提交
4453
        ossl_statem_set_in_handshake(s, 1);
4454
        ret =
4455
            s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf,
4456
                                      len, peek, readbytes);
M
Matt Caswell 已提交
4457
        ossl_statem_set_in_handshake(s, 0);
4458 4459 4460
    } else
        s->s3->in_read_app_data = 0;

4461
    return ret;
4462
}
4463

4464
int ssl3_read(SSL *s, void *buf, size_t len, size_t *readbytes)
4465
{
4466
    return ssl3_read_internal(s, buf, len, 0, readbytes);
4467
}
4468

4469
int ssl3_peek(SSL *s, void *buf, size_t len, size_t *readbytes)
4470
{
4471
    return ssl3_read_internal(s, buf, len, 1, readbytes);
4472
}
4473

U
Ulf Möller 已提交
4474
int ssl3_renegotiate(SSL *s)
4475 4476
{
    if (s->handshake_func == NULL)
4477
        return 1;
4478

4479
    s->s3->renegotiate = 1;
4480
    return 1;
4481
}
4482

4483 4484 4485 4486 4487 4488 4489 4490 4491
/*
 * 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)
4492 4493 4494 4495
{
    int ret = 0;

    if (s->s3->renegotiate) {
4496 4497
        if (!RECORD_LAYER_read_pending(&s->rlayer)
            && !RECORD_LAYER_write_pending(&s->rlayer)
4498
            && (initok || !SSL_in_init(s))) {
4499 4500
            /*
             * if we are the server, and we have sent a 'RENEGOTIATE'
M
Matt Caswell 已提交
4501 4502
             * message, we need to set the state machine into the renegotiate
             * state.
4503
             */
M
Matt Caswell 已提交
4504
            ossl_statem_set_renegotiate(s);
4505 4506 4507 4508 4509 4510
            s->s3->renegotiate = 0;
            s->s3->num_renegotiations++;
            s->s3->total_renegotiations++;
            ret = 1;
        }
    }
4511
    return ret;
4512 4513
}

4514
/*
4515 4516
 * If we are using default SHA1+MD5 algorithms switch to new SHA256 PRF and
 * handshake macs if required.
D
Dr. Stephen Henson 已提交
4517 4518
 *
 * If PSK and using SHA384 for TLS < 1.2 switch to default.
4519 4520
 */
long ssl_get_algorithm2(SSL *s)
4521
{
4522 4523 4524 4525
    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 已提交
4526 4527 4528 4529 4530 4531 4532
    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;
    }
4533 4534
    return alg2;
}
4535 4536 4537 4538 4539

/*
 * Fill a ClientRandom or ServerRandom field of length len. Returns <= 0 on
 * failure, 1 on success.
 */
4540 4541
int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, size_t len,
                          DOWNGRADE dgrd)
4542
{
4543
    int send_time = 0, ret;
4544 4545 4546 4547 4548 4549 4550 4551 4552 4553

    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 已提交
4554

4555
        l2n(Time, p);
4556
        ret = RAND_bytes(p, len - 4);
4557
    } else {
4558
        ret = RAND_bytes(result, len);
4559 4560
    }
#ifndef OPENSSL_NO_TLS13DOWNGRADE
4561
    if (ret > 0) {
4562 4563 4564
        if (!ossl_assert(sizeof(tls11downgrade) < len)
                || !ossl_assert(sizeof(tls12downgrade) < len))
             return 0;
4565 4566 4567 4568 4569 4570 4571 4572 4573
        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;
4574
}
4575 4576 4577 4578

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

4582
    if (alg_k & SSL_PSK) {
4583
#ifndef OPENSSL_NO_PSK
4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595
        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);
4596
        if (pskpms == NULL)
4597
            goto err;
4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609
        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;
4610 4611
        if (!s->method->ssl3_enc->generate_master_secret(s,
                    s->session->master_key,pskpms, pskpmslen,
4612 4613
                    &s->session->master_key_length)) {
            /* SSLfatal() already called */
4614
            goto err;
4615
        }
4616
        OPENSSL_clear_free(pskpms, pskpmslen);
4617 4618 4619
#else
        /* Should never happen */
        goto err;
4620
#endif
4621
    } else {
4622 4623
        if (!s->method->ssl3_enc->generate_master_secret(s,
                s->session->master_key, pms, pmslen,
4624 4625
                &s->session->master_key_length)) {
            /* SSLfatal() already called */
4626
            goto err;
4627
        }
4628 4629
    }

4630
    ret = 1;
4631
 err:
4632 4633 4634 4635 4636 4637
    if (pms) {
        if (free_pms)
            OPENSSL_clear_free(pms, pmslen);
        else
            OPENSSL_cleanse(pms, pmslen);
    }
4638 4639
    if (s->server == 0)
        s->s3->tmp.pms = NULL;
4640
    return ret;
4641
}
4642

D
Dr. Stephen Henson 已提交
4643 4644
/* Generate a private key from parameters */
EVP_PKEY *ssl_generate_pkey(EVP_PKEY *pm)
4645 4646 4647
{
    EVP_PKEY_CTX *pctx = NULL;
    EVP_PKEY *pkey = NULL;
D
Dr. Stephen Henson 已提交
4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665

    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
4666
/* Generate a private key from a group ID */
4667
EVP_PKEY *ssl_generate_pkey_group(SSL *s, uint16_t id)
D
Dr. Stephen Henson 已提交
4668 4669 4670
{
    EVP_PKEY_CTX *pctx = NULL;
    EVP_PKEY *pkey = NULL;
4671 4672
    const TLS_GROUP_INFO *ginf = tls1_group_id_lookup(id);
    uint16_t gtype;
D
Dr. Stephen Henson 已提交
4673

4674 4675 4676
    if (ginf == NULL) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_GENERATE_PKEY_GROUP,
                 ERR_R_INTERNAL_ERROR);
D
Dr. Stephen Henson 已提交
4677
        goto err;
4678
    }
4679 4680 4681 4682
    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 已提交
4683
        pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL);
4684 4685 4686
    if (pctx == NULL) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_GENERATE_PKEY_GROUP,
                 ERR_R_MALLOC_FAILURE);
4687
        goto err;
4688 4689 4690 4691
    }
    if (EVP_PKEY_keygen_init(pctx) <= 0) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_GENERATE_PKEY_GROUP,
                 ERR_R_EVP_LIB);
4692
        goto err;
4693
    }
4694
    if (gtype != TLS_CURVE_CUSTOM
4695 4696 4697
            && 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);
4698
        goto err;
4699
    }
4700
    if (EVP_PKEY_keygen(pctx, &pkey) <= 0) {
4701 4702
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_GENERATE_PKEY_GROUP,
                 ERR_R_EVP_LIB);
4703 4704 4705 4706
        EVP_PKEY_free(pkey);
        pkey = NULL;
    }

E
Emilia Kasper 已提交
4707
 err:
4708 4709 4710
    EVP_PKEY_CTX_free(pctx);
    return pkey;
}
4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747

/*
 * 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 已提交
4748
#endif
E
Emilia Kasper 已提交
4749

4750 4751
/* Derive secrets for ECDH/DH */
int ssl_derive(SSL *s, EVP_PKEY *privkey, EVP_PKEY *pubkey, int gensecret)
4752 4753 4754 4755 4756 4757
{
    int rv = 0;
    unsigned char *pms = NULL;
    size_t pmslen = 0;
    EVP_PKEY_CTX *pctx;

4758 4759 4760
    if (privkey == NULL || pubkey == NULL) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_DERIVE,
                 ERR_R_INTERNAL_ERROR);
4761
        return 0;
4762
    }
4763 4764 4765 4766 4767 4768

    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) {
4769 4770
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_DERIVE,
                 ERR_R_INTERNAL_ERROR);
4771 4772 4773 4774
        goto err;
    }

    pms = OPENSSL_malloc(pmslen);
4775 4776 4777
    if (pms == NULL) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_DERIVE,
                 ERR_R_MALLOC_FAILURE);
4778
        goto err;
4779
    }
4780

4781 4782 4783
    if (EVP_PKEY_derive(pctx, pms, &pmslen) <= 0) {
        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL_DERIVE,
                 ERR_R_INTERNAL_ERROR);
4784
        goto err;
4785
    }
4786

4787
    if (gensecret) {
4788
        /* SSLfatal() called as appropriate in the below functions */
4789 4790
        if (SSL_IS_TLS13(s)) {
            /*
4791 4792
             * If we are resuming then we already generated the early secret
             * when we created the ClientHello, so don't recreate it.
4793
             */
4794 4795 4796 4797
            if (!s->hit)
                rv = tls13_generate_secret(s, ssl_handshake_md(s), NULL, NULL,
                                           0,
                                           (unsigned char *)&s->early_secret);
4798 4799 4800
            else
                rv = 1;

4801
            rv = rv && tls13_generate_handshake_secret(s, pms, pmslen);
4802
        } else {
4803
            rv = ssl_generate_master_secret(s, pms, pmslen, 0);
4804
        }
4805
    } else {
4806
        /* Save premaster secret */
4807 4808 4809 4810 4811 4812
        s->s3->tmp.pms = pms;
        s->s3->tmp.pmslen = pmslen;
        pms = NULL;
        rv = 1;
    }

E
Emilia Kasper 已提交
4813
 err:
4814 4815 4816 4817
    OPENSSL_clear_free(pms, pmslen);
    EVP_PKEY_CTX_free(pctx);
    return rv;
}
D
Dr. Stephen Henson 已提交
4818

B
Ben Laurie 已提交
4819
#ifndef OPENSSL_NO_DH
D
Dr. Stephen Henson 已提交
4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831
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 已提交
4832
#endif