Print this page
4853 illumos-gate is not lint-clean when built with openssl 1.0
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/openssl/libsunw_ssl/s3_lib.c
+++ new/usr/src/lib/openssl/libsunw_ssl/s3_lib.c
1 1 /* ssl/s3_lib.c */
2 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 3 * All rights reserved.
4 4 *
5 5 * This package is an SSL implementation written
6 6 * by Eric Young (eay@cryptsoft.com).
7 7 * The implementation was written so as to conform with Netscapes SSL.
8 8 *
9 9 * This library is free for commercial and non-commercial use as long as
10 10 * the following conditions are aheared to. The following conditions
11 11 * apply to all code found in this distribution, be it the RC4, RSA,
12 12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 13 * included with this distribution is covered by the same copyright terms
14 14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 15 *
16 16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 17 * the code are not to be removed.
18 18 * If this package is used in a product, Eric Young should be given attribution
19 19 * as the author of the parts of the library used.
20 20 * This can be in the form of a textual message at program startup or
21 21 * in documentation (online or textual) provided with the package.
22 22 *
23 23 * Redistribution and use in source and binary forms, with or without
24 24 * modification, are permitted provided that the following conditions
25 25 * are met:
26 26 * 1. Redistributions of source code must retain the copyright
27 27 * notice, this list of conditions and the following disclaimer.
28 28 * 2. Redistributions in binary form must reproduce the above copyright
29 29 * notice, this list of conditions and the following disclaimer in the
30 30 * documentation and/or other materials provided with the distribution.
31 31 * 3. All advertising materials mentioning features or use of this software
32 32 * must display the following acknowledgement:
33 33 * "This product includes cryptographic software written by
34 34 * Eric Young (eay@cryptsoft.com)"
35 35 * The word 'cryptographic' can be left out if the rouines from the library
36 36 * being used are not cryptographic related :-).
37 37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 38 * the apps directory (application code) you must include an acknowledgement:
39 39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 40 *
41 41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 51 * SUCH DAMAGE.
52 52 *
53 53 * The licence and distribution terms for any publically available version or
54 54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 55 * copied and put under another distribution licence
56 56 * [including the GNU Public Licence.]
57 57 */
58 58 /* ====================================================================
59 59 * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved.
60 60 *
61 61 * Redistribution and use in source and binary forms, with or without
62 62 * modification, are permitted provided that the following conditions
63 63 * are met:
64 64 *
65 65 * 1. Redistributions of source code must retain the above copyright
66 66 * notice, this list of conditions and the following disclaimer.
67 67 *
68 68 * 2. Redistributions in binary form must reproduce the above copyright
69 69 * notice, this list of conditions and the following disclaimer in
70 70 * the documentation and/or other materials provided with the
71 71 * distribution.
72 72 *
73 73 * 3. All advertising materials mentioning features or use of this
74 74 * software must display the following acknowledgment:
75 75 * "This product includes software developed by the OpenSSL Project
76 76 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77 77 *
78 78 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79 79 * endorse or promote products derived from this software without
80 80 * prior written permission. For written permission, please contact
81 81 * openssl-core@openssl.org.
82 82 *
83 83 * 5. Products derived from this software may not be called "OpenSSL"
84 84 * nor may "OpenSSL" appear in their names without prior written
85 85 * permission of the OpenSSL Project.
86 86 *
87 87 * 6. Redistributions of any form whatsoever must retain the following
88 88 * acknowledgment:
89 89 * "This product includes software developed by the OpenSSL Project
90 90 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91 91 *
92 92 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93 93 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94 94 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95 95 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
96 96 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97 97 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98 98 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99 99 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100 100 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101 101 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102 102 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103 103 * OF THE POSSIBILITY OF SUCH DAMAGE.
104 104 * ====================================================================
105 105 *
106 106 * This product includes cryptographic software written by Eric Young
107 107 * (eay@cryptsoft.com). This product includes software written by Tim
108 108 * Hudson (tjh@cryptsoft.com).
109 109 *
110 110 */
111 111 /* ====================================================================
112 112 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
113 113 *
114 114 * Portions of the attached software ("Contribution") are developed by
115 115 * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
116 116 *
117 117 * The Contribution is licensed pursuant to the OpenSSL open source
118 118 * license provided above.
119 119 *
120 120 * ECC cipher suite support in OpenSSL originally written by
121 121 * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories.
122 122 *
123 123 */
124 124 /* ====================================================================
125 125 * Copyright 2005 Nokia. All rights reserved.
126 126 *
127 127 * The portions of the attached software ("Contribution") is developed by
128 128 * Nokia Corporation and is licensed pursuant to the OpenSSL open source
129 129 * license.
130 130 *
131 131 * The Contribution, originally written by Mika Kousa and Pasi Eronen of
132 132 * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
133 133 * support (see RFC 4279) to OpenSSL.
134 134 *
135 135 * No patent licenses or other rights except those expressly stated in
136 136 * the OpenSSL open source license shall be deemed granted or received
137 137 * expressly, by implication, estoppel, or otherwise.
138 138 *
139 139 * No assurances are provided by Nokia that the Contribution does not
140 140 * infringe the patent or other intellectual property rights of any third
141 141 * party or that the license provides you with all the necessary rights
142 142 * to make use of the Contribution.
143 143 *
144 144 * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
145 145 * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
146 146 * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
↓ open down ↓ |
146 lines elided |
↑ open up ↑ |
147 147 * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
148 148 * OTHERWISE.
149 149 */
150 150
151 151 #include <stdio.h>
152 152 #include <openssl/objects.h>
153 153 #include "ssl_locl.h"
154 154 #include "kssl_lcl.h"
155 155 #ifndef OPENSSL_NO_TLSEXT
156 156 #ifndef OPENSSL_NO_EC
157 -#include "../crypto/ec/ec_lcl.h"
157 +#include <ec_lcl.h>
158 158 #endif /* OPENSSL_NO_EC */
159 159 #endif /* OPENSSL_NO_TLSEXT */
160 160 #include <openssl/md5.h>
161 161 #ifndef OPENSSL_NO_DH
162 162 #include <openssl/dh.h>
163 163 #endif
164 164
165 165 const char ssl3_version_str[]="SSLv3" OPENSSL_VERSION_PTEXT;
166 166
167 167 #define SSL3_NUM_CIPHERS (sizeof(ssl3_ciphers)/sizeof(SSL_CIPHER))
168 168
169 169 /* list of available SSLv3 ciphers (sorted by id) */
170 170 OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={
171 171
172 172 /* The RSA ciphers */
173 173 /* Cipher 01 */
174 174 {
175 175 1,
176 176 SSL3_TXT_RSA_NULL_MD5,
177 177 SSL3_CK_RSA_NULL_MD5,
178 178 SSL_kRSA,
179 179 SSL_aRSA,
180 180 SSL_eNULL,
181 181 SSL_MD5,
182 182 SSL_SSLV3,
183 183 SSL_NOT_EXP|SSL_STRONG_NONE,
184 184 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
185 185 0,
186 186 0,
187 187 },
188 188
189 189 /* Cipher 02 */
190 190 {
191 191 1,
192 192 SSL3_TXT_RSA_NULL_SHA,
193 193 SSL3_CK_RSA_NULL_SHA,
194 194 SSL_kRSA,
195 195 SSL_aRSA,
196 196 SSL_eNULL,
197 197 SSL_SHA1,
198 198 SSL_SSLV3,
199 199 SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
200 200 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
201 201 0,
202 202 0,
203 203 },
204 204
205 205 /* Cipher 03 */
206 206 {
207 207 1,
208 208 SSL3_TXT_RSA_RC4_40_MD5,
209 209 SSL3_CK_RSA_RC4_40_MD5,
210 210 SSL_kRSA,
211 211 SSL_aRSA,
212 212 SSL_RC4,
213 213 SSL_MD5,
214 214 SSL_SSLV3,
215 215 SSL_EXPORT|SSL_EXP40,
216 216 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
217 217 40,
218 218 128,
219 219 },
220 220
221 221 /* Cipher 04 */
222 222 {
223 223 1,
224 224 SSL3_TXT_RSA_RC4_128_MD5,
225 225 SSL3_CK_RSA_RC4_128_MD5,
226 226 SSL_kRSA,
227 227 SSL_aRSA,
228 228 SSL_RC4,
229 229 SSL_MD5,
230 230 SSL_SSLV3,
231 231 SSL_NOT_EXP|SSL_MEDIUM,
232 232 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
233 233 128,
234 234 128,
235 235 },
236 236
237 237 /* Cipher 05 */
238 238 {
239 239 1,
240 240 SSL3_TXT_RSA_RC4_128_SHA,
241 241 SSL3_CK_RSA_RC4_128_SHA,
242 242 SSL_kRSA,
243 243 SSL_aRSA,
244 244 SSL_RC4,
245 245 SSL_SHA1,
246 246 SSL_SSLV3,
247 247 SSL_NOT_EXP|SSL_MEDIUM,
248 248 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
249 249 128,
250 250 128,
251 251 },
252 252
253 253 /* Cipher 06 */
254 254 {
255 255 1,
256 256 SSL3_TXT_RSA_RC2_40_MD5,
257 257 SSL3_CK_RSA_RC2_40_MD5,
258 258 SSL_kRSA,
259 259 SSL_aRSA,
260 260 SSL_RC2,
261 261 SSL_MD5,
262 262 SSL_SSLV3,
263 263 SSL_EXPORT|SSL_EXP40,
264 264 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
265 265 40,
266 266 128,
267 267 },
268 268
269 269 /* Cipher 07 */
270 270 #ifndef OPENSSL_NO_IDEA
271 271 {
272 272 1,
273 273 SSL3_TXT_RSA_IDEA_128_SHA,
274 274 SSL3_CK_RSA_IDEA_128_SHA,
275 275 SSL_kRSA,
276 276 SSL_aRSA,
277 277 SSL_IDEA,
278 278 SSL_SHA1,
279 279 SSL_SSLV3,
280 280 SSL_NOT_EXP|SSL_MEDIUM,
281 281 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
282 282 128,
283 283 128,
284 284 },
285 285 #endif
286 286
287 287 /* Cipher 08 */
288 288 {
289 289 1,
290 290 SSL3_TXT_RSA_DES_40_CBC_SHA,
291 291 SSL3_CK_RSA_DES_40_CBC_SHA,
292 292 SSL_kRSA,
293 293 SSL_aRSA,
294 294 SSL_DES,
295 295 SSL_SHA1,
296 296 SSL_SSLV3,
297 297 SSL_EXPORT|SSL_EXP40,
298 298 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
299 299 40,
300 300 56,
301 301 },
302 302
303 303 /* Cipher 09 */
304 304 {
305 305 1,
306 306 SSL3_TXT_RSA_DES_64_CBC_SHA,
307 307 SSL3_CK_RSA_DES_64_CBC_SHA,
308 308 SSL_kRSA,
309 309 SSL_aRSA,
310 310 SSL_DES,
311 311 SSL_SHA1,
312 312 SSL_SSLV3,
313 313 SSL_NOT_EXP|SSL_LOW,
314 314 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
315 315 56,
316 316 56,
317 317 },
318 318
319 319 /* Cipher 0A */
320 320 {
321 321 1,
322 322 SSL3_TXT_RSA_DES_192_CBC3_SHA,
323 323 SSL3_CK_RSA_DES_192_CBC3_SHA,
324 324 SSL_kRSA,
325 325 SSL_aRSA,
326 326 SSL_3DES,
327 327 SSL_SHA1,
328 328 SSL_SSLV3,
329 329 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
330 330 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
331 331 112,
332 332 168,
333 333 },
334 334
335 335 /* The DH ciphers */
336 336 /* Cipher 0B */
337 337 {
338 338 0,
339 339 SSL3_TXT_DH_DSS_DES_40_CBC_SHA,
340 340 SSL3_CK_DH_DSS_DES_40_CBC_SHA,
341 341 SSL_kDHd,
342 342 SSL_aDH,
343 343 SSL_DES,
344 344 SSL_SHA1,
345 345 SSL_SSLV3,
346 346 SSL_EXPORT|SSL_EXP40,
347 347 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
348 348 40,
349 349 56,
350 350 },
351 351
352 352 /* Cipher 0C */
353 353 {
354 354 0, /* not implemented (non-ephemeral DH) */
355 355 SSL3_TXT_DH_DSS_DES_64_CBC_SHA,
356 356 SSL3_CK_DH_DSS_DES_64_CBC_SHA,
357 357 SSL_kDHd,
358 358 SSL_aDH,
359 359 SSL_DES,
360 360 SSL_SHA1,
361 361 SSL_SSLV3,
362 362 SSL_NOT_EXP|SSL_LOW,
363 363 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
364 364 56,
365 365 56,
366 366 },
367 367
368 368 /* Cipher 0D */
369 369 {
370 370 0, /* not implemented (non-ephemeral DH) */
371 371 SSL3_TXT_DH_DSS_DES_192_CBC3_SHA,
372 372 SSL3_CK_DH_DSS_DES_192_CBC3_SHA,
373 373 SSL_kDHd,
374 374 SSL_aDH,
375 375 SSL_3DES,
376 376 SSL_SHA1,
377 377 SSL_SSLV3,
378 378 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
379 379 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
380 380 112,
381 381 168,
382 382 },
383 383
384 384 /* Cipher 0E */
385 385 {
386 386 0, /* not implemented (non-ephemeral DH) */
387 387 SSL3_TXT_DH_RSA_DES_40_CBC_SHA,
388 388 SSL3_CK_DH_RSA_DES_40_CBC_SHA,
389 389 SSL_kDHr,
390 390 SSL_aDH,
391 391 SSL_DES,
392 392 SSL_SHA1,
393 393 SSL_SSLV3,
394 394 SSL_EXPORT|SSL_EXP40,
395 395 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
396 396 40,
397 397 56,
398 398 },
399 399
400 400 /* Cipher 0F */
401 401 {
402 402 0, /* not implemented (non-ephemeral DH) */
403 403 SSL3_TXT_DH_RSA_DES_64_CBC_SHA,
404 404 SSL3_CK_DH_RSA_DES_64_CBC_SHA,
405 405 SSL_kDHr,
406 406 SSL_aDH,
407 407 SSL_DES,
408 408 SSL_SHA1,
409 409 SSL_SSLV3,
410 410 SSL_NOT_EXP|SSL_LOW,
411 411 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
412 412 56,
413 413 56,
414 414 },
415 415
416 416 /* Cipher 10 */
417 417 {
418 418 0, /* not implemented (non-ephemeral DH) */
419 419 SSL3_TXT_DH_RSA_DES_192_CBC3_SHA,
420 420 SSL3_CK_DH_RSA_DES_192_CBC3_SHA,
421 421 SSL_kDHr,
422 422 SSL_aDH,
423 423 SSL_3DES,
424 424 SSL_SHA1,
425 425 SSL_SSLV3,
426 426 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
427 427 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
428 428 112,
429 429 168,
430 430 },
431 431
432 432 /* The Ephemeral DH ciphers */
433 433 /* Cipher 11 */
434 434 {
435 435 1,
436 436 SSL3_TXT_EDH_DSS_DES_40_CBC_SHA,
437 437 SSL3_CK_EDH_DSS_DES_40_CBC_SHA,
438 438 SSL_kEDH,
439 439 SSL_aDSS,
440 440 SSL_DES,
441 441 SSL_SHA1,
442 442 SSL_SSLV3,
443 443 SSL_EXPORT|SSL_EXP40,
444 444 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
445 445 40,
446 446 56,
447 447 },
448 448
449 449 /* Cipher 12 */
450 450 {
451 451 1,
452 452 SSL3_TXT_EDH_DSS_DES_64_CBC_SHA,
453 453 SSL3_CK_EDH_DSS_DES_64_CBC_SHA,
454 454 SSL_kEDH,
455 455 SSL_aDSS,
456 456 SSL_DES,
457 457 SSL_SHA1,
458 458 SSL_SSLV3,
459 459 SSL_NOT_EXP|SSL_LOW,
460 460 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
461 461 56,
462 462 56,
463 463 },
464 464
465 465 /* Cipher 13 */
466 466 {
467 467 1,
468 468 SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA,
469 469 SSL3_CK_EDH_DSS_DES_192_CBC3_SHA,
470 470 SSL_kEDH,
471 471 SSL_aDSS,
472 472 SSL_3DES,
473 473 SSL_SHA1,
474 474 SSL_SSLV3,
475 475 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
476 476 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
477 477 112,
478 478 168,
479 479 },
480 480
481 481 /* Cipher 14 */
482 482 {
483 483 1,
484 484 SSL3_TXT_EDH_RSA_DES_40_CBC_SHA,
485 485 SSL3_CK_EDH_RSA_DES_40_CBC_SHA,
486 486 SSL_kEDH,
487 487 SSL_aRSA,
488 488 SSL_DES,
489 489 SSL_SHA1,
490 490 SSL_SSLV3,
491 491 SSL_EXPORT|SSL_EXP40,
492 492 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
493 493 40,
494 494 56,
495 495 },
496 496
497 497 /* Cipher 15 */
498 498 {
499 499 1,
500 500 SSL3_TXT_EDH_RSA_DES_64_CBC_SHA,
501 501 SSL3_CK_EDH_RSA_DES_64_CBC_SHA,
502 502 SSL_kEDH,
503 503 SSL_aRSA,
504 504 SSL_DES,
505 505 SSL_SHA1,
506 506 SSL_SSLV3,
507 507 SSL_NOT_EXP|SSL_LOW,
508 508 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
509 509 56,
510 510 56,
511 511 },
512 512
513 513 /* Cipher 16 */
514 514 {
515 515 1,
516 516 SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA,
517 517 SSL3_CK_EDH_RSA_DES_192_CBC3_SHA,
518 518 SSL_kEDH,
519 519 SSL_aRSA,
520 520 SSL_3DES,
521 521 SSL_SHA1,
522 522 SSL_SSLV3,
523 523 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
524 524 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
525 525 112,
526 526 168,
527 527 },
528 528
529 529 /* Cipher 17 */
530 530 {
531 531 1,
532 532 SSL3_TXT_ADH_RC4_40_MD5,
533 533 SSL3_CK_ADH_RC4_40_MD5,
534 534 SSL_kEDH,
535 535 SSL_aNULL,
536 536 SSL_RC4,
537 537 SSL_MD5,
538 538 SSL_SSLV3,
539 539 SSL_EXPORT|SSL_EXP40,
540 540 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
541 541 40,
542 542 128,
543 543 },
544 544
545 545 /* Cipher 18 */
546 546 {
547 547 1,
548 548 SSL3_TXT_ADH_RC4_128_MD5,
549 549 SSL3_CK_ADH_RC4_128_MD5,
550 550 SSL_kEDH,
551 551 SSL_aNULL,
552 552 SSL_RC4,
553 553 SSL_MD5,
554 554 SSL_SSLV3,
555 555 SSL_NOT_EXP|SSL_MEDIUM,
556 556 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
557 557 128,
558 558 128,
559 559 },
560 560
561 561 /* Cipher 19 */
562 562 {
563 563 1,
564 564 SSL3_TXT_ADH_DES_40_CBC_SHA,
565 565 SSL3_CK_ADH_DES_40_CBC_SHA,
566 566 SSL_kEDH,
567 567 SSL_aNULL,
568 568 SSL_DES,
569 569 SSL_SHA1,
570 570 SSL_SSLV3,
571 571 SSL_EXPORT|SSL_EXP40,
572 572 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
573 573 40,
574 574 128,
575 575 },
576 576
577 577 /* Cipher 1A */
578 578 {
579 579 1,
580 580 SSL3_TXT_ADH_DES_64_CBC_SHA,
581 581 SSL3_CK_ADH_DES_64_CBC_SHA,
582 582 SSL_kEDH,
583 583 SSL_aNULL,
584 584 SSL_DES,
585 585 SSL_SHA1,
586 586 SSL_SSLV3,
587 587 SSL_NOT_EXP|SSL_LOW,
588 588 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
589 589 56,
590 590 56,
591 591 },
592 592
593 593 /* Cipher 1B */
594 594 {
595 595 1,
596 596 SSL3_TXT_ADH_DES_192_CBC_SHA,
597 597 SSL3_CK_ADH_DES_192_CBC_SHA,
598 598 SSL_kEDH,
599 599 SSL_aNULL,
600 600 SSL_3DES,
601 601 SSL_SHA1,
602 602 SSL_SSLV3,
603 603 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
604 604 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
605 605 112,
606 606 168,
607 607 },
608 608
609 609 /* Fortezza ciphersuite from SSL 3.0 spec */
610 610 #if 0
611 611 /* Cipher 1C */
612 612 {
613 613 0,
614 614 SSL3_TXT_FZA_DMS_NULL_SHA,
615 615 SSL3_CK_FZA_DMS_NULL_SHA,
616 616 SSL_kFZA,
617 617 SSL_aFZA,
618 618 SSL_eNULL,
619 619 SSL_SHA1,
620 620 SSL_SSLV3,
621 621 SSL_NOT_EXP|SSL_STRONG_NONE,
622 622 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
623 623 0,
624 624 0,
625 625 },
626 626
627 627 /* Cipher 1D */
628 628 {
629 629 0,
630 630 SSL3_TXT_FZA_DMS_FZA_SHA,
631 631 SSL3_CK_FZA_DMS_FZA_SHA,
632 632 SSL_kFZA,
633 633 SSL_aFZA,
634 634 SSL_eFZA,
635 635 SSL_SHA1,
636 636 SSL_SSLV3,
637 637 SSL_NOT_EXP|SSL_STRONG_NONE,
638 638 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
639 639 0,
640 640 0,
641 641 },
642 642
643 643 /* Cipher 1E */
644 644 {
645 645 0,
646 646 SSL3_TXT_FZA_DMS_RC4_SHA,
647 647 SSL3_CK_FZA_DMS_RC4_SHA,
648 648 SSL_kFZA,
649 649 SSL_aFZA,
650 650 SSL_RC4,
651 651 SSL_SHA1,
652 652 SSL_SSLV3,
653 653 SSL_NOT_EXP|SSL_MEDIUM,
654 654 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
655 655 128,
656 656 128,
657 657 },
658 658 #endif
659 659
660 660 #ifndef OPENSSL_NO_KRB5
661 661 /* The Kerberos ciphers*/
662 662 /* Cipher 1E */
663 663 {
664 664 1,
665 665 SSL3_TXT_KRB5_DES_64_CBC_SHA,
666 666 SSL3_CK_KRB5_DES_64_CBC_SHA,
667 667 SSL_kKRB5,
668 668 SSL_aKRB5,
669 669 SSL_DES,
670 670 SSL_SHA1,
671 671 SSL_SSLV3,
672 672 SSL_NOT_EXP|SSL_LOW,
673 673 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
674 674 56,
675 675 56,
676 676 },
677 677
678 678 /* Cipher 1F */
679 679 {
680 680 1,
681 681 SSL3_TXT_KRB5_DES_192_CBC3_SHA,
682 682 SSL3_CK_KRB5_DES_192_CBC3_SHA,
683 683 SSL_kKRB5,
684 684 SSL_aKRB5,
685 685 SSL_3DES,
686 686 SSL_SHA1,
687 687 SSL_SSLV3,
688 688 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
689 689 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
690 690 112,
691 691 168,
692 692 },
693 693
694 694 /* Cipher 20 */
695 695 {
696 696 1,
697 697 SSL3_TXT_KRB5_RC4_128_SHA,
698 698 SSL3_CK_KRB5_RC4_128_SHA,
699 699 SSL_kKRB5,
700 700 SSL_aKRB5,
701 701 SSL_RC4,
702 702 SSL_SHA1,
703 703 SSL_SSLV3,
704 704 SSL_NOT_EXP|SSL_MEDIUM,
705 705 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
706 706 128,
707 707 128,
708 708 },
709 709
710 710 /* Cipher 21 */
711 711 {
712 712 1,
713 713 SSL3_TXT_KRB5_IDEA_128_CBC_SHA,
714 714 SSL3_CK_KRB5_IDEA_128_CBC_SHA,
715 715 SSL_kKRB5,
716 716 SSL_aKRB5,
717 717 SSL_IDEA,
718 718 SSL_SHA1,
719 719 SSL_SSLV3,
720 720 SSL_NOT_EXP|SSL_MEDIUM,
721 721 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
722 722 128,
723 723 128,
724 724 },
725 725
726 726 /* Cipher 22 */
727 727 {
728 728 1,
729 729 SSL3_TXT_KRB5_DES_64_CBC_MD5,
730 730 SSL3_CK_KRB5_DES_64_CBC_MD5,
731 731 SSL_kKRB5,
732 732 SSL_aKRB5,
733 733 SSL_DES,
734 734 SSL_MD5,
735 735 SSL_SSLV3,
736 736 SSL_NOT_EXP|SSL_LOW,
737 737 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
738 738 56,
739 739 56,
740 740 },
741 741
742 742 /* Cipher 23 */
743 743 {
744 744 1,
745 745 SSL3_TXT_KRB5_DES_192_CBC3_MD5,
746 746 SSL3_CK_KRB5_DES_192_CBC3_MD5,
747 747 SSL_kKRB5,
748 748 SSL_aKRB5,
749 749 SSL_3DES,
750 750 SSL_MD5,
751 751 SSL_SSLV3,
752 752 SSL_NOT_EXP|SSL_HIGH,
753 753 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
754 754 112,
755 755 168,
756 756 },
757 757
758 758 /* Cipher 24 */
759 759 {
760 760 1,
761 761 SSL3_TXT_KRB5_RC4_128_MD5,
762 762 SSL3_CK_KRB5_RC4_128_MD5,
763 763 SSL_kKRB5,
764 764 SSL_aKRB5,
765 765 SSL_RC4,
766 766 SSL_MD5,
767 767 SSL_SSLV3,
768 768 SSL_NOT_EXP|SSL_MEDIUM,
769 769 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
770 770 128,
771 771 128,
772 772 },
773 773
774 774 /* Cipher 25 */
775 775 {
776 776 1,
777 777 SSL3_TXT_KRB5_IDEA_128_CBC_MD5,
778 778 SSL3_CK_KRB5_IDEA_128_CBC_MD5,
779 779 SSL_kKRB5,
780 780 SSL_aKRB5,
781 781 SSL_IDEA,
782 782 SSL_MD5,
783 783 SSL_SSLV3,
784 784 SSL_NOT_EXP|SSL_MEDIUM,
785 785 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
786 786 128,
787 787 128,
788 788 },
789 789
790 790 /* Cipher 26 */
791 791 {
792 792 1,
793 793 SSL3_TXT_KRB5_DES_40_CBC_SHA,
794 794 SSL3_CK_KRB5_DES_40_CBC_SHA,
795 795 SSL_kKRB5,
796 796 SSL_aKRB5,
797 797 SSL_DES,
798 798 SSL_SHA1,
799 799 SSL_SSLV3,
800 800 SSL_EXPORT|SSL_EXP40,
801 801 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
802 802 40,
803 803 56,
804 804 },
805 805
806 806 /* Cipher 27 */
807 807 {
808 808 1,
809 809 SSL3_TXT_KRB5_RC2_40_CBC_SHA,
810 810 SSL3_CK_KRB5_RC2_40_CBC_SHA,
811 811 SSL_kKRB5,
812 812 SSL_aKRB5,
813 813 SSL_RC2,
814 814 SSL_SHA1,
815 815 SSL_SSLV3,
816 816 SSL_EXPORT|SSL_EXP40,
817 817 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
818 818 40,
819 819 128,
820 820 },
821 821
822 822 /* Cipher 28 */
823 823 {
824 824 1,
825 825 SSL3_TXT_KRB5_RC4_40_SHA,
826 826 SSL3_CK_KRB5_RC4_40_SHA,
827 827 SSL_kKRB5,
828 828 SSL_aKRB5,
829 829 SSL_RC4,
830 830 SSL_SHA1,
831 831 SSL_SSLV3,
832 832 SSL_EXPORT|SSL_EXP40,
833 833 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
834 834 40,
835 835 128,
836 836 },
837 837
838 838 /* Cipher 29 */
839 839 {
840 840 1,
841 841 SSL3_TXT_KRB5_DES_40_CBC_MD5,
842 842 SSL3_CK_KRB5_DES_40_CBC_MD5,
843 843 SSL_kKRB5,
844 844 SSL_aKRB5,
845 845 SSL_DES,
846 846 SSL_MD5,
847 847 SSL_SSLV3,
848 848 SSL_EXPORT|SSL_EXP40,
849 849 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
850 850 40,
851 851 56,
852 852 },
853 853
854 854 /* Cipher 2A */
855 855 {
856 856 1,
857 857 SSL3_TXT_KRB5_RC2_40_CBC_MD5,
858 858 SSL3_CK_KRB5_RC2_40_CBC_MD5,
859 859 SSL_kKRB5,
860 860 SSL_aKRB5,
861 861 SSL_RC2,
862 862 SSL_MD5,
863 863 SSL_SSLV3,
864 864 SSL_EXPORT|SSL_EXP40,
865 865 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
866 866 40,
867 867 128,
868 868 },
869 869
870 870 /* Cipher 2B */
871 871 {
872 872 1,
873 873 SSL3_TXT_KRB5_RC4_40_MD5,
874 874 SSL3_CK_KRB5_RC4_40_MD5,
875 875 SSL_kKRB5,
876 876 SSL_aKRB5,
877 877 SSL_RC4,
878 878 SSL_MD5,
879 879 SSL_SSLV3,
880 880 SSL_EXPORT|SSL_EXP40,
881 881 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
882 882 40,
883 883 128,
884 884 },
885 885 #endif /* OPENSSL_NO_KRB5 */
886 886
887 887 /* New AES ciphersuites */
888 888 /* Cipher 2F */
889 889 {
890 890 1,
891 891 TLS1_TXT_RSA_WITH_AES_128_SHA,
892 892 TLS1_CK_RSA_WITH_AES_128_SHA,
893 893 SSL_kRSA,
894 894 SSL_aRSA,
895 895 SSL_AES128,
896 896 SSL_SHA1,
897 897 SSL_TLSV1,
898 898 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
899 899 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
900 900 128,
901 901 128,
902 902 },
903 903 /* Cipher 30 */
904 904 {
905 905 0,
906 906 TLS1_TXT_DH_DSS_WITH_AES_128_SHA,
907 907 TLS1_CK_DH_DSS_WITH_AES_128_SHA,
908 908 SSL_kDHd,
909 909 SSL_aDH,
910 910 SSL_AES128,
911 911 SSL_SHA1,
912 912 SSL_TLSV1,
913 913 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
914 914 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
915 915 128,
916 916 128,
917 917 },
918 918 /* Cipher 31 */
919 919 {
920 920 0,
921 921 TLS1_TXT_DH_RSA_WITH_AES_128_SHA,
922 922 TLS1_CK_DH_RSA_WITH_AES_128_SHA,
923 923 SSL_kDHr,
924 924 SSL_aDH,
925 925 SSL_AES128,
926 926 SSL_SHA1,
927 927 SSL_TLSV1,
928 928 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
929 929 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
930 930 128,
931 931 128,
932 932 },
933 933 /* Cipher 32 */
934 934 {
935 935 1,
936 936 TLS1_TXT_DHE_DSS_WITH_AES_128_SHA,
937 937 TLS1_CK_DHE_DSS_WITH_AES_128_SHA,
938 938 SSL_kEDH,
939 939 SSL_aDSS,
940 940 SSL_AES128,
941 941 SSL_SHA1,
942 942 SSL_TLSV1,
943 943 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
944 944 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
945 945 128,
946 946 128,
947 947 },
948 948 /* Cipher 33 */
949 949 {
950 950 1,
951 951 TLS1_TXT_DHE_RSA_WITH_AES_128_SHA,
952 952 TLS1_CK_DHE_RSA_WITH_AES_128_SHA,
953 953 SSL_kEDH,
954 954 SSL_aRSA,
955 955 SSL_AES128,
956 956 SSL_SHA1,
957 957 SSL_TLSV1,
958 958 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
959 959 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
960 960 128,
961 961 128,
962 962 },
963 963 /* Cipher 34 */
964 964 {
965 965 1,
966 966 TLS1_TXT_ADH_WITH_AES_128_SHA,
967 967 TLS1_CK_ADH_WITH_AES_128_SHA,
968 968 SSL_kEDH,
969 969 SSL_aNULL,
970 970 SSL_AES128,
971 971 SSL_SHA1,
972 972 SSL_TLSV1,
973 973 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
974 974 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
975 975 128,
976 976 128,
977 977 },
978 978
979 979 /* Cipher 35 */
980 980 {
981 981 1,
982 982 TLS1_TXT_RSA_WITH_AES_256_SHA,
983 983 TLS1_CK_RSA_WITH_AES_256_SHA,
984 984 SSL_kRSA,
985 985 SSL_aRSA,
986 986 SSL_AES256,
987 987 SSL_SHA1,
988 988 SSL_TLSV1,
989 989 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
990 990 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
991 991 256,
992 992 256,
993 993 },
994 994 /* Cipher 36 */
995 995 {
996 996 0,
997 997 TLS1_TXT_DH_DSS_WITH_AES_256_SHA,
998 998 TLS1_CK_DH_DSS_WITH_AES_256_SHA,
999 999 SSL_kDHd,
1000 1000 SSL_aDH,
1001 1001 SSL_AES256,
1002 1002 SSL_SHA1,
1003 1003 SSL_TLSV1,
1004 1004 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1005 1005 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1006 1006 256,
1007 1007 256,
1008 1008 },
1009 1009
1010 1010 /* Cipher 37 */
1011 1011 {
1012 1012 0, /* not implemented (non-ephemeral DH) */
1013 1013 TLS1_TXT_DH_RSA_WITH_AES_256_SHA,
1014 1014 TLS1_CK_DH_RSA_WITH_AES_256_SHA,
1015 1015 SSL_kDHr,
1016 1016 SSL_aDH,
1017 1017 SSL_AES256,
1018 1018 SSL_SHA1,
1019 1019 SSL_TLSV1,
1020 1020 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1021 1021 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1022 1022 256,
1023 1023 256,
1024 1024 },
1025 1025
1026 1026 /* Cipher 38 */
1027 1027 {
1028 1028 1,
1029 1029 TLS1_TXT_DHE_DSS_WITH_AES_256_SHA,
1030 1030 TLS1_CK_DHE_DSS_WITH_AES_256_SHA,
1031 1031 SSL_kEDH,
1032 1032 SSL_aDSS,
1033 1033 SSL_AES256,
1034 1034 SSL_SHA1,
1035 1035 SSL_TLSV1,
1036 1036 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1037 1037 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1038 1038 256,
1039 1039 256,
1040 1040 },
1041 1041
1042 1042 /* Cipher 39 */
1043 1043 {
1044 1044 1,
1045 1045 TLS1_TXT_DHE_RSA_WITH_AES_256_SHA,
1046 1046 TLS1_CK_DHE_RSA_WITH_AES_256_SHA,
1047 1047 SSL_kEDH,
1048 1048 SSL_aRSA,
1049 1049 SSL_AES256,
1050 1050 SSL_SHA1,
1051 1051 SSL_TLSV1,
1052 1052 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1053 1053 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1054 1054 256,
1055 1055 256,
1056 1056 },
1057 1057
1058 1058 /* Cipher 3A */
1059 1059 {
1060 1060 1,
1061 1061 TLS1_TXT_ADH_WITH_AES_256_SHA,
1062 1062 TLS1_CK_ADH_WITH_AES_256_SHA,
1063 1063 SSL_kEDH,
1064 1064 SSL_aNULL,
1065 1065 SSL_AES256,
1066 1066 SSL_SHA1,
1067 1067 SSL_TLSV1,
1068 1068 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1069 1069 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1070 1070 256,
1071 1071 256,
1072 1072 },
1073 1073
1074 1074 /* TLS v1.2 ciphersuites */
1075 1075 /* Cipher 3B */
1076 1076 {
1077 1077 1,
1078 1078 TLS1_TXT_RSA_WITH_NULL_SHA256,
1079 1079 TLS1_CK_RSA_WITH_NULL_SHA256,
1080 1080 SSL_kRSA,
1081 1081 SSL_aRSA,
1082 1082 SSL_eNULL,
1083 1083 SSL_SHA256,
1084 1084 SSL_TLSV1_2,
1085 1085 SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
1086 1086 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1087 1087 0,
1088 1088 0,
1089 1089 },
1090 1090
1091 1091 /* Cipher 3C */
1092 1092 {
1093 1093 1,
1094 1094 TLS1_TXT_RSA_WITH_AES_128_SHA256,
1095 1095 TLS1_CK_RSA_WITH_AES_128_SHA256,
1096 1096 SSL_kRSA,
1097 1097 SSL_aRSA,
1098 1098 SSL_AES128,
1099 1099 SSL_SHA256,
1100 1100 SSL_TLSV1_2,
1101 1101 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1102 1102 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1103 1103 128,
1104 1104 128,
1105 1105 },
1106 1106
1107 1107 /* Cipher 3D */
1108 1108 {
1109 1109 1,
1110 1110 TLS1_TXT_RSA_WITH_AES_256_SHA256,
1111 1111 TLS1_CK_RSA_WITH_AES_256_SHA256,
1112 1112 SSL_kRSA,
1113 1113 SSL_aRSA,
1114 1114 SSL_AES256,
1115 1115 SSL_SHA256,
1116 1116 SSL_TLSV1_2,
1117 1117 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1118 1118 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1119 1119 256,
1120 1120 256,
1121 1121 },
1122 1122
1123 1123 /* Cipher 3E */
1124 1124 {
1125 1125 0, /* not implemented (non-ephemeral DH) */
1126 1126 TLS1_TXT_DH_DSS_WITH_AES_128_SHA256,
1127 1127 TLS1_CK_DH_DSS_WITH_AES_128_SHA256,
1128 1128 SSL_kDHd,
1129 1129 SSL_aDH,
1130 1130 SSL_AES128,
1131 1131 SSL_SHA256,
1132 1132 SSL_TLSV1_2,
1133 1133 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1134 1134 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1135 1135 128,
1136 1136 128,
1137 1137 },
1138 1138
1139 1139 /* Cipher 3F */
1140 1140 {
1141 1141 0, /* not implemented (non-ephemeral DH) */
1142 1142 TLS1_TXT_DH_RSA_WITH_AES_128_SHA256,
1143 1143 TLS1_CK_DH_RSA_WITH_AES_128_SHA256,
1144 1144 SSL_kDHr,
1145 1145 SSL_aDH,
1146 1146 SSL_AES128,
1147 1147 SSL_SHA256,
1148 1148 SSL_TLSV1_2,
1149 1149 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1150 1150 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1151 1151 128,
1152 1152 128,
1153 1153 },
1154 1154
1155 1155 /* Cipher 40 */
1156 1156 {
1157 1157 1,
1158 1158 TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256,
1159 1159 TLS1_CK_DHE_DSS_WITH_AES_128_SHA256,
1160 1160 SSL_kEDH,
1161 1161 SSL_aDSS,
1162 1162 SSL_AES128,
1163 1163 SSL_SHA256,
1164 1164 SSL_TLSV1_2,
1165 1165 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1166 1166 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1167 1167 128,
1168 1168 128,
1169 1169 },
1170 1170
1171 1171 #ifndef OPENSSL_NO_CAMELLIA
1172 1172 /* Camellia ciphersuites from RFC4132 (128-bit portion) */
1173 1173
1174 1174 /* Cipher 41 */
1175 1175 {
1176 1176 1,
1177 1177 TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA,
1178 1178 TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA,
1179 1179 SSL_kRSA,
1180 1180 SSL_aRSA,
1181 1181 SSL_CAMELLIA128,
1182 1182 SSL_SHA1,
1183 1183 SSL_TLSV1,
1184 1184 SSL_NOT_EXP|SSL_HIGH,
1185 1185 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1186 1186 128,
1187 1187 128,
1188 1188 },
1189 1189
1190 1190 /* Cipher 42 */
1191 1191 {
1192 1192 0, /* not implemented (non-ephemeral DH) */
1193 1193 TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA,
1194 1194 TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA,
1195 1195 SSL_kDHd,
1196 1196 SSL_aDH,
1197 1197 SSL_CAMELLIA128,
1198 1198 SSL_SHA1,
1199 1199 SSL_TLSV1,
1200 1200 SSL_NOT_EXP|SSL_HIGH,
1201 1201 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1202 1202 128,
1203 1203 128,
1204 1204 },
1205 1205
1206 1206 /* Cipher 43 */
1207 1207 {
1208 1208 0, /* not implemented (non-ephemeral DH) */
1209 1209 TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA,
1210 1210 TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA,
1211 1211 SSL_kDHr,
1212 1212 SSL_aDH,
1213 1213 SSL_CAMELLIA128,
1214 1214 SSL_SHA1,
1215 1215 SSL_TLSV1,
1216 1216 SSL_NOT_EXP|SSL_HIGH,
1217 1217 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1218 1218 128,
1219 1219 128,
1220 1220 },
1221 1221
1222 1222 /* Cipher 44 */
1223 1223 {
1224 1224 1,
1225 1225 TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
1226 1226 TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
1227 1227 SSL_kEDH,
1228 1228 SSL_aDSS,
1229 1229 SSL_CAMELLIA128,
1230 1230 SSL_SHA1,
1231 1231 SSL_TLSV1,
1232 1232 SSL_NOT_EXP|SSL_HIGH,
1233 1233 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1234 1234 128,
1235 1235 128,
1236 1236 },
1237 1237
1238 1238 /* Cipher 45 */
1239 1239 {
1240 1240 1,
1241 1241 TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
1242 1242 TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
1243 1243 SSL_kEDH,
1244 1244 SSL_aRSA,
1245 1245 SSL_CAMELLIA128,
1246 1246 SSL_SHA1,
1247 1247 SSL_TLSV1,
1248 1248 SSL_NOT_EXP|SSL_HIGH,
1249 1249 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1250 1250 128,
1251 1251 128,
1252 1252 },
1253 1253
1254 1254 /* Cipher 46 */
1255 1255 {
1256 1256 1,
1257 1257 TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA,
1258 1258 TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA,
1259 1259 SSL_kEDH,
1260 1260 SSL_aNULL,
1261 1261 SSL_CAMELLIA128,
1262 1262 SSL_SHA1,
1263 1263 SSL_TLSV1,
1264 1264 SSL_NOT_EXP|SSL_HIGH,
1265 1265 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1266 1266 128,
1267 1267 128,
1268 1268 },
1269 1269 #endif /* OPENSSL_NO_CAMELLIA */
1270 1270
1271 1271 #if TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES
1272 1272 /* New TLS Export CipherSuites from expired ID */
1273 1273 #if 0
1274 1274 /* Cipher 60 */
1275 1275 {
1276 1276 1,
1277 1277 TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5,
1278 1278 TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5,
1279 1279 SSL_kRSA,
1280 1280 SSL_aRSA,
1281 1281 SSL_RC4,
1282 1282 SSL_MD5,
1283 1283 SSL_TLSV1,
1284 1284 SSL_EXPORT|SSL_EXP56,
1285 1285 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1286 1286 56,
1287 1287 128,
1288 1288 },
1289 1289
1290 1290 /* Cipher 61 */
1291 1291 {
1292 1292 1,
1293 1293 TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5,
1294 1294 TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5,
1295 1295 SSL_kRSA,
1296 1296 SSL_aRSA,
1297 1297 SSL_RC2,
1298 1298 SSL_MD5,
1299 1299 SSL_TLSV1,
1300 1300 SSL_EXPORT|SSL_EXP56,
1301 1301 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1302 1302 56,
1303 1303 128,
1304 1304 },
1305 1305 #endif
1306 1306
1307 1307 /* Cipher 62 */
1308 1308 {
1309 1309 1,
1310 1310 TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA,
1311 1311 TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA,
1312 1312 SSL_kRSA,
1313 1313 SSL_aRSA,
1314 1314 SSL_DES,
1315 1315 SSL_SHA1,
1316 1316 SSL_TLSV1,
1317 1317 SSL_EXPORT|SSL_EXP56,
1318 1318 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1319 1319 56,
1320 1320 56,
1321 1321 },
1322 1322
1323 1323 /* Cipher 63 */
1324 1324 {
1325 1325 1,
1326 1326 TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA,
1327 1327 TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA,
1328 1328 SSL_kEDH,
1329 1329 SSL_aDSS,
1330 1330 SSL_DES,
1331 1331 SSL_SHA1,
1332 1332 SSL_TLSV1,
1333 1333 SSL_EXPORT|SSL_EXP56,
1334 1334 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1335 1335 56,
1336 1336 56,
1337 1337 },
1338 1338
1339 1339 /* Cipher 64 */
1340 1340 {
1341 1341 1,
1342 1342 TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA,
1343 1343 TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA,
1344 1344 SSL_kRSA,
1345 1345 SSL_aRSA,
1346 1346 SSL_RC4,
1347 1347 SSL_SHA1,
1348 1348 SSL_TLSV1,
1349 1349 SSL_EXPORT|SSL_EXP56,
1350 1350 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1351 1351 56,
1352 1352 128,
1353 1353 },
1354 1354
1355 1355 /* Cipher 65 */
1356 1356 {
1357 1357 1,
1358 1358 TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA,
1359 1359 TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA,
1360 1360 SSL_kEDH,
1361 1361 SSL_aDSS,
1362 1362 SSL_RC4,
1363 1363 SSL_SHA1,
1364 1364 SSL_TLSV1,
1365 1365 SSL_EXPORT|SSL_EXP56,
1366 1366 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1367 1367 56,
1368 1368 128,
1369 1369 },
1370 1370
1371 1371 /* Cipher 66 */
1372 1372 {
1373 1373 1,
1374 1374 TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA,
1375 1375 TLS1_CK_DHE_DSS_WITH_RC4_128_SHA,
1376 1376 SSL_kEDH,
1377 1377 SSL_aDSS,
1378 1378 SSL_RC4,
1379 1379 SSL_SHA1,
1380 1380 SSL_TLSV1,
1381 1381 SSL_NOT_EXP|SSL_MEDIUM,
1382 1382 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1383 1383 128,
1384 1384 128,
1385 1385 },
1386 1386 #endif
1387 1387
1388 1388 /* TLS v1.2 ciphersuites */
1389 1389 /* Cipher 67 */
1390 1390 {
1391 1391 1,
1392 1392 TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256,
1393 1393 TLS1_CK_DHE_RSA_WITH_AES_128_SHA256,
1394 1394 SSL_kEDH,
1395 1395 SSL_aRSA,
1396 1396 SSL_AES128,
1397 1397 SSL_SHA256,
1398 1398 SSL_TLSV1_2,
1399 1399 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1400 1400 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1401 1401 128,
1402 1402 128,
1403 1403 },
1404 1404
1405 1405 /* Cipher 68 */
1406 1406 {
1407 1407 0, /* not implemented (non-ephemeral DH) */
1408 1408 TLS1_TXT_DH_DSS_WITH_AES_256_SHA256,
1409 1409 TLS1_CK_DH_DSS_WITH_AES_256_SHA256,
1410 1410 SSL_kDHd,
1411 1411 SSL_aDH,
1412 1412 SSL_AES256,
1413 1413 SSL_SHA256,
1414 1414 SSL_TLSV1_2,
1415 1415 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1416 1416 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1417 1417 256,
1418 1418 256,
1419 1419 },
1420 1420
1421 1421 /* Cipher 69 */
1422 1422 {
1423 1423 0, /* not implemented (non-ephemeral DH) */
1424 1424 TLS1_TXT_DH_RSA_WITH_AES_256_SHA256,
1425 1425 TLS1_CK_DH_RSA_WITH_AES_256_SHA256,
1426 1426 SSL_kDHr,
1427 1427 SSL_aDH,
1428 1428 SSL_AES256,
1429 1429 SSL_SHA256,
1430 1430 SSL_TLSV1_2,
1431 1431 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1432 1432 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1433 1433 256,
1434 1434 256,
1435 1435 },
1436 1436
1437 1437 /* Cipher 6A */
1438 1438 {
1439 1439 1,
1440 1440 TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256,
1441 1441 TLS1_CK_DHE_DSS_WITH_AES_256_SHA256,
1442 1442 SSL_kEDH,
1443 1443 SSL_aDSS,
1444 1444 SSL_AES256,
1445 1445 SSL_SHA256,
1446 1446 SSL_TLSV1_2,
1447 1447 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1448 1448 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1449 1449 256,
1450 1450 256,
1451 1451 },
1452 1452
1453 1453 /* Cipher 6B */
1454 1454 {
1455 1455 1,
1456 1456 TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256,
1457 1457 TLS1_CK_DHE_RSA_WITH_AES_256_SHA256,
1458 1458 SSL_kEDH,
1459 1459 SSL_aRSA,
1460 1460 SSL_AES256,
1461 1461 SSL_SHA256,
1462 1462 SSL_TLSV1_2,
1463 1463 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1464 1464 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1465 1465 256,
1466 1466 256,
1467 1467 },
1468 1468
1469 1469 /* Cipher 6C */
1470 1470 {
1471 1471 1,
1472 1472 TLS1_TXT_ADH_WITH_AES_128_SHA256,
1473 1473 TLS1_CK_ADH_WITH_AES_128_SHA256,
1474 1474 SSL_kEDH,
1475 1475 SSL_aNULL,
1476 1476 SSL_AES128,
1477 1477 SSL_SHA256,
1478 1478 SSL_TLSV1_2,
1479 1479 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1480 1480 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1481 1481 128,
1482 1482 128,
1483 1483 },
1484 1484
1485 1485 /* Cipher 6D */
1486 1486 {
1487 1487 1,
1488 1488 TLS1_TXT_ADH_WITH_AES_256_SHA256,
1489 1489 TLS1_CK_ADH_WITH_AES_256_SHA256,
1490 1490 SSL_kEDH,
1491 1491 SSL_aNULL,
1492 1492 SSL_AES256,
1493 1493 SSL_SHA256,
1494 1494 SSL_TLSV1_2,
1495 1495 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1496 1496 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1497 1497 256,
1498 1498 256,
1499 1499 },
1500 1500
1501 1501 /* GOST Ciphersuites */
1502 1502
1503 1503 {
1504 1504 1,
1505 1505 "GOST94-GOST89-GOST89",
1506 1506 0x3000080,
1507 1507 SSL_kGOST,
1508 1508 SSL_aGOST94,
1509 1509 SSL_eGOST2814789CNT,
1510 1510 SSL_GOST89MAC,
1511 1511 SSL_TLSV1,
1512 1512 SSL_NOT_EXP|SSL_HIGH,
1513 1513 SSL_HANDSHAKE_MAC_GOST94|TLS1_PRF_GOST94|TLS1_STREAM_MAC,
1514 1514 256,
1515 1515 256
1516 1516 },
1517 1517 {
1518 1518 1,
1519 1519 "GOST2001-GOST89-GOST89",
1520 1520 0x3000081,
1521 1521 SSL_kGOST,
1522 1522 SSL_aGOST01,
1523 1523 SSL_eGOST2814789CNT,
1524 1524 SSL_GOST89MAC,
1525 1525 SSL_TLSV1,
1526 1526 SSL_NOT_EXP|SSL_HIGH,
1527 1527 SSL_HANDSHAKE_MAC_GOST94|TLS1_PRF_GOST94|TLS1_STREAM_MAC,
1528 1528 256,
1529 1529 256
1530 1530 },
1531 1531 {
1532 1532 1,
1533 1533 "GOST94-NULL-GOST94",
1534 1534 0x3000082,
1535 1535 SSL_kGOST,
1536 1536 SSL_aGOST94,
1537 1537 SSL_eNULL,
1538 1538 SSL_GOST94,
1539 1539 SSL_TLSV1,
1540 1540 SSL_NOT_EXP|SSL_STRONG_NONE,
1541 1541 SSL_HANDSHAKE_MAC_GOST94|TLS1_PRF_GOST94,
1542 1542 0,
1543 1543 0
1544 1544 },
1545 1545 {
1546 1546 1,
1547 1547 "GOST2001-NULL-GOST94",
1548 1548 0x3000083,
1549 1549 SSL_kGOST,
1550 1550 SSL_aGOST01,
1551 1551 SSL_eNULL,
1552 1552 SSL_GOST94,
1553 1553 SSL_TLSV1,
1554 1554 SSL_NOT_EXP|SSL_STRONG_NONE,
1555 1555 SSL_HANDSHAKE_MAC_GOST94|TLS1_PRF_GOST94,
1556 1556 0,
1557 1557 0
1558 1558 },
1559 1559
1560 1560 #ifndef OPENSSL_NO_CAMELLIA
1561 1561 /* Camellia ciphersuites from RFC4132 (256-bit portion) */
1562 1562
1563 1563 /* Cipher 84 */
1564 1564 {
1565 1565 1,
1566 1566 TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA,
1567 1567 TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA,
1568 1568 SSL_kRSA,
1569 1569 SSL_aRSA,
1570 1570 SSL_CAMELLIA256,
1571 1571 SSL_SHA1,
1572 1572 SSL_TLSV1,
1573 1573 SSL_NOT_EXP|SSL_HIGH,
1574 1574 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1575 1575 256,
1576 1576 256,
1577 1577 },
1578 1578 /* Cipher 85 */
1579 1579 {
1580 1580 0, /* not implemented (non-ephemeral DH) */
1581 1581 TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA,
1582 1582 TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA,
1583 1583 SSL_kDHd,
1584 1584 SSL_aDH,
1585 1585 SSL_CAMELLIA256,
1586 1586 SSL_SHA1,
1587 1587 SSL_TLSV1,
1588 1588 SSL_NOT_EXP|SSL_HIGH,
1589 1589 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1590 1590 256,
1591 1591 256,
1592 1592 },
1593 1593
1594 1594 /* Cipher 86 */
1595 1595 {
1596 1596 0, /* not implemented (non-ephemeral DH) */
1597 1597 TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA,
1598 1598 TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA,
1599 1599 SSL_kDHr,
1600 1600 SSL_aDH,
1601 1601 SSL_CAMELLIA256,
1602 1602 SSL_SHA1,
1603 1603 SSL_TLSV1,
1604 1604 SSL_NOT_EXP|SSL_HIGH,
1605 1605 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1606 1606 256,
1607 1607 256,
1608 1608 },
1609 1609
1610 1610 /* Cipher 87 */
1611 1611 {
1612 1612 1,
1613 1613 TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
1614 1614 TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
1615 1615 SSL_kEDH,
1616 1616 SSL_aDSS,
1617 1617 SSL_CAMELLIA256,
1618 1618 SSL_SHA1,
1619 1619 SSL_TLSV1,
1620 1620 SSL_NOT_EXP|SSL_HIGH,
1621 1621 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1622 1622 256,
1623 1623 256,
1624 1624 },
1625 1625
1626 1626 /* Cipher 88 */
1627 1627 {
1628 1628 1,
1629 1629 TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
1630 1630 TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
1631 1631 SSL_kEDH,
1632 1632 SSL_aRSA,
1633 1633 SSL_CAMELLIA256,
1634 1634 SSL_SHA1,
1635 1635 SSL_TLSV1,
1636 1636 SSL_NOT_EXP|SSL_HIGH,
1637 1637 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1638 1638 256,
1639 1639 256,
1640 1640 },
1641 1641
1642 1642 /* Cipher 89 */
1643 1643 {
1644 1644 1,
1645 1645 TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA,
1646 1646 TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA,
1647 1647 SSL_kEDH,
1648 1648 SSL_aNULL,
1649 1649 SSL_CAMELLIA256,
1650 1650 SSL_SHA1,
1651 1651 SSL_TLSV1,
1652 1652 SSL_NOT_EXP|SSL_HIGH,
1653 1653 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1654 1654 256,
1655 1655 256,
1656 1656 },
1657 1657 #endif /* OPENSSL_NO_CAMELLIA */
1658 1658
1659 1659 #ifndef OPENSSL_NO_PSK
1660 1660 /* Cipher 8A */
1661 1661 {
1662 1662 1,
1663 1663 TLS1_TXT_PSK_WITH_RC4_128_SHA,
1664 1664 TLS1_CK_PSK_WITH_RC4_128_SHA,
1665 1665 SSL_kPSK,
1666 1666 SSL_aPSK,
1667 1667 SSL_RC4,
1668 1668 SSL_SHA1,
1669 1669 SSL_TLSV1,
1670 1670 SSL_NOT_EXP|SSL_MEDIUM,
1671 1671 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1672 1672 128,
1673 1673 128,
1674 1674 },
1675 1675
1676 1676 /* Cipher 8B */
1677 1677 {
1678 1678 1,
1679 1679 TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA,
1680 1680 TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA,
1681 1681 SSL_kPSK,
1682 1682 SSL_aPSK,
1683 1683 SSL_3DES,
1684 1684 SSL_SHA1,
1685 1685 SSL_TLSV1,
1686 1686 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1687 1687 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1688 1688 112,
1689 1689 168,
1690 1690 },
1691 1691
1692 1692 /* Cipher 8C */
1693 1693 {
1694 1694 1,
1695 1695 TLS1_TXT_PSK_WITH_AES_128_CBC_SHA,
1696 1696 TLS1_CK_PSK_WITH_AES_128_CBC_SHA,
1697 1697 SSL_kPSK,
1698 1698 SSL_aPSK,
1699 1699 SSL_AES128,
1700 1700 SSL_SHA1,
1701 1701 SSL_TLSV1,
1702 1702 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1703 1703 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1704 1704 128,
1705 1705 128,
1706 1706 },
1707 1707
1708 1708 /* Cipher 8D */
1709 1709 {
1710 1710 1,
1711 1711 TLS1_TXT_PSK_WITH_AES_256_CBC_SHA,
1712 1712 TLS1_CK_PSK_WITH_AES_256_CBC_SHA,
1713 1713 SSL_kPSK,
1714 1714 SSL_aPSK,
1715 1715 SSL_AES256,
1716 1716 SSL_SHA1,
1717 1717 SSL_TLSV1,
1718 1718 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1719 1719 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1720 1720 256,
1721 1721 256,
1722 1722 },
1723 1723 #endif /* OPENSSL_NO_PSK */
1724 1724
1725 1725 #ifndef OPENSSL_NO_SEED
1726 1726 /* SEED ciphersuites from RFC4162 */
1727 1727
1728 1728 /* Cipher 96 */
1729 1729 {
1730 1730 1,
1731 1731 TLS1_TXT_RSA_WITH_SEED_SHA,
1732 1732 TLS1_CK_RSA_WITH_SEED_SHA,
1733 1733 SSL_kRSA,
1734 1734 SSL_aRSA,
1735 1735 SSL_SEED,
1736 1736 SSL_SHA1,
1737 1737 SSL_TLSV1,
1738 1738 SSL_NOT_EXP|SSL_MEDIUM,
1739 1739 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1740 1740 128,
1741 1741 128,
1742 1742 },
1743 1743
1744 1744 /* Cipher 97 */
1745 1745 {
1746 1746 0, /* not implemented (non-ephemeral DH) */
1747 1747 TLS1_TXT_DH_DSS_WITH_SEED_SHA,
1748 1748 TLS1_CK_DH_DSS_WITH_SEED_SHA,
1749 1749 SSL_kDHd,
1750 1750 SSL_aDH,
1751 1751 SSL_SEED,
1752 1752 SSL_SHA1,
1753 1753 SSL_TLSV1,
1754 1754 SSL_NOT_EXP|SSL_MEDIUM,
1755 1755 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1756 1756 128,
1757 1757 128,
1758 1758 },
1759 1759
1760 1760 /* Cipher 98 */
1761 1761 {
1762 1762 0, /* not implemented (non-ephemeral DH) */
1763 1763 TLS1_TXT_DH_RSA_WITH_SEED_SHA,
1764 1764 TLS1_CK_DH_RSA_WITH_SEED_SHA,
1765 1765 SSL_kDHr,
1766 1766 SSL_aDH,
1767 1767 SSL_SEED,
1768 1768 SSL_SHA1,
1769 1769 SSL_TLSV1,
1770 1770 SSL_NOT_EXP|SSL_MEDIUM,
1771 1771 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1772 1772 128,
1773 1773 128,
1774 1774 },
1775 1775
1776 1776 /* Cipher 99 */
1777 1777 {
1778 1778 1,
1779 1779 TLS1_TXT_DHE_DSS_WITH_SEED_SHA,
1780 1780 TLS1_CK_DHE_DSS_WITH_SEED_SHA,
1781 1781 SSL_kEDH,
1782 1782 SSL_aDSS,
1783 1783 SSL_SEED,
1784 1784 SSL_SHA1,
1785 1785 SSL_TLSV1,
1786 1786 SSL_NOT_EXP|SSL_MEDIUM,
1787 1787 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1788 1788 128,
1789 1789 128,
1790 1790 },
1791 1791
1792 1792 /* Cipher 9A */
1793 1793 {
1794 1794 1,
1795 1795 TLS1_TXT_DHE_RSA_WITH_SEED_SHA,
1796 1796 TLS1_CK_DHE_RSA_WITH_SEED_SHA,
1797 1797 SSL_kEDH,
1798 1798 SSL_aRSA,
1799 1799 SSL_SEED,
1800 1800 SSL_SHA1,
1801 1801 SSL_TLSV1,
1802 1802 SSL_NOT_EXP|SSL_MEDIUM,
1803 1803 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1804 1804 128,
1805 1805 128,
1806 1806 },
1807 1807
1808 1808 /* Cipher 9B */
1809 1809 {
1810 1810 1,
1811 1811 TLS1_TXT_ADH_WITH_SEED_SHA,
1812 1812 TLS1_CK_ADH_WITH_SEED_SHA,
1813 1813 SSL_kEDH,
1814 1814 SSL_aNULL,
1815 1815 SSL_SEED,
1816 1816 SSL_SHA1,
1817 1817 SSL_TLSV1,
1818 1818 SSL_NOT_EXP|SSL_MEDIUM,
1819 1819 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
1820 1820 128,
1821 1821 128,
1822 1822 },
1823 1823
1824 1824 #endif /* OPENSSL_NO_SEED */
1825 1825
1826 1826 /* GCM ciphersuites from RFC5288 */
1827 1827
1828 1828 /* Cipher 9C */
1829 1829 {
1830 1830 1,
1831 1831 TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256,
1832 1832 TLS1_CK_RSA_WITH_AES_128_GCM_SHA256,
1833 1833 SSL_kRSA,
1834 1834 SSL_aRSA,
1835 1835 SSL_AES128GCM,
1836 1836 SSL_AEAD,
1837 1837 SSL_TLSV1_2,
1838 1838 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1839 1839 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
1840 1840 128,
1841 1841 128,
1842 1842 },
1843 1843
1844 1844 /* Cipher 9D */
1845 1845 {
1846 1846 1,
1847 1847 TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384,
1848 1848 TLS1_CK_RSA_WITH_AES_256_GCM_SHA384,
1849 1849 SSL_kRSA,
1850 1850 SSL_aRSA,
1851 1851 SSL_AES256GCM,
1852 1852 SSL_AEAD,
1853 1853 SSL_TLSV1_2,
1854 1854 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1855 1855 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
1856 1856 256,
1857 1857 256,
1858 1858 },
1859 1859
1860 1860 /* Cipher 9E */
1861 1861 {
1862 1862 1,
1863 1863 TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256,
1864 1864 TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256,
1865 1865 SSL_kEDH,
1866 1866 SSL_aRSA,
1867 1867 SSL_AES128GCM,
1868 1868 SSL_AEAD,
1869 1869 SSL_TLSV1_2,
1870 1870 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1871 1871 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
1872 1872 128,
1873 1873 128,
1874 1874 },
1875 1875
1876 1876 /* Cipher 9F */
1877 1877 {
1878 1878 1,
1879 1879 TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384,
1880 1880 TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384,
1881 1881 SSL_kEDH,
1882 1882 SSL_aRSA,
1883 1883 SSL_AES256GCM,
1884 1884 SSL_AEAD,
1885 1885 SSL_TLSV1_2,
1886 1886 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1887 1887 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
1888 1888 256,
1889 1889 256,
1890 1890 },
1891 1891
1892 1892 /* Cipher A0 */
1893 1893 {
1894 1894 0,
1895 1895 TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256,
1896 1896 TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256,
1897 1897 SSL_kDHr,
1898 1898 SSL_aDH,
1899 1899 SSL_AES128GCM,
1900 1900 SSL_AEAD,
1901 1901 SSL_TLSV1_2,
1902 1902 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1903 1903 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
1904 1904 128,
1905 1905 128,
1906 1906 },
1907 1907
1908 1908 /* Cipher A1 */
1909 1909 {
1910 1910 0,
1911 1911 TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384,
1912 1912 TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384,
1913 1913 SSL_kDHr,
1914 1914 SSL_aDH,
1915 1915 SSL_AES256GCM,
1916 1916 SSL_AEAD,
1917 1917 SSL_TLSV1_2,
1918 1918 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1919 1919 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
1920 1920 256,
1921 1921 256,
1922 1922 },
1923 1923
1924 1924 /* Cipher A2 */
1925 1925 {
1926 1926 1,
1927 1927 TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256,
1928 1928 TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256,
1929 1929 SSL_kEDH,
1930 1930 SSL_aDSS,
1931 1931 SSL_AES128GCM,
1932 1932 SSL_AEAD,
1933 1933 SSL_TLSV1_2,
1934 1934 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1935 1935 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
1936 1936 128,
1937 1937 128,
1938 1938 },
1939 1939
1940 1940 /* Cipher A3 */
1941 1941 {
1942 1942 1,
1943 1943 TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384,
1944 1944 TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384,
1945 1945 SSL_kEDH,
1946 1946 SSL_aDSS,
1947 1947 SSL_AES256GCM,
1948 1948 SSL_AEAD,
1949 1949 SSL_TLSV1_2,
1950 1950 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1951 1951 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
1952 1952 256,
1953 1953 256,
1954 1954 },
1955 1955
1956 1956 /* Cipher A4 */
1957 1957 {
1958 1958 0,
1959 1959 TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256,
1960 1960 TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256,
1961 1961 SSL_kDHd,
1962 1962 SSL_aDH,
1963 1963 SSL_AES128GCM,
1964 1964 SSL_AEAD,
1965 1965 SSL_TLSV1_2,
1966 1966 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1967 1967 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
1968 1968 128,
1969 1969 128,
1970 1970 },
1971 1971
1972 1972 /* Cipher A5 */
1973 1973 {
1974 1974 0,
1975 1975 TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384,
1976 1976 TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384,
1977 1977 SSL_kDHd,
1978 1978 SSL_aDH,
1979 1979 SSL_AES256GCM,
1980 1980 SSL_AEAD,
1981 1981 SSL_TLSV1_2,
1982 1982 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1983 1983 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
1984 1984 256,
1985 1985 256,
1986 1986 },
1987 1987
1988 1988 /* Cipher A6 */
1989 1989 {
1990 1990 1,
1991 1991 TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256,
1992 1992 TLS1_CK_ADH_WITH_AES_128_GCM_SHA256,
1993 1993 SSL_kEDH,
1994 1994 SSL_aNULL,
1995 1995 SSL_AES128GCM,
1996 1996 SSL_AEAD,
1997 1997 SSL_TLSV1_2,
1998 1998 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
1999 1999 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
2000 2000 128,
2001 2001 128,
2002 2002 },
2003 2003
2004 2004 /* Cipher A7 */
2005 2005 {
2006 2006 1,
2007 2007 TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384,
2008 2008 TLS1_CK_ADH_WITH_AES_256_GCM_SHA384,
2009 2009 SSL_kEDH,
2010 2010 SSL_aNULL,
2011 2011 SSL_AES256GCM,
2012 2012 SSL_AEAD,
2013 2013 SSL_TLSV1_2,
2014 2014 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2015 2015 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
2016 2016 256,
2017 2017 256,
2018 2018 },
2019 2019
2020 2020 #ifndef OPENSSL_NO_ECDH
2021 2021 /* Cipher C001 */
2022 2022 {
2023 2023 1,
2024 2024 TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA,
2025 2025 TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA,
2026 2026 SSL_kECDHe,
2027 2027 SSL_aECDH,
2028 2028 SSL_eNULL,
2029 2029 SSL_SHA1,
2030 2030 SSL_TLSV1,
2031 2031 SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
2032 2032 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2033 2033 0,
2034 2034 0,
2035 2035 },
2036 2036
2037 2037 /* Cipher C002 */
2038 2038 {
2039 2039 1,
2040 2040 TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA,
2041 2041 TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA,
2042 2042 SSL_kECDHe,
2043 2043 SSL_aECDH,
2044 2044 SSL_RC4,
2045 2045 SSL_SHA1,
2046 2046 SSL_TLSV1,
2047 2047 SSL_NOT_EXP|SSL_MEDIUM,
2048 2048 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2049 2049 128,
2050 2050 128,
2051 2051 },
2052 2052
2053 2053 /* Cipher C003 */
2054 2054 {
2055 2055 1,
2056 2056 TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA,
2057 2057 TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA,
2058 2058 SSL_kECDHe,
2059 2059 SSL_aECDH,
2060 2060 SSL_3DES,
2061 2061 SSL_SHA1,
2062 2062 SSL_TLSV1,
2063 2063 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2064 2064 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2065 2065 112,
2066 2066 168,
2067 2067 },
2068 2068
2069 2069 /* Cipher C004 */
2070 2070 {
2071 2071 1,
2072 2072 TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
2073 2073 TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
2074 2074 SSL_kECDHe,
2075 2075 SSL_aECDH,
2076 2076 SSL_AES128,
2077 2077 SSL_SHA1,
2078 2078 SSL_TLSV1,
2079 2079 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2080 2080 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2081 2081 128,
2082 2082 128,
2083 2083 },
2084 2084
2085 2085 /* Cipher C005 */
2086 2086 {
2087 2087 1,
2088 2088 TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
2089 2089 TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
2090 2090 SSL_kECDHe,
2091 2091 SSL_aECDH,
2092 2092 SSL_AES256,
2093 2093 SSL_SHA1,
2094 2094 SSL_TLSV1,
2095 2095 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2096 2096 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2097 2097 256,
2098 2098 256,
2099 2099 },
2100 2100
2101 2101 /* Cipher C006 */
2102 2102 {
2103 2103 1,
2104 2104 TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA,
2105 2105 TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA,
2106 2106 SSL_kEECDH,
2107 2107 SSL_aECDSA,
2108 2108 SSL_eNULL,
2109 2109 SSL_SHA1,
2110 2110 SSL_TLSV1,
2111 2111 SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
2112 2112 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2113 2113 0,
2114 2114 0,
2115 2115 },
2116 2116
2117 2117 /* Cipher C007 */
2118 2118 {
2119 2119 1,
2120 2120 TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA,
2121 2121 TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA,
2122 2122 SSL_kEECDH,
2123 2123 SSL_aECDSA,
2124 2124 SSL_RC4,
2125 2125 SSL_SHA1,
2126 2126 SSL_TLSV1,
2127 2127 SSL_NOT_EXP|SSL_MEDIUM,
2128 2128 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2129 2129 128,
2130 2130 128,
2131 2131 },
2132 2132
2133 2133 /* Cipher C008 */
2134 2134 {
2135 2135 1,
2136 2136 TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
2137 2137 TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
2138 2138 SSL_kEECDH,
2139 2139 SSL_aECDSA,
2140 2140 SSL_3DES,
2141 2141 SSL_SHA1,
2142 2142 SSL_TLSV1,
2143 2143 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2144 2144 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2145 2145 112,
2146 2146 168,
2147 2147 },
2148 2148
2149 2149 /* Cipher C009 */
2150 2150 {
2151 2151 1,
2152 2152 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
2153 2153 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
2154 2154 SSL_kEECDH,
2155 2155 SSL_aECDSA,
2156 2156 SSL_AES128,
2157 2157 SSL_SHA1,
2158 2158 SSL_TLSV1,
2159 2159 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2160 2160 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2161 2161 128,
2162 2162 128,
2163 2163 },
2164 2164
2165 2165 /* Cipher C00A */
2166 2166 {
2167 2167 1,
2168 2168 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
2169 2169 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
2170 2170 SSL_kEECDH,
2171 2171 SSL_aECDSA,
2172 2172 SSL_AES256,
2173 2173 SSL_SHA1,
2174 2174 SSL_TLSV1,
2175 2175 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2176 2176 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2177 2177 256,
2178 2178 256,
2179 2179 },
2180 2180
2181 2181 /* Cipher C00B */
2182 2182 {
2183 2183 1,
2184 2184 TLS1_TXT_ECDH_RSA_WITH_NULL_SHA,
2185 2185 TLS1_CK_ECDH_RSA_WITH_NULL_SHA,
2186 2186 SSL_kECDHr,
2187 2187 SSL_aECDH,
2188 2188 SSL_eNULL,
2189 2189 SSL_SHA1,
2190 2190 SSL_TLSV1,
2191 2191 SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
2192 2192 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2193 2193 0,
2194 2194 0,
2195 2195 },
2196 2196
2197 2197 /* Cipher C00C */
2198 2198 {
2199 2199 1,
2200 2200 TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA,
2201 2201 TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA,
2202 2202 SSL_kECDHr,
2203 2203 SSL_aECDH,
2204 2204 SSL_RC4,
2205 2205 SSL_SHA1,
2206 2206 SSL_TLSV1,
2207 2207 SSL_NOT_EXP|SSL_MEDIUM,
2208 2208 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2209 2209 128,
2210 2210 128,
2211 2211 },
2212 2212
2213 2213 /* Cipher C00D */
2214 2214 {
2215 2215 1,
2216 2216 TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA,
2217 2217 TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA,
2218 2218 SSL_kECDHr,
2219 2219 SSL_aECDH,
2220 2220 SSL_3DES,
2221 2221 SSL_SHA1,
2222 2222 SSL_TLSV1,
2223 2223 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2224 2224 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2225 2225 112,
2226 2226 168,
2227 2227 },
2228 2228
2229 2229 /* Cipher C00E */
2230 2230 {
2231 2231 1,
2232 2232 TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA,
2233 2233 TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA,
2234 2234 SSL_kECDHr,
2235 2235 SSL_aECDH,
2236 2236 SSL_AES128,
2237 2237 SSL_SHA1,
2238 2238 SSL_TLSV1,
2239 2239 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2240 2240 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2241 2241 128,
2242 2242 128,
2243 2243 },
2244 2244
2245 2245 /* Cipher C00F */
2246 2246 {
2247 2247 1,
2248 2248 TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA,
2249 2249 TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA,
2250 2250 SSL_kECDHr,
2251 2251 SSL_aECDH,
2252 2252 SSL_AES256,
2253 2253 SSL_SHA1,
2254 2254 SSL_TLSV1,
2255 2255 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2256 2256 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2257 2257 256,
2258 2258 256,
2259 2259 },
2260 2260
2261 2261 /* Cipher C010 */
2262 2262 {
2263 2263 1,
2264 2264 TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA,
2265 2265 TLS1_CK_ECDHE_RSA_WITH_NULL_SHA,
2266 2266 SSL_kEECDH,
2267 2267 SSL_aRSA,
2268 2268 SSL_eNULL,
2269 2269 SSL_SHA1,
2270 2270 SSL_TLSV1,
2271 2271 SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
2272 2272 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2273 2273 0,
2274 2274 0,
2275 2275 },
2276 2276
2277 2277 /* Cipher C011 */
2278 2278 {
2279 2279 1,
2280 2280 TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA,
2281 2281 TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA,
2282 2282 SSL_kEECDH,
2283 2283 SSL_aRSA,
2284 2284 SSL_RC4,
2285 2285 SSL_SHA1,
2286 2286 SSL_TLSV1,
2287 2287 SSL_NOT_EXP|SSL_MEDIUM,
2288 2288 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2289 2289 128,
2290 2290 128,
2291 2291 },
2292 2292
2293 2293 /* Cipher C012 */
2294 2294 {
2295 2295 1,
2296 2296 TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
2297 2297 TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
2298 2298 SSL_kEECDH,
2299 2299 SSL_aRSA,
2300 2300 SSL_3DES,
2301 2301 SSL_SHA1,
2302 2302 SSL_TLSV1,
2303 2303 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2304 2304 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2305 2305 112,
2306 2306 168,
2307 2307 },
2308 2308
2309 2309 /* Cipher C013 */
2310 2310 {
2311 2311 1,
2312 2312 TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA,
2313 2313 TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA,
2314 2314 SSL_kEECDH,
2315 2315 SSL_aRSA,
2316 2316 SSL_AES128,
2317 2317 SSL_SHA1,
2318 2318 SSL_TLSV1,
2319 2319 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2320 2320 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2321 2321 128,
2322 2322 128,
2323 2323 },
2324 2324
2325 2325 /* Cipher C014 */
2326 2326 {
2327 2327 1,
2328 2328 TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA,
2329 2329 TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA,
2330 2330 SSL_kEECDH,
2331 2331 SSL_aRSA,
2332 2332 SSL_AES256,
2333 2333 SSL_SHA1,
2334 2334 SSL_TLSV1,
2335 2335 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2336 2336 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2337 2337 256,
2338 2338 256,
2339 2339 },
2340 2340
2341 2341 /* Cipher C015 */
2342 2342 {
2343 2343 1,
2344 2344 TLS1_TXT_ECDH_anon_WITH_NULL_SHA,
2345 2345 TLS1_CK_ECDH_anon_WITH_NULL_SHA,
2346 2346 SSL_kEECDH,
2347 2347 SSL_aNULL,
2348 2348 SSL_eNULL,
2349 2349 SSL_SHA1,
2350 2350 SSL_TLSV1,
2351 2351 SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
2352 2352 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2353 2353 0,
2354 2354 0,
2355 2355 },
2356 2356
2357 2357 /* Cipher C016 */
2358 2358 {
2359 2359 1,
2360 2360 TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA,
2361 2361 TLS1_CK_ECDH_anon_WITH_RC4_128_SHA,
2362 2362 SSL_kEECDH,
2363 2363 SSL_aNULL,
2364 2364 SSL_RC4,
2365 2365 SSL_SHA1,
2366 2366 SSL_TLSV1,
2367 2367 SSL_NOT_EXP|SSL_MEDIUM,
2368 2368 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2369 2369 128,
2370 2370 128,
2371 2371 },
2372 2372
2373 2373 /* Cipher C017 */
2374 2374 {
2375 2375 1,
2376 2376 TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA,
2377 2377 TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA,
2378 2378 SSL_kEECDH,
2379 2379 SSL_aNULL,
2380 2380 SSL_3DES,
2381 2381 SSL_SHA1,
2382 2382 SSL_TLSV1,
2383 2383 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2384 2384 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2385 2385 112,
2386 2386 168,
2387 2387 },
2388 2388
2389 2389 /* Cipher C018 */
2390 2390 {
2391 2391 1,
2392 2392 TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA,
2393 2393 TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA,
2394 2394 SSL_kEECDH,
2395 2395 SSL_aNULL,
2396 2396 SSL_AES128,
2397 2397 SSL_SHA1,
2398 2398 SSL_TLSV1,
2399 2399 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2400 2400 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2401 2401 128,
2402 2402 128,
2403 2403 },
2404 2404
2405 2405 /* Cipher C019 */
2406 2406 {
2407 2407 1,
2408 2408 TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA,
2409 2409 TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA,
2410 2410 SSL_kEECDH,
2411 2411 SSL_aNULL,
2412 2412 SSL_AES256,
2413 2413 SSL_SHA1,
2414 2414 SSL_TLSV1,
2415 2415 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2416 2416 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2417 2417 256,
2418 2418 256,
2419 2419 },
2420 2420 #endif /* OPENSSL_NO_ECDH */
2421 2421
2422 2422 #ifndef OPENSSL_NO_SRP
2423 2423 /* Cipher C01A */
2424 2424 {
2425 2425 1,
2426 2426 TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
2427 2427 TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
2428 2428 SSL_kSRP,
2429 2429 SSL_aSRP,
2430 2430 SSL_3DES,
2431 2431 SSL_SHA1,
2432 2432 SSL_TLSV1,
2433 2433 SSL_NOT_EXP|SSL_HIGH,
2434 2434 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2435 2435 112,
2436 2436 168,
2437 2437 },
2438 2438
2439 2439 /* Cipher C01B */
2440 2440 {
2441 2441 1,
2442 2442 TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
2443 2443 TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
2444 2444 SSL_kSRP,
2445 2445 SSL_aRSA,
2446 2446 SSL_3DES,
2447 2447 SSL_SHA1,
2448 2448 SSL_TLSV1,
2449 2449 SSL_NOT_EXP|SSL_HIGH,
2450 2450 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2451 2451 112,
2452 2452 168,
2453 2453 },
2454 2454
2455 2455 /* Cipher C01C */
2456 2456 {
2457 2457 1,
2458 2458 TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
2459 2459 TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
2460 2460 SSL_kSRP,
2461 2461 SSL_aDSS,
2462 2462 SSL_3DES,
2463 2463 SSL_SHA1,
2464 2464 SSL_TLSV1,
2465 2465 SSL_NOT_EXP|SSL_HIGH,
2466 2466 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2467 2467 112,
2468 2468 168,
2469 2469 },
2470 2470
2471 2471 /* Cipher C01D */
2472 2472 {
2473 2473 1,
2474 2474 TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA,
2475 2475 TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA,
2476 2476 SSL_kSRP,
2477 2477 SSL_aSRP,
2478 2478 SSL_AES128,
2479 2479 SSL_SHA1,
2480 2480 SSL_TLSV1,
2481 2481 SSL_NOT_EXP|SSL_HIGH,
2482 2482 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2483 2483 128,
2484 2484 128,
2485 2485 },
2486 2486
2487 2487 /* Cipher C01E */
2488 2488 {
2489 2489 1,
2490 2490 TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
2491 2491 TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
2492 2492 SSL_kSRP,
2493 2493 SSL_aRSA,
2494 2494 SSL_AES128,
2495 2495 SSL_SHA1,
2496 2496 SSL_TLSV1,
2497 2497 SSL_NOT_EXP|SSL_HIGH,
2498 2498 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2499 2499 128,
2500 2500 128,
2501 2501 },
2502 2502
2503 2503 /* Cipher C01F */
2504 2504 {
2505 2505 1,
2506 2506 TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
2507 2507 TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
2508 2508 SSL_kSRP,
2509 2509 SSL_aDSS,
2510 2510 SSL_AES128,
2511 2511 SSL_SHA1,
2512 2512 SSL_TLSV1,
2513 2513 SSL_NOT_EXP|SSL_HIGH,
2514 2514 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2515 2515 128,
2516 2516 128,
2517 2517 },
2518 2518
2519 2519 /* Cipher C020 */
2520 2520 {
2521 2521 1,
2522 2522 TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA,
2523 2523 TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA,
2524 2524 SSL_kSRP,
2525 2525 SSL_aSRP,
2526 2526 SSL_AES256,
2527 2527 SSL_SHA1,
2528 2528 SSL_TLSV1,
2529 2529 SSL_NOT_EXP|SSL_HIGH,
2530 2530 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2531 2531 256,
2532 2532 256,
2533 2533 },
2534 2534
2535 2535 /* Cipher C021 */
2536 2536 {
2537 2537 1,
2538 2538 TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
2539 2539 TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
2540 2540 SSL_kSRP,
2541 2541 SSL_aRSA,
2542 2542 SSL_AES256,
2543 2543 SSL_SHA1,
2544 2544 SSL_TLSV1,
2545 2545 SSL_NOT_EXP|SSL_HIGH,
2546 2546 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2547 2547 256,
2548 2548 256,
2549 2549 },
2550 2550
2551 2551 /* Cipher C022 */
2552 2552 {
2553 2553 1,
2554 2554 TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
2555 2555 TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
2556 2556 SSL_kSRP,
2557 2557 SSL_aDSS,
2558 2558 SSL_AES256,
2559 2559 SSL_SHA1,
2560 2560 SSL_TLSV1,
2561 2561 SSL_NOT_EXP|SSL_HIGH,
2562 2562 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2563 2563 256,
2564 2564 256,
2565 2565 },
2566 2566 #endif /* OPENSSL_NO_SRP */
2567 2567 #ifndef OPENSSL_NO_ECDH
2568 2568
2569 2569 /* HMAC based TLS v1.2 ciphersuites from RFC5289 */
2570 2570
2571 2571 /* Cipher C023 */
2572 2572 {
2573 2573 1,
2574 2574 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256,
2575 2575 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256,
2576 2576 SSL_kEECDH,
2577 2577 SSL_aECDSA,
2578 2578 SSL_AES128,
2579 2579 SSL_SHA256,
2580 2580 SSL_TLSV1_2,
2581 2581 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2582 2582 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
2583 2583 128,
2584 2584 128,
2585 2585 },
2586 2586
2587 2587 /* Cipher C024 */
2588 2588 {
2589 2589 1,
2590 2590 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384,
2591 2591 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384,
2592 2592 SSL_kEECDH,
2593 2593 SSL_aECDSA,
2594 2594 SSL_AES256,
2595 2595 SSL_SHA384,
2596 2596 SSL_TLSV1_2,
2597 2597 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2598 2598 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
2599 2599 256,
2600 2600 256,
2601 2601 },
2602 2602
2603 2603 /* Cipher C025 */
2604 2604 {
2605 2605 1,
2606 2606 TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256,
2607 2607 TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256,
2608 2608 SSL_kECDHe,
2609 2609 SSL_aECDH,
2610 2610 SSL_AES128,
2611 2611 SSL_SHA256,
2612 2612 SSL_TLSV1_2,
2613 2613 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2614 2614 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
2615 2615 128,
2616 2616 128,
2617 2617 },
2618 2618
2619 2619 /* Cipher C026 */
2620 2620 {
2621 2621 1,
2622 2622 TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384,
2623 2623 TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384,
2624 2624 SSL_kECDHe,
2625 2625 SSL_aECDH,
2626 2626 SSL_AES256,
2627 2627 SSL_SHA384,
2628 2628 SSL_TLSV1_2,
2629 2629 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2630 2630 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
2631 2631 256,
2632 2632 256,
2633 2633 },
2634 2634
2635 2635 /* Cipher C027 */
2636 2636 {
2637 2637 1,
2638 2638 TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256,
2639 2639 TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256,
2640 2640 SSL_kEECDH,
2641 2641 SSL_aRSA,
2642 2642 SSL_AES128,
2643 2643 SSL_SHA256,
2644 2644 SSL_TLSV1_2,
2645 2645 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2646 2646 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
2647 2647 128,
2648 2648 128,
2649 2649 },
2650 2650
2651 2651 /* Cipher C028 */
2652 2652 {
2653 2653 1,
2654 2654 TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384,
2655 2655 TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384,
2656 2656 SSL_kEECDH,
2657 2657 SSL_aRSA,
2658 2658 SSL_AES256,
2659 2659 SSL_SHA384,
2660 2660 SSL_TLSV1_2,
2661 2661 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2662 2662 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
2663 2663 256,
2664 2664 256,
2665 2665 },
2666 2666
2667 2667 /* Cipher C029 */
2668 2668 {
2669 2669 1,
2670 2670 TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256,
2671 2671 TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256,
2672 2672 SSL_kECDHr,
2673 2673 SSL_aECDH,
2674 2674 SSL_AES128,
2675 2675 SSL_SHA256,
2676 2676 SSL_TLSV1_2,
2677 2677 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2678 2678 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
2679 2679 128,
2680 2680 128,
2681 2681 },
2682 2682
2683 2683 /* Cipher C02A */
2684 2684 {
2685 2685 1,
2686 2686 TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384,
2687 2687 TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384,
2688 2688 SSL_kECDHr,
2689 2689 SSL_aECDH,
2690 2690 SSL_AES256,
2691 2691 SSL_SHA384,
2692 2692 SSL_TLSV1_2,
2693 2693 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2694 2694 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
2695 2695 256,
2696 2696 256,
2697 2697 },
2698 2698
2699 2699 /* GCM based TLS v1.2 ciphersuites from RFC5289 */
2700 2700
2701 2701 /* Cipher C02B */
2702 2702 {
2703 2703 1,
2704 2704 TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
2705 2705 TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
2706 2706 SSL_kEECDH,
2707 2707 SSL_aECDSA,
2708 2708 SSL_AES128GCM,
2709 2709 SSL_AEAD,
2710 2710 SSL_TLSV1_2,
2711 2711 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2712 2712 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
2713 2713 128,
2714 2714 128,
2715 2715 },
2716 2716
2717 2717 /* Cipher C02C */
2718 2718 {
2719 2719 1,
2720 2720 TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
2721 2721 TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
2722 2722 SSL_kEECDH,
2723 2723 SSL_aECDSA,
2724 2724 SSL_AES256GCM,
2725 2725 SSL_AEAD,
2726 2726 SSL_TLSV1_2,
2727 2727 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2728 2728 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
2729 2729 256,
2730 2730 256,
2731 2731 },
2732 2732
2733 2733 /* Cipher C02D */
2734 2734 {
2735 2735 1,
2736 2736 TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
2737 2737 TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
2738 2738 SSL_kECDHe,
2739 2739 SSL_aECDH,
2740 2740 SSL_AES128GCM,
2741 2741 SSL_AEAD,
2742 2742 SSL_TLSV1_2,
2743 2743 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2744 2744 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
2745 2745 128,
2746 2746 128,
2747 2747 },
2748 2748
2749 2749 /* Cipher C02E */
2750 2750 {
2751 2751 1,
2752 2752 TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,
2753 2753 TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,
2754 2754 SSL_kECDHe,
2755 2755 SSL_aECDH,
2756 2756 SSL_AES256GCM,
2757 2757 SSL_AEAD,
2758 2758 SSL_TLSV1_2,
2759 2759 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2760 2760 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
2761 2761 256,
2762 2762 256,
2763 2763 },
2764 2764
2765 2765 /* Cipher C02F */
2766 2766 {
2767 2767 1,
2768 2768 TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
2769 2769 TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
2770 2770 SSL_kEECDH,
2771 2771 SSL_aRSA,
2772 2772 SSL_AES128GCM,
2773 2773 SSL_AEAD,
2774 2774 SSL_TLSV1_2,
2775 2775 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2776 2776 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
2777 2777 128,
2778 2778 128,
2779 2779 },
2780 2780
2781 2781 /* Cipher C030 */
2782 2782 {
2783 2783 1,
2784 2784 TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
2785 2785 TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
2786 2786 SSL_kEECDH,
2787 2787 SSL_aRSA,
2788 2788 SSL_AES256GCM,
2789 2789 SSL_AEAD,
2790 2790 SSL_TLSV1_2,
2791 2791 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2792 2792 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
2793 2793 256,
2794 2794 256,
2795 2795 },
2796 2796
2797 2797 /* Cipher C031 */
2798 2798 {
2799 2799 1,
2800 2800 TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256,
2801 2801 TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256,
2802 2802 SSL_kECDHr,
2803 2803 SSL_aECDH,
2804 2804 SSL_AES128GCM,
2805 2805 SSL_AEAD,
2806 2806 SSL_TLSV1_2,
2807 2807 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2808 2808 SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
2809 2809 128,
2810 2810 128,
2811 2811 },
2812 2812
2813 2813 /* Cipher C032 */
2814 2814 {
2815 2815 1,
2816 2816 TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384,
2817 2817 TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384,
2818 2818 SSL_kECDHr,
2819 2819 SSL_aECDH,
2820 2820 SSL_AES256GCM,
2821 2821 SSL_AEAD,
2822 2822 SSL_TLSV1_2,
2823 2823 SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
2824 2824 SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
2825 2825 256,
2826 2826 256,
2827 2827 },
2828 2828
2829 2829 #endif /* OPENSSL_NO_ECDH */
2830 2830
2831 2831
2832 2832 #ifdef TEMP_GOST_TLS
2833 2833 /* Cipher FF00 */
2834 2834 {
2835 2835 1,
2836 2836 "GOST-MD5",
2837 2837 0x0300ff00,
2838 2838 SSL_kRSA,
2839 2839 SSL_aRSA,
2840 2840 SSL_eGOST2814789CNT,
2841 2841 SSL_MD5,
2842 2842 SSL_TLSV1,
2843 2843 SSL_NOT_EXP|SSL_HIGH,
2844 2844 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2845 2845 256,
2846 2846 256,
2847 2847 },
2848 2848 {
2849 2849 1,
2850 2850 "GOST-GOST94",
2851 2851 0x0300ff01,
2852 2852 SSL_kRSA,
2853 2853 SSL_aRSA,
2854 2854 SSL_eGOST2814789CNT,
2855 2855 SSL_GOST94,
2856 2856 SSL_TLSV1,
2857 2857 SSL_NOT_EXP|SSL_HIGH,
2858 2858 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2859 2859 256,
2860 2860 256
2861 2861 },
2862 2862 {
2863 2863 1,
2864 2864 "GOST-GOST89MAC",
2865 2865 0x0300ff02,
2866 2866 SSL_kRSA,
2867 2867 SSL_aRSA,
2868 2868 SSL_eGOST2814789CNT,
2869 2869 SSL_GOST89MAC,
2870 2870 SSL_TLSV1,
2871 2871 SSL_NOT_EXP|SSL_HIGH,
2872 2872 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
2873 2873 256,
2874 2874 256
2875 2875 },
2876 2876 {
2877 2877 1,
2878 2878 "GOST-GOST89STREAM",
2879 2879 0x0300ff03,
2880 2880 SSL_kRSA,
2881 2881 SSL_aRSA,
2882 2882 SSL_eGOST2814789CNT,
2883 2883 SSL_GOST89MAC,
2884 2884 SSL_TLSV1,
2885 2885 SSL_NOT_EXP|SSL_HIGH,
2886 2886 SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF|TLS1_STREAM_MAC,
2887 2887 256,
2888 2888 256
2889 2889 },
2890 2890 #endif
2891 2891
2892 2892 /* end of list */
2893 2893 };
2894 2894
2895 2895 SSL3_ENC_METHOD SSLv3_enc_data={
2896 2896 ssl3_enc,
2897 2897 n_ssl3_mac,
2898 2898 ssl3_setup_key_block,
2899 2899 ssl3_generate_master_secret,
2900 2900 ssl3_change_cipher_state,
2901 2901 ssl3_final_finish_mac,
2902 2902 MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH,
2903 2903 ssl3_cert_verify_mac,
2904 2904 SSL3_MD_CLIENT_FINISHED_CONST,4,
2905 2905 SSL3_MD_SERVER_FINISHED_CONST,4,
2906 2906 ssl3_alert_code,
2907 2907 (int (*)(SSL *, unsigned char *, size_t, const char *,
2908 2908 size_t, const unsigned char *, size_t,
2909 2909 int use_context))ssl_undefined_function,
2910 2910 };
2911 2911
2912 2912 long ssl3_default_timeout(void)
2913 2913 {
2914 2914 /* 2 hours, the 24 hours mentioned in the SSLv3 spec
2915 2915 * is way too long for http, the cache would over fill */
2916 2916 return(60*60*2);
2917 2917 }
2918 2918
2919 2919 int ssl3_num_ciphers(void)
2920 2920 {
2921 2921 return(SSL3_NUM_CIPHERS);
2922 2922 }
2923 2923
2924 2924 const SSL_CIPHER *ssl3_get_cipher(unsigned int u)
2925 2925 {
2926 2926 if (u < SSL3_NUM_CIPHERS)
2927 2927 return(&(ssl3_ciphers[SSL3_NUM_CIPHERS-1-u]));
2928 2928 else
2929 2929 return(NULL);
2930 2930 }
2931 2931
2932 2932 int ssl3_pending(const SSL *s)
2933 2933 {
2934 2934 if (s->rstate == SSL_ST_READ_BODY)
2935 2935 return 0;
2936 2936
2937 2937 return (s->s3->rrec.type == SSL3_RT_APPLICATION_DATA) ? s->s3->rrec.length : 0;
2938 2938 }
2939 2939
2940 2940 int ssl3_new(SSL *s)
2941 2941 {
2942 2942 SSL3_STATE *s3;
2943 2943
2944 2944 if ((s3=OPENSSL_malloc(sizeof *s3)) == NULL) goto err;
2945 2945 memset(s3,0,sizeof *s3);
2946 2946 memset(s3->rrec.seq_num,0,sizeof(s3->rrec.seq_num));
2947 2947 memset(s3->wrec.seq_num,0,sizeof(s3->wrec.seq_num));
2948 2948
2949 2949 s->s3=s3;
2950 2950
2951 2951 #ifndef OPENSSL_NO_SRP
2952 2952 SSL_SRP_CTX_init(s);
2953 2953 #endif
2954 2954 s->method->ssl_clear(s);
2955 2955 return(1);
2956 2956 err:
2957 2957 return(0);
2958 2958 }
2959 2959
2960 2960 void ssl3_free(SSL *s)
2961 2961 {
2962 2962 if(s == NULL)
2963 2963 return;
2964 2964
2965 2965 #ifdef TLSEXT_TYPE_opaque_prf_input
2966 2966 if (s->s3->client_opaque_prf_input != NULL)
2967 2967 OPENSSL_free(s->s3->client_opaque_prf_input);
2968 2968 if (s->s3->server_opaque_prf_input != NULL)
2969 2969 OPENSSL_free(s->s3->server_opaque_prf_input);
2970 2970 #endif
2971 2971
2972 2972 ssl3_cleanup_key_block(s);
2973 2973 if (s->s3->rbuf.buf != NULL)
2974 2974 ssl3_release_read_buffer(s);
2975 2975 if (s->s3->wbuf.buf != NULL)
2976 2976 ssl3_release_write_buffer(s);
2977 2977 if (s->s3->rrec.comp != NULL)
2978 2978 OPENSSL_free(s->s3->rrec.comp);
2979 2979 #ifndef OPENSSL_NO_DH
2980 2980 if (s->s3->tmp.dh != NULL)
2981 2981 DH_free(s->s3->tmp.dh);
2982 2982 #endif
2983 2983 #ifndef OPENSSL_NO_ECDH
2984 2984 if (s->s3->tmp.ecdh != NULL)
2985 2985 EC_KEY_free(s->s3->tmp.ecdh);
2986 2986 #endif
2987 2987
2988 2988 if (s->s3->tmp.ca_names != NULL)
2989 2989 sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free);
2990 2990 if (s->s3->handshake_buffer) {
2991 2991 BIO_free(s->s3->handshake_buffer);
2992 2992 }
2993 2993 if (s->s3->handshake_dgst) ssl3_free_digest_list(s);
2994 2994 #ifndef OPENSSL_NO_SRP
2995 2995 SSL_SRP_CTX_free(s);
2996 2996 #endif
2997 2997 OPENSSL_cleanse(s->s3,sizeof *s->s3);
2998 2998 OPENSSL_free(s->s3);
2999 2999 s->s3=NULL;
3000 3000 }
3001 3001
3002 3002 void ssl3_clear(SSL *s)
3003 3003 {
3004 3004 unsigned char *rp,*wp;
3005 3005 size_t rlen, wlen;
3006 3006 int init_extra;
3007 3007
3008 3008 #ifdef TLSEXT_TYPE_opaque_prf_input
3009 3009 if (s->s3->client_opaque_prf_input != NULL)
3010 3010 OPENSSL_free(s->s3->client_opaque_prf_input);
3011 3011 s->s3->client_opaque_prf_input = NULL;
3012 3012 if (s->s3->server_opaque_prf_input != NULL)
3013 3013 OPENSSL_free(s->s3->server_opaque_prf_input);
3014 3014 s->s3->server_opaque_prf_input = NULL;
3015 3015 #endif
3016 3016
3017 3017 ssl3_cleanup_key_block(s);
3018 3018 if (s->s3->tmp.ca_names != NULL)
3019 3019 sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free);
3020 3020
3021 3021 if (s->s3->rrec.comp != NULL)
3022 3022 {
3023 3023 OPENSSL_free(s->s3->rrec.comp);
3024 3024 s->s3->rrec.comp=NULL;
3025 3025 }
3026 3026 #ifndef OPENSSL_NO_DH
3027 3027 if (s->s3->tmp.dh != NULL)
3028 3028 {
3029 3029 DH_free(s->s3->tmp.dh);
3030 3030 s->s3->tmp.dh = NULL;
3031 3031 }
3032 3032 #endif
3033 3033 #ifndef OPENSSL_NO_ECDH
3034 3034 if (s->s3->tmp.ecdh != NULL)
3035 3035 {
3036 3036 EC_KEY_free(s->s3->tmp.ecdh);
3037 3037 s->s3->tmp.ecdh = NULL;
3038 3038 }
3039 3039 #endif
3040 3040 #ifndef OPENSSL_NO_TLSEXT
3041 3041 #ifndef OPENSSL_NO_EC
3042 3042 s->s3->is_probably_safari = 0;
3043 3043 #endif /* !OPENSSL_NO_EC */
3044 3044 #endif /* !OPENSSL_NO_TLSEXT */
3045 3045
3046 3046 rp = s->s3->rbuf.buf;
3047 3047 wp = s->s3->wbuf.buf;
3048 3048 rlen = s->s3->rbuf.len;
3049 3049 wlen = s->s3->wbuf.len;
3050 3050 init_extra = s->s3->init_extra;
3051 3051 if (s->s3->handshake_buffer) {
3052 3052 BIO_free(s->s3->handshake_buffer);
3053 3053 s->s3->handshake_buffer = NULL;
3054 3054 }
3055 3055 if (s->s3->handshake_dgst) {
3056 3056 ssl3_free_digest_list(s);
3057 3057 }
3058 3058 memset(s->s3,0,sizeof *s->s3);
3059 3059 s->s3->rbuf.buf = rp;
3060 3060 s->s3->wbuf.buf = wp;
3061 3061 s->s3->rbuf.len = rlen;
3062 3062 s->s3->wbuf.len = wlen;
3063 3063 s->s3->init_extra = init_extra;
3064 3064
3065 3065 ssl_free_wbio_buffer(s);
3066 3066
3067 3067 s->packet_length=0;
3068 3068 s->s3->renegotiate=0;
3069 3069 s->s3->total_renegotiations=0;
3070 3070 s->s3->num_renegotiations=0;
3071 3071 s->s3->in_read_app_data=0;
3072 3072 s->version=SSL3_VERSION;
3073 3073
3074 3074 #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
3075 3075 if (s->next_proto_negotiated)
3076 3076 {
3077 3077 OPENSSL_free(s->next_proto_negotiated);
3078 3078 s->next_proto_negotiated = NULL;
3079 3079 s->next_proto_negotiated_len = 0;
3080 3080 }
3081 3081 #endif
3082 3082 }
3083 3083
3084 3084 #ifndef OPENSSL_NO_SRP
3085 3085 static char * MS_CALLBACK srp_password_from_info_cb(SSL *s, void *arg)
3086 3086 {
3087 3087 return BUF_strdup(s->srp_ctx.info) ;
3088 3088 }
3089 3089 #endif
3090 3090
3091 3091 long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
3092 3092 {
3093 3093 int ret=0;
3094 3094
3095 3095 #if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_RSA)
3096 3096 if (
3097 3097 #ifndef OPENSSL_NO_RSA
3098 3098 cmd == SSL_CTRL_SET_TMP_RSA ||
3099 3099 cmd == SSL_CTRL_SET_TMP_RSA_CB ||
3100 3100 #endif
3101 3101 #ifndef OPENSSL_NO_DSA
3102 3102 cmd == SSL_CTRL_SET_TMP_DH ||
3103 3103 cmd == SSL_CTRL_SET_TMP_DH_CB ||
3104 3104 #endif
3105 3105 0)
3106 3106 {
3107 3107 if (!ssl_cert_inst(&s->cert))
3108 3108 {
3109 3109 SSLerr(SSL_F_SSL3_CTRL, ERR_R_MALLOC_FAILURE);
3110 3110 return(0);
3111 3111 }
3112 3112 }
3113 3113 #endif
3114 3114
3115 3115 switch (cmd)
3116 3116 {
3117 3117 case SSL_CTRL_GET_SESSION_REUSED:
3118 3118 ret=s->hit;
3119 3119 break;
3120 3120 case SSL_CTRL_GET_CLIENT_CERT_REQUEST:
3121 3121 break;
3122 3122 case SSL_CTRL_GET_NUM_RENEGOTIATIONS:
3123 3123 ret=s->s3->num_renegotiations;
3124 3124 break;
3125 3125 case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS:
3126 3126 ret=s->s3->num_renegotiations;
3127 3127 s->s3->num_renegotiations=0;
3128 3128 break;
3129 3129 case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS:
3130 3130 ret=s->s3->total_renegotiations;
3131 3131 break;
3132 3132 case SSL_CTRL_GET_FLAGS:
3133 3133 ret=(int)(s->s3->flags);
3134 3134 break;
3135 3135 #ifndef OPENSSL_NO_RSA
3136 3136 case SSL_CTRL_NEED_TMP_RSA:
3137 3137 if ((s->cert != NULL) && (s->cert->rsa_tmp == NULL) &&
3138 3138 ((s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey == NULL) ||
3139 3139 (EVP_PKEY_size(s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey) > (512/8))))
3140 3140 ret = 1;
3141 3141 break;
3142 3142 case SSL_CTRL_SET_TMP_RSA:
3143 3143 {
3144 3144 RSA *rsa = (RSA *)parg;
3145 3145 if (rsa == NULL)
3146 3146 {
3147 3147 SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3148 3148 return(ret);
3149 3149 }
3150 3150 if ((rsa = RSAPrivateKey_dup(rsa)) == NULL)
3151 3151 {
3152 3152 SSLerr(SSL_F_SSL3_CTRL, ERR_R_RSA_LIB);
3153 3153 return(ret);
3154 3154 }
3155 3155 if (s->cert->rsa_tmp != NULL)
3156 3156 RSA_free(s->cert->rsa_tmp);
3157 3157 s->cert->rsa_tmp = rsa;
3158 3158 ret = 1;
3159 3159 }
3160 3160 break;
3161 3161 case SSL_CTRL_SET_TMP_RSA_CB:
3162 3162 {
3163 3163 SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
3164 3164 return(ret);
3165 3165 }
3166 3166 break;
3167 3167 #endif
3168 3168 #ifndef OPENSSL_NO_DH
3169 3169 case SSL_CTRL_SET_TMP_DH:
3170 3170 {
3171 3171 DH *dh = (DH *)parg;
3172 3172 if (dh == NULL)
3173 3173 {
3174 3174 SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3175 3175 return(ret);
3176 3176 }
3177 3177 if ((dh = DHparams_dup(dh)) == NULL)
3178 3178 {
3179 3179 SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
3180 3180 return(ret);
3181 3181 }
3182 3182 if (!(s->options & SSL_OP_SINGLE_DH_USE))
3183 3183 {
3184 3184 if (!DH_generate_key(dh))
3185 3185 {
3186 3186 DH_free(dh);
3187 3187 SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
3188 3188 return(ret);
3189 3189 }
3190 3190 }
3191 3191 if (s->cert->dh_tmp != NULL)
3192 3192 DH_free(s->cert->dh_tmp);
3193 3193 s->cert->dh_tmp = dh;
3194 3194 ret = 1;
3195 3195 }
3196 3196 break;
3197 3197 case SSL_CTRL_SET_TMP_DH_CB:
3198 3198 {
3199 3199 SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
3200 3200 return(ret);
3201 3201 }
3202 3202 break;
3203 3203 #endif
3204 3204 #ifndef OPENSSL_NO_ECDH
3205 3205 case SSL_CTRL_SET_TMP_ECDH:
3206 3206 {
3207 3207 EC_KEY *ecdh = NULL;
3208 3208
3209 3209 if (parg == NULL)
3210 3210 {
3211 3211 SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
3212 3212 return(ret);
3213 3213 }
3214 3214 if (!EC_KEY_up_ref((EC_KEY *)parg))
3215 3215 {
3216 3216 SSLerr(SSL_F_SSL3_CTRL,ERR_R_ECDH_LIB);
3217 3217 return(ret);
3218 3218 }
3219 3219 ecdh = (EC_KEY *)parg;
3220 3220 if (!(s->options & SSL_OP_SINGLE_ECDH_USE))
3221 3221 {
3222 3222 if (!EC_KEY_generate_key(ecdh))
3223 3223 {
3224 3224 EC_KEY_free(ecdh);
3225 3225 SSLerr(SSL_F_SSL3_CTRL,ERR_R_ECDH_LIB);
3226 3226 return(ret);
3227 3227 }
3228 3228 }
3229 3229 if (s->cert->ecdh_tmp != NULL)
3230 3230 EC_KEY_free(s->cert->ecdh_tmp);
3231 3231 s->cert->ecdh_tmp = ecdh;
3232 3232 ret = 1;
3233 3233 }
3234 3234 break;
3235 3235 case SSL_CTRL_SET_TMP_ECDH_CB:
3236 3236 {
3237 3237 SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
3238 3238 return(ret);
3239 3239 }
3240 3240 break;
3241 3241 #endif /* !OPENSSL_NO_ECDH */
3242 3242 #ifndef OPENSSL_NO_TLSEXT
3243 3243 case SSL_CTRL_SET_TLSEXT_HOSTNAME:
3244 3244 if (larg == TLSEXT_NAMETYPE_host_name)
3245 3245 {
3246 3246 if (s->tlsext_hostname != NULL)
3247 3247 OPENSSL_free(s->tlsext_hostname);
3248 3248 s->tlsext_hostname = NULL;
3249 3249
3250 3250 ret = 1;
3251 3251 if (parg == NULL)
3252 3252 break;
3253 3253 if (strlen((char *)parg) > TLSEXT_MAXLEN_host_name)
3254 3254 {
3255 3255 SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME);
3256 3256 return 0;
3257 3257 }
3258 3258 if ((s->tlsext_hostname = BUF_strdup((char *)parg)) == NULL)
3259 3259 {
3260 3260 SSLerr(SSL_F_SSL3_CTRL, ERR_R_INTERNAL_ERROR);
3261 3261 return 0;
3262 3262 }
3263 3263 }
3264 3264 else
3265 3265 {
3266 3266 SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE);
3267 3267 return 0;
3268 3268 }
3269 3269 break;
3270 3270 case SSL_CTRL_SET_TLSEXT_DEBUG_ARG:
3271 3271 s->tlsext_debug_arg=parg;
3272 3272 ret = 1;
3273 3273 break;
3274 3274
3275 3275 #ifdef TLSEXT_TYPE_opaque_prf_input
3276 3276 case SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT:
3277 3277 if (larg > 12288) /* actual internal limit is 2^16 for the complete hello message
3278 3278 * (including the cert chain and everything) */
3279 3279 {
3280 3280 SSLerr(SSL_F_SSL3_CTRL, SSL_R_OPAQUE_PRF_INPUT_TOO_LONG);
3281 3281 break;
3282 3282 }
3283 3283 if (s->tlsext_opaque_prf_input != NULL)
3284 3284 OPENSSL_free(s->tlsext_opaque_prf_input);
3285 3285 if ((size_t)larg == 0)
3286 3286 s->tlsext_opaque_prf_input = OPENSSL_malloc(1); /* dummy byte just to get non-NULL */
3287 3287 else
3288 3288 s->tlsext_opaque_prf_input = BUF_memdup(parg, (size_t)larg);
3289 3289 if (s->tlsext_opaque_prf_input != NULL)
3290 3290 {
3291 3291 s->tlsext_opaque_prf_input_len = (size_t)larg;
3292 3292 ret = 1;
3293 3293 }
3294 3294 else
3295 3295 s->tlsext_opaque_prf_input_len = 0;
3296 3296 break;
3297 3297 #endif
3298 3298
3299 3299 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
3300 3300 s->tlsext_status_type=larg;
3301 3301 ret = 1;
3302 3302 break;
3303 3303
3304 3304 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS:
3305 3305 *(STACK_OF(X509_EXTENSION) **)parg = s->tlsext_ocsp_exts;
3306 3306 ret = 1;
3307 3307 break;
3308 3308
3309 3309 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS:
3310 3310 s->tlsext_ocsp_exts = parg;
3311 3311 ret = 1;
3312 3312 break;
3313 3313
3314 3314 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS:
3315 3315 *(STACK_OF(OCSP_RESPID) **)parg = s->tlsext_ocsp_ids;
3316 3316 ret = 1;
3317 3317 break;
3318 3318
3319 3319 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS:
3320 3320 s->tlsext_ocsp_ids = parg;
3321 3321 ret = 1;
3322 3322 break;
3323 3323
3324 3324 case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP:
3325 3325 *(unsigned char **)parg = s->tlsext_ocsp_resp;
3326 3326 return s->tlsext_ocsp_resplen;
3327 3327
3328 3328 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
3329 3329 if (s->tlsext_ocsp_resp)
3330 3330 OPENSSL_free(s->tlsext_ocsp_resp);
3331 3331 s->tlsext_ocsp_resp = parg;
3332 3332 s->tlsext_ocsp_resplen = larg;
3333 3333 ret = 1;
3334 3334 break;
3335 3335
3336 3336 #ifndef OPENSSL_NO_HEARTBEATS
3337 3337 case SSL_CTRL_TLS_EXT_SEND_HEARTBEAT:
3338 3338 if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER)
3339 3339 ret = dtls1_heartbeat(s);
3340 3340 else
3341 3341 ret = tls1_heartbeat(s);
3342 3342 break;
3343 3343
3344 3344 case SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING:
3345 3345 ret = s->tlsext_hb_pending;
3346 3346 break;
3347 3347
3348 3348 case SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS:
3349 3349 if (larg)
3350 3350 s->tlsext_heartbeat |= SSL_TLSEXT_HB_DONT_RECV_REQUESTS;
3351 3351 else
3352 3352 s->tlsext_heartbeat &= ~SSL_TLSEXT_HB_DONT_RECV_REQUESTS;
3353 3353 ret = 1;
3354 3354 break;
3355 3355 #endif
3356 3356
3357 3357 #endif /* !OPENSSL_NO_TLSEXT */
3358 3358 default:
3359 3359 break;
3360 3360 }
3361 3361 return(ret);
3362 3362 }
3363 3363
3364 3364 long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp)(void))
3365 3365 {
3366 3366 int ret=0;
3367 3367
3368 3368 #if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_RSA)
3369 3369 if (
3370 3370 #ifndef OPENSSL_NO_RSA
3371 3371 cmd == SSL_CTRL_SET_TMP_RSA_CB ||
3372 3372 #endif
3373 3373 #ifndef OPENSSL_NO_DSA
3374 3374 cmd == SSL_CTRL_SET_TMP_DH_CB ||
3375 3375 #endif
3376 3376 0)
3377 3377 {
3378 3378 if (!ssl_cert_inst(&s->cert))
3379 3379 {
3380 3380 SSLerr(SSL_F_SSL3_CALLBACK_CTRL, ERR_R_MALLOC_FAILURE);
3381 3381 return(0);
3382 3382 }
3383 3383 }
3384 3384 #endif
3385 3385
3386 3386 switch (cmd)
3387 3387 {
3388 3388 #ifndef OPENSSL_NO_RSA
3389 3389 case SSL_CTRL_SET_TMP_RSA_CB:
3390 3390 {
3391 3391 s->cert->rsa_tmp_cb = (RSA *(*)(SSL *, int, int))fp;
3392 3392 }
3393 3393 break;
3394 3394 #endif
3395 3395 #ifndef OPENSSL_NO_DH
3396 3396 case SSL_CTRL_SET_TMP_DH_CB:
3397 3397 {
3398 3398 s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
3399 3399 }
3400 3400 break;
3401 3401 #endif
3402 3402 #ifndef OPENSSL_NO_ECDH
3403 3403 case SSL_CTRL_SET_TMP_ECDH_CB:
3404 3404 {
3405 3405 s->cert->ecdh_tmp_cb = (EC_KEY *(*)(SSL *, int, int))fp;
3406 3406 }
3407 3407 break;
3408 3408 #endif
3409 3409 #ifndef OPENSSL_NO_TLSEXT
3410 3410 case SSL_CTRL_SET_TLSEXT_DEBUG_CB:
3411 3411 s->tlsext_debug_cb=(void (*)(SSL *,int ,int,
3412 3412 unsigned char *, int, void *))fp;
3413 3413 break;
3414 3414 #endif
3415 3415 default:
3416 3416 break;
3417 3417 }
3418 3418 return(ret);
3419 3419 }
3420 3420
3421 3421 long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
3422 3422 {
3423 3423 CERT *cert;
3424 3424
3425 3425 cert=ctx->cert;
3426 3426
3427 3427 switch (cmd)
3428 3428 {
3429 3429 #ifndef OPENSSL_NO_RSA
3430 3430 case SSL_CTRL_NEED_TMP_RSA:
3431 3431 if ( (cert->rsa_tmp == NULL) &&
3432 3432 ((cert->pkeys[SSL_PKEY_RSA_ENC].privatekey == NULL) ||
3433 3433 (EVP_PKEY_size(cert->pkeys[SSL_PKEY_RSA_ENC].privatekey) > (512/8)))
3434 3434 )
3435 3435 return(1);
3436 3436 else
3437 3437 return(0);
3438 3438 /* break; */
3439 3439 case SSL_CTRL_SET_TMP_RSA:
3440 3440 {
3441 3441 RSA *rsa;
3442 3442 int i;
3443 3443
3444 3444 rsa=(RSA *)parg;
3445 3445 i=1;
3446 3446 if (rsa == NULL)
3447 3447 i=0;
3448 3448 else
3449 3449 {
3450 3450 if ((rsa=RSAPrivateKey_dup(rsa)) == NULL)
3451 3451 i=0;
3452 3452 }
3453 3453 if (!i)
3454 3454 {
3455 3455 SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_RSA_LIB);
3456 3456 return(0);
3457 3457 }
3458 3458 else
3459 3459 {
3460 3460 if (cert->rsa_tmp != NULL)
3461 3461 RSA_free(cert->rsa_tmp);
3462 3462 cert->rsa_tmp=rsa;
3463 3463 return(1);
3464 3464 }
3465 3465 }
3466 3466 /* break; */
3467 3467 case SSL_CTRL_SET_TMP_RSA_CB:
3468 3468 {
3469 3469 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
3470 3470 return(0);
3471 3471 }
3472 3472 break;
3473 3473 #endif
3474 3474 #ifndef OPENSSL_NO_DH
3475 3475 case SSL_CTRL_SET_TMP_DH:
3476 3476 {
3477 3477 DH *new=NULL,*dh;
3478 3478
3479 3479 dh=(DH *)parg;
3480 3480 if ((new=DHparams_dup(dh)) == NULL)
3481 3481 {
3482 3482 SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_DH_LIB);
3483 3483 return 0;
3484 3484 }
3485 3485 if (!(ctx->options & SSL_OP_SINGLE_DH_USE))
3486 3486 {
3487 3487 if (!DH_generate_key(new))
3488 3488 {
3489 3489 SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_DH_LIB);
3490 3490 DH_free(new);
3491 3491 return 0;
3492 3492 }
3493 3493 }
3494 3494 if (cert->dh_tmp != NULL)
3495 3495 DH_free(cert->dh_tmp);
3496 3496 cert->dh_tmp=new;
3497 3497 return 1;
3498 3498 }
3499 3499 /*break; */
3500 3500 case SSL_CTRL_SET_TMP_DH_CB:
3501 3501 {
3502 3502 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
3503 3503 return(0);
3504 3504 }
3505 3505 break;
3506 3506 #endif
3507 3507 #ifndef OPENSSL_NO_ECDH
3508 3508 case SSL_CTRL_SET_TMP_ECDH:
3509 3509 {
3510 3510 EC_KEY *ecdh = NULL;
3511 3511
3512 3512 if (parg == NULL)
3513 3513 {
3514 3514 SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_ECDH_LIB);
3515 3515 return 0;
3516 3516 }
3517 3517 ecdh = EC_KEY_dup((EC_KEY *)parg);
3518 3518 if (ecdh == NULL)
3519 3519 {
3520 3520 SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_EC_LIB);
3521 3521 return 0;
3522 3522 }
3523 3523 if (!(ctx->options & SSL_OP_SINGLE_ECDH_USE))
3524 3524 {
3525 3525 if (!EC_KEY_generate_key(ecdh))
3526 3526 {
3527 3527 EC_KEY_free(ecdh);
3528 3528 SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_ECDH_LIB);
3529 3529 return 0;
3530 3530 }
3531 3531 }
3532 3532
3533 3533 if (cert->ecdh_tmp != NULL)
3534 3534 {
3535 3535 EC_KEY_free(cert->ecdh_tmp);
3536 3536 }
3537 3537 cert->ecdh_tmp = ecdh;
3538 3538 return 1;
3539 3539 }
3540 3540 /* break; */
3541 3541 case SSL_CTRL_SET_TMP_ECDH_CB:
3542 3542 {
3543 3543 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
3544 3544 return(0);
3545 3545 }
3546 3546 break;
3547 3547 #endif /* !OPENSSL_NO_ECDH */
3548 3548 #ifndef OPENSSL_NO_TLSEXT
3549 3549 case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG:
3550 3550 ctx->tlsext_servername_arg=parg;
3551 3551 break;
3552 3552 case SSL_CTRL_SET_TLSEXT_TICKET_KEYS:
3553 3553 case SSL_CTRL_GET_TLSEXT_TICKET_KEYS:
3554 3554 {
3555 3555 unsigned char *keys = parg;
3556 3556 if (!keys)
3557 3557 return 48;
3558 3558 if (larg != 48)
3559 3559 {
3560 3560 SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_TICKET_KEYS_LENGTH);
3561 3561 return 0;
3562 3562 }
3563 3563 if (cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEYS)
3564 3564 {
3565 3565 memcpy(ctx->tlsext_tick_key_name, keys, 16);
3566 3566 memcpy(ctx->tlsext_tick_hmac_key, keys + 16, 16);
3567 3567 memcpy(ctx->tlsext_tick_aes_key, keys + 32, 16);
3568 3568 }
3569 3569 else
3570 3570 {
3571 3571 memcpy(keys, ctx->tlsext_tick_key_name, 16);
3572 3572 memcpy(keys + 16, ctx->tlsext_tick_hmac_key, 16);
3573 3573 memcpy(keys + 32, ctx->tlsext_tick_aes_key, 16);
3574 3574 }
3575 3575 return 1;
3576 3576 }
3577 3577
3578 3578 #ifdef TLSEXT_TYPE_opaque_prf_input
3579 3579 case SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG:
3580 3580 ctx->tlsext_opaque_prf_input_callback_arg = parg;
3581 3581 return 1;
3582 3582 #endif
3583 3583
3584 3584 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
3585 3585 ctx->tlsext_status_arg=parg;
3586 3586 return 1;
3587 3587 break;
3588 3588
3589 3589 #ifndef OPENSSL_NO_SRP
3590 3590 case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
3591 3591 ctx->srp_ctx.srp_Mask|=SSL_kSRP;
3592 3592 if (ctx->srp_ctx.login != NULL)
3593 3593 OPENSSL_free(ctx->srp_ctx.login);
3594 3594 ctx->srp_ctx.login = NULL;
3595 3595 if (parg == NULL)
3596 3596 break;
3597 3597 if (strlen((const char *)parg) > 255 || strlen((const char *)parg) < 1)
3598 3598 {
3599 3599 SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_SRP_USERNAME);
3600 3600 return 0;
3601 3601 }
3602 3602 if ((ctx->srp_ctx.login = BUF_strdup((char *)parg)) == NULL)
3603 3603 {
3604 3604 SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_INTERNAL_ERROR);
3605 3605 return 0;
3606 3606 }
3607 3607 break;
3608 3608 case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD:
3609 3609 ctx->srp_ctx.SRP_give_srp_client_pwd_callback=srp_password_from_info_cb;
3610 3610 ctx->srp_ctx.info=parg;
3611 3611 break;
3612 3612 case SSL_CTRL_SET_SRP_ARG:
3613 3613 ctx->srp_ctx.srp_Mask|=SSL_kSRP;
3614 3614 ctx->srp_ctx.SRP_cb_arg=parg;
3615 3615 break;
3616 3616
3617 3617 case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH:
3618 3618 ctx->srp_ctx.strength=larg;
3619 3619 break;
3620 3620 #endif
3621 3621 #endif /* !OPENSSL_NO_TLSEXT */
3622 3622
3623 3623 /* A Thawte special :-) */
3624 3624 case SSL_CTRL_EXTRA_CHAIN_CERT:
3625 3625 if (ctx->extra_certs == NULL)
3626 3626 {
3627 3627 if ((ctx->extra_certs=sk_X509_new_null()) == NULL)
3628 3628 return(0);
3629 3629 }
3630 3630 sk_X509_push(ctx->extra_certs,(X509 *)parg);
3631 3631 break;
3632 3632
3633 3633 case SSL_CTRL_GET_EXTRA_CHAIN_CERTS:
3634 3634 *(STACK_OF(X509) **)parg = ctx->extra_certs;
3635 3635 break;
3636 3636
3637 3637 case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS:
3638 3638 if (ctx->extra_certs)
3639 3639 {
3640 3640 sk_X509_pop_free(ctx->extra_certs, X509_free);
3641 3641 ctx->extra_certs = NULL;
3642 3642 }
3643 3643 break;
3644 3644
3645 3645 default:
3646 3646 return(0);
3647 3647 }
3648 3648 return(1);
3649 3649 }
3650 3650
3651 3651 long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void))
3652 3652 {
3653 3653 CERT *cert;
3654 3654
3655 3655 cert=ctx->cert;
3656 3656
3657 3657 switch (cmd)
3658 3658 {
3659 3659 #ifndef OPENSSL_NO_RSA
3660 3660 case SSL_CTRL_SET_TMP_RSA_CB:
3661 3661 {
3662 3662 cert->rsa_tmp_cb = (RSA *(*)(SSL *, int, int))fp;
3663 3663 }
3664 3664 break;
3665 3665 #endif
3666 3666 #ifndef OPENSSL_NO_DH
3667 3667 case SSL_CTRL_SET_TMP_DH_CB:
3668 3668 {
3669 3669 cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
3670 3670 }
3671 3671 break;
3672 3672 #endif
3673 3673 #ifndef OPENSSL_NO_ECDH
3674 3674 case SSL_CTRL_SET_TMP_ECDH_CB:
3675 3675 {
3676 3676 cert->ecdh_tmp_cb = (EC_KEY *(*)(SSL *, int, int))fp;
3677 3677 }
3678 3678 break;
3679 3679 #endif
3680 3680 #ifndef OPENSSL_NO_TLSEXT
3681 3681 case SSL_CTRL_SET_TLSEXT_SERVERNAME_CB:
3682 3682 ctx->tlsext_servername_callback=(int (*)(SSL *,int *,void *))fp;
3683 3683 break;
3684 3684
3685 3685 #ifdef TLSEXT_TYPE_opaque_prf_input
3686 3686 case SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB:
3687 3687 ctx->tlsext_opaque_prf_input_callback = (int (*)(SSL *,void *, size_t, void *))fp;
3688 3688 break;
3689 3689 #endif
3690 3690
3691 3691 case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB:
3692 3692 ctx->tlsext_status_cb=(int (*)(SSL *,void *))fp;
3693 3693 break;
3694 3694
3695 3695 case SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB:
3696 3696 ctx->tlsext_ticket_key_cb=(int (*)(SSL *,unsigned char *,
3697 3697 unsigned char *,
3698 3698 EVP_CIPHER_CTX *,
3699 3699 HMAC_CTX *, int))fp;
3700 3700 break;
3701 3701
3702 3702 #ifndef OPENSSL_NO_SRP
3703 3703 case SSL_CTRL_SET_SRP_VERIFY_PARAM_CB:
3704 3704 ctx->srp_ctx.srp_Mask|=SSL_kSRP;
3705 3705 ctx->srp_ctx.SRP_verify_param_callback=(int (*)(SSL *,void *))fp;
3706 3706 break;
3707 3707 case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB:
3708 3708 ctx->srp_ctx.srp_Mask|=SSL_kSRP;
3709 3709 ctx->srp_ctx.TLS_ext_srp_username_callback=(int (*)(SSL *,int *,void *))fp;
3710 3710 break;
3711 3711 case SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB:
3712 3712 ctx->srp_ctx.srp_Mask|=SSL_kSRP;
3713 3713 ctx->srp_ctx.SRP_give_srp_client_pwd_callback=(char *(*)(SSL *,void *))fp;
3714 3714 break;
3715 3715 #endif
3716 3716 #endif
3717 3717 default:
3718 3718 return(0);
3719 3719 }
3720 3720 return(1);
3721 3721 }
3722 3722
3723 3723 /* This function needs to check if the ciphers required are actually
3724 3724 * available */
3725 3725 const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p)
3726 3726 {
3727 3727 SSL_CIPHER c;
3728 3728 const SSL_CIPHER *cp;
3729 3729 unsigned long id;
3730 3730
3731 3731 id=0x03000000L|((unsigned long)p[0]<<8L)|(unsigned long)p[1];
3732 3732 c.id=id;
3733 3733 cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS);
3734 3734 #ifdef DEBUG_PRINT_UNKNOWN_CIPHERSUITES
3735 3735 if (cp == NULL) fprintf(stderr, "Unknown cipher ID %x\n", (p[0] << 8) | p[1]);
3736 3736 #endif
3737 3737 if (cp == NULL || cp->valid == 0)
3738 3738 return NULL;
3739 3739 else
3740 3740 return cp;
3741 3741 }
3742 3742
3743 3743 int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
3744 3744 {
3745 3745 long l;
3746 3746
3747 3747 if (p != NULL)
3748 3748 {
3749 3749 l=c->id;
3750 3750 if ((l & 0xff000000) != 0x03000000) return(0);
3751 3751 p[0]=((unsigned char)(l>> 8L))&0xFF;
3752 3752 p[1]=((unsigned char)(l ))&0xFF;
3753 3753 }
3754 3754 return(2);
3755 3755 }
3756 3756
3757 3757 SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
3758 3758 STACK_OF(SSL_CIPHER) *srvr)
3759 3759 {
3760 3760 SSL_CIPHER *c,*ret=NULL;
3761 3761 STACK_OF(SSL_CIPHER) *prio, *allow;
3762 3762 int i,ii,ok;
3763 3763 #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_EC)
3764 3764 unsigned int j;
3765 3765 int ec_ok, ec_nid;
3766 3766 unsigned char ec_search1 = 0, ec_search2 = 0;
3767 3767 #endif
3768 3768 CERT *cert;
3769 3769 unsigned long alg_k,alg_a,mask_k,mask_a,emask_k,emask_a;
3770 3770
3771 3771 /* Let's see which ciphers we can support */
3772 3772 cert=s->cert;
3773 3773
3774 3774 #if 0
3775 3775 /* Do not set the compare functions, because this may lead to a
3776 3776 * reordering by "id". We want to keep the original ordering.
3777 3777 * We may pay a price in performance during sk_SSL_CIPHER_find(),
3778 3778 * but would have to pay with the price of sk_SSL_CIPHER_dup().
3779 3779 */
3780 3780 sk_SSL_CIPHER_set_cmp_func(srvr, ssl_cipher_ptr_id_cmp);
3781 3781 sk_SSL_CIPHER_set_cmp_func(clnt, ssl_cipher_ptr_id_cmp);
3782 3782 #endif
3783 3783
3784 3784 #ifdef CIPHER_DEBUG
3785 3785 printf("Server has %d from %p:\n", sk_SSL_CIPHER_num(srvr), (void *)srvr);
3786 3786 for(i=0 ; i < sk_SSL_CIPHER_num(srvr) ; ++i)
3787 3787 {
3788 3788 c=sk_SSL_CIPHER_value(srvr,i);
3789 3789 printf("%p:%s\n",(void *)c,c->name);
3790 3790 }
3791 3791 printf("Client sent %d from %p:\n", sk_SSL_CIPHER_num(clnt), (void *)clnt);
3792 3792 for(i=0 ; i < sk_SSL_CIPHER_num(clnt) ; ++i)
3793 3793 {
3794 3794 c=sk_SSL_CIPHER_value(clnt,i);
3795 3795 printf("%p:%s\n",(void *)c,c->name);
3796 3796 }
3797 3797 #endif
3798 3798
3799 3799 if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE)
3800 3800 {
3801 3801 prio = srvr;
3802 3802 allow = clnt;
3803 3803 }
3804 3804 else
3805 3805 {
3806 3806 prio = clnt;
3807 3807 allow = srvr;
3808 3808 }
3809 3809
3810 3810 for (i=0; i<sk_SSL_CIPHER_num(prio); i++)
3811 3811 {
3812 3812 c=sk_SSL_CIPHER_value(prio,i);
3813 3813
3814 3814 /* Skip TLS v1.2 only ciphersuites if lower than v1.2 */
3815 3815 if ((c->algorithm_ssl & SSL_TLSV1_2) &&
3816 3816 (TLS1_get_version(s) < TLS1_2_VERSION))
3817 3817 continue;
3818 3818
3819 3819 ssl_set_cert_masks(cert,c);
3820 3820 mask_k = cert->mask_k;
3821 3821 mask_a = cert->mask_a;
3822 3822 emask_k = cert->export_mask_k;
3823 3823 emask_a = cert->export_mask_a;
3824 3824 #ifndef OPENSSL_NO_SRP
3825 3825 mask_k=cert->mask_k | s->srp_ctx.srp_Mask;
3826 3826 emask_k=cert->export_mask_k | s->srp_ctx.srp_Mask;
3827 3827 #endif
3828 3828
3829 3829 #ifdef KSSL_DEBUG
3830 3830 /* printf("ssl3_choose_cipher %d alg= %lx\n", i,c->algorithms);*/
3831 3831 #endif /* KSSL_DEBUG */
3832 3832
3833 3833 alg_k=c->algorithm_mkey;
3834 3834 alg_a=c->algorithm_auth;
3835 3835
3836 3836 #ifndef OPENSSL_NO_KRB5
3837 3837 if (alg_k & SSL_kKRB5)
3838 3838 {
3839 3839 if ( !kssl_keytab_is_available(s->kssl_ctx) )
3840 3840 continue;
3841 3841 }
3842 3842 #endif /* OPENSSL_NO_KRB5 */
3843 3843 #ifndef OPENSSL_NO_PSK
3844 3844 /* with PSK there must be server callback set */
3845 3845 if ((alg_k & SSL_kPSK) && s->psk_server_callback == NULL)
3846 3846 continue;
3847 3847 #endif /* OPENSSL_NO_PSK */
3848 3848
3849 3849 if (SSL_C_IS_EXPORT(c))
3850 3850 {
3851 3851 ok = (alg_k & emask_k) && (alg_a & emask_a);
3852 3852 #ifdef CIPHER_DEBUG
3853 3853 printf("%d:[%08lX:%08lX:%08lX:%08lX]%p:%s (export)\n",ok,alg_k,alg_a,emask_k,emask_a,
3854 3854 (void *)c,c->name);
3855 3855 #endif
3856 3856 }
3857 3857 else
3858 3858 {
3859 3859 ok = (alg_k & mask_k) && (alg_a & mask_a);
3860 3860 #ifdef CIPHER_DEBUG
3861 3861 printf("%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n",ok,alg_k,alg_a,mask_k,mask_a,(void *)c,
3862 3862 c->name);
3863 3863 #endif
3864 3864 }
3865 3865
3866 3866 #ifndef OPENSSL_NO_TLSEXT
3867 3867 #ifndef OPENSSL_NO_EC
3868 3868 if (
3869 3869 /* if we are considering an ECC cipher suite that uses our certificate */
3870 3870 (alg_a & SSL_aECDSA || alg_a & SSL_aECDH)
3871 3871 /* and we have an ECC certificate */
3872 3872 && (s->cert->pkeys[SSL_PKEY_ECC].x509 != NULL)
3873 3873 /* and the client specified a Supported Point Formats extension */
3874 3874 && ((s->session->tlsext_ecpointformatlist_length > 0) && (s->session->tlsext_ecpointformatlist != NULL))
3875 3875 /* and our certificate's point is compressed */
3876 3876 && (
3877 3877 (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info != NULL)
3878 3878 && (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key != NULL)
3879 3879 && (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key != NULL)
3880 3880 && (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key->data != NULL)
3881 3881 && (
3882 3882 (*(s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key->data) == POINT_CONVERSION_COMPRESSED)
3883 3883 || (*(s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key->data) == POINT_CONVERSION_COMPRESSED + 1)
3884 3884 )
3885 3885 )
3886 3886 )
3887 3887 {
3888 3888 ec_ok = 0;
3889 3889 /* if our certificate's curve is over a field type that the client does not support
3890 3890 * then do not allow this cipher suite to be negotiated */
3891 3891 if (
3892 3892 (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec != NULL)
3893 3893 && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group != NULL)
3894 3894 && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth != NULL)
3895 3895 && (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_prime_field)
3896 3896 )
3897 3897 {
3898 3898 for (j = 0; j < s->session->tlsext_ecpointformatlist_length; j++)
3899 3899 {
3900 3900 if (s->session->tlsext_ecpointformatlist[j] == TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime)
3901 3901 {
3902 3902 ec_ok = 1;
3903 3903 break;
3904 3904 }
3905 3905 }
3906 3906 }
3907 3907 else if (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_characteristic_two_field)
3908 3908 {
3909 3909 for (j = 0; j < s->session->tlsext_ecpointformatlist_length; j++)
3910 3910 {
3911 3911 if (s->session->tlsext_ecpointformatlist[j] == TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2)
3912 3912 {
3913 3913 ec_ok = 1;
3914 3914 break;
3915 3915 }
3916 3916 }
3917 3917 }
3918 3918 ok = ok && ec_ok;
3919 3919 }
3920 3920 if (
3921 3921 /* if we are considering an ECC cipher suite that uses our certificate */
3922 3922 (alg_a & SSL_aECDSA || alg_a & SSL_aECDH)
3923 3923 /* and we have an ECC certificate */
3924 3924 && (s->cert->pkeys[SSL_PKEY_ECC].x509 != NULL)
3925 3925 /* and the client specified an EllipticCurves extension */
3926 3926 && ((s->session->tlsext_ellipticcurvelist_length > 0) && (s->session->tlsext_ellipticcurvelist != NULL))
3927 3927 )
3928 3928 {
3929 3929 ec_ok = 0;
3930 3930 if (
3931 3931 (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec != NULL)
3932 3932 && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group != NULL)
3933 3933 )
3934 3934 {
3935 3935 ec_nid = EC_GROUP_get_curve_name(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group);
3936 3936 if ((ec_nid == 0)
3937 3937 && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth != NULL)
3938 3938 )
3939 3939 {
3940 3940 if (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_prime_field)
3941 3941 {
3942 3942 ec_search1 = 0xFF;
3943 3943 ec_search2 = 0x01;
3944 3944 }
3945 3945 else if (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_characteristic_two_field)
3946 3946 {
3947 3947 ec_search1 = 0xFF;
3948 3948 ec_search2 = 0x02;
3949 3949 }
3950 3950 }
3951 3951 else
3952 3952 {
3953 3953 ec_search1 = 0x00;
3954 3954 ec_search2 = tls1_ec_nid2curve_id(ec_nid);
3955 3955 }
3956 3956 if ((ec_search1 != 0) || (ec_search2 != 0))
3957 3957 {
3958 3958 for (j = 0; j < s->session->tlsext_ellipticcurvelist_length / 2; j++)
3959 3959 {
3960 3960 if ((s->session->tlsext_ellipticcurvelist[2*j] == ec_search1) && (s->session->tlsext_ellipticcurvelist[2*j+1] == ec_search2))
3961 3961 {
3962 3962 ec_ok = 1;
3963 3963 break;
3964 3964 }
3965 3965 }
3966 3966 }
3967 3967 }
3968 3968 ok = ok && ec_ok;
3969 3969 }
3970 3970 if (
3971 3971 /* if we are considering an ECC cipher suite that uses an ephemeral EC key */
3972 3972 (alg_k & SSL_kEECDH)
3973 3973 /* and we have an ephemeral EC key */
3974 3974 && (s->cert->ecdh_tmp != NULL)
3975 3975 /* and the client specified an EllipticCurves extension */
3976 3976 && ((s->session->tlsext_ellipticcurvelist_length > 0) && (s->session->tlsext_ellipticcurvelist != NULL))
3977 3977 )
3978 3978 {
3979 3979 ec_ok = 0;
3980 3980 if (s->cert->ecdh_tmp->group != NULL)
3981 3981 {
3982 3982 ec_nid = EC_GROUP_get_curve_name(s->cert->ecdh_tmp->group);
3983 3983 if ((ec_nid == 0)
3984 3984 && (s->cert->ecdh_tmp->group->meth != NULL)
3985 3985 )
3986 3986 {
3987 3987 if (EC_METHOD_get_field_type(s->cert->ecdh_tmp->group->meth) == NID_X9_62_prime_field)
3988 3988 {
3989 3989 ec_search1 = 0xFF;
3990 3990 ec_search2 = 0x01;
3991 3991 }
3992 3992 else if (EC_METHOD_get_field_type(s->cert->ecdh_tmp->group->meth) == NID_X9_62_characteristic_two_field)
3993 3993 {
3994 3994 ec_search1 = 0xFF;
3995 3995 ec_search2 = 0x02;
3996 3996 }
3997 3997 }
3998 3998 else
3999 3999 {
4000 4000 ec_search1 = 0x00;
4001 4001 ec_search2 = tls1_ec_nid2curve_id(ec_nid);
4002 4002 }
4003 4003 if ((ec_search1 != 0) || (ec_search2 != 0))
4004 4004 {
4005 4005 for (j = 0; j < s->session->tlsext_ellipticcurvelist_length / 2; j++)
4006 4006 {
4007 4007 if ((s->session->tlsext_ellipticcurvelist[2*j] == ec_search1) && (s->session->tlsext_ellipticcurvelist[2*j+1] == ec_search2))
4008 4008 {
4009 4009 ec_ok = 1;
4010 4010 break;
4011 4011 }
4012 4012 }
4013 4013 }
4014 4014 }
4015 4015 ok = ok && ec_ok;
4016 4016 }
4017 4017 #endif /* OPENSSL_NO_EC */
4018 4018 #endif /* OPENSSL_NO_TLSEXT */
4019 4019
4020 4020 if (!ok) continue;
4021 4021 ii=sk_SSL_CIPHER_find(allow,c);
4022 4022 if (ii >= 0)
4023 4023 {
4024 4024 #if !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_TLSEXT)
4025 4025 if ((alg_k & SSL_kEECDH) && (alg_a & SSL_aECDSA) && s->s3->is_probably_safari)
4026 4026 {
4027 4027 if (!ret) ret=sk_SSL_CIPHER_value(allow,ii);
4028 4028 continue;
4029 4029 }
4030 4030 #endif
4031 4031 ret=sk_SSL_CIPHER_value(allow,ii);
4032 4032 break;
4033 4033 }
4034 4034 }
4035 4035 return(ret);
4036 4036 }
4037 4037
4038 4038 int ssl3_get_req_cert_type(SSL *s, unsigned char *p)
4039 4039 {
4040 4040 int ret=0;
4041 4041 unsigned long alg_k;
4042 4042
4043 4043 alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
4044 4044
4045 4045 #ifndef OPENSSL_NO_GOST
4046 4046 if (s->version >= TLS1_VERSION)
4047 4047 {
4048 4048 if (alg_k & SSL_kGOST)
4049 4049 {
4050 4050 p[ret++]=TLS_CT_GOST94_SIGN;
4051 4051 p[ret++]=TLS_CT_GOST01_SIGN;
4052 4052 return(ret);
4053 4053 }
4054 4054 }
4055 4055 #endif
4056 4056
4057 4057 #ifndef OPENSSL_NO_DH
4058 4058 if (alg_k & (SSL_kDHr|SSL_kEDH))
4059 4059 {
4060 4060 # ifndef OPENSSL_NO_RSA
4061 4061 p[ret++]=SSL3_CT_RSA_FIXED_DH;
4062 4062 # endif
4063 4063 # ifndef OPENSSL_NO_DSA
4064 4064 p[ret++]=SSL3_CT_DSS_FIXED_DH;
4065 4065 # endif
4066 4066 }
4067 4067 if ((s->version == SSL3_VERSION) &&
4068 4068 (alg_k & (SSL_kEDH|SSL_kDHd|SSL_kDHr)))
4069 4069 {
4070 4070 # ifndef OPENSSL_NO_RSA
4071 4071 p[ret++]=SSL3_CT_RSA_EPHEMERAL_DH;
4072 4072 # endif
4073 4073 # ifndef OPENSSL_NO_DSA
4074 4074 p[ret++]=SSL3_CT_DSS_EPHEMERAL_DH;
4075 4075 # endif
4076 4076 }
4077 4077 #endif /* !OPENSSL_NO_DH */
4078 4078 #ifndef OPENSSL_NO_RSA
4079 4079 p[ret++]=SSL3_CT_RSA_SIGN;
4080 4080 #endif
4081 4081 #ifndef OPENSSL_NO_DSA
4082 4082 p[ret++]=SSL3_CT_DSS_SIGN;
4083 4083 #endif
4084 4084 #ifndef OPENSSL_NO_ECDH
4085 4085 if ((alg_k & (SSL_kECDHr|SSL_kECDHe)) && (s->version >= TLS1_VERSION))
4086 4086 {
4087 4087 p[ret++]=TLS_CT_RSA_FIXED_ECDH;
4088 4088 p[ret++]=TLS_CT_ECDSA_FIXED_ECDH;
4089 4089 }
4090 4090 #endif
4091 4091
4092 4092 #ifndef OPENSSL_NO_ECDSA
4093 4093 /* ECDSA certs can be used with RSA cipher suites as well
4094 4094 * so we don't need to check for SSL_kECDH or SSL_kEECDH
4095 4095 */
4096 4096 if (s->version >= TLS1_VERSION)
4097 4097 {
4098 4098 p[ret++]=TLS_CT_ECDSA_SIGN;
4099 4099 }
4100 4100 #endif
4101 4101 return(ret);
4102 4102 }
4103 4103
4104 4104 int ssl3_shutdown(SSL *s)
4105 4105 {
4106 4106 int ret;
4107 4107
4108 4108 /* Don't do anything much if we have not done the handshake or
4109 4109 * we don't want to send messages :-) */
4110 4110 if ((s->quiet_shutdown) || (s->state == SSL_ST_BEFORE))
4111 4111 {
4112 4112 s->shutdown=(SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
4113 4113 return(1);
4114 4114 }
4115 4115
4116 4116 if (!(s->shutdown & SSL_SENT_SHUTDOWN))
4117 4117 {
4118 4118 s->shutdown|=SSL_SENT_SHUTDOWN;
4119 4119 #if 1
4120 4120 ssl3_send_alert(s,SSL3_AL_WARNING,SSL_AD_CLOSE_NOTIFY);
4121 4121 #endif
4122 4122 /* our shutdown alert has been sent now, and if it still needs
4123 4123 * to be written, s->s3->alert_dispatch will be true */
4124 4124 if (s->s3->alert_dispatch)
4125 4125 return(-1); /* return WANT_WRITE */
4126 4126 }
4127 4127 else if (s->s3->alert_dispatch)
4128 4128 {
4129 4129 /* resend it if not sent */
4130 4130 #if 1
4131 4131 ret=s->method->ssl_dispatch_alert(s);
4132 4132 if(ret == -1)
4133 4133 {
4134 4134 /* we only get to return -1 here the 2nd/Nth
4135 4135 * invocation, we must have already signalled
4136 4136 * return 0 upon a previous invoation,
4137 4137 * return WANT_WRITE */
4138 4138 return(ret);
4139 4139 }
4140 4140 #endif
4141 4141 }
4142 4142 else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN))
4143 4143 {
4144 4144 /* If we are waiting for a close from our peer, we are closed */
4145 4145 s->method->ssl_read_bytes(s,0,NULL,0,0);
4146 4146 if(!(s->shutdown & SSL_RECEIVED_SHUTDOWN))
4147 4147 {
4148 4148 return(-1); /* return WANT_READ */
4149 4149 }
4150 4150 }
4151 4151
4152 4152 if ((s->shutdown == (SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN)) &&
4153 4153 !s->s3->alert_dispatch)
4154 4154 return(1);
4155 4155 else
4156 4156 return(0);
4157 4157 }
4158 4158
4159 4159 int ssl3_write(SSL *s, const void *buf, int len)
4160 4160 {
4161 4161 int ret,n;
4162 4162
4163 4163 #if 0
4164 4164 if (s->shutdown & SSL_SEND_SHUTDOWN)
4165 4165 {
4166 4166 s->rwstate=SSL_NOTHING;
4167 4167 return(0);
4168 4168 }
4169 4169 #endif
4170 4170 clear_sys_error();
4171 4171 if (s->s3->renegotiate) ssl3_renegotiate_check(s);
4172 4172
4173 4173 /* This is an experimental flag that sends the
4174 4174 * last handshake message in the same packet as the first
4175 4175 * use data - used to see if it helps the TCP protocol during
4176 4176 * session-id reuse */
4177 4177 /* The second test is because the buffer may have been removed */
4178 4178 if ((s->s3->flags & SSL3_FLAGS_POP_BUFFER) && (s->wbio == s->bbio))
4179 4179 {
4180 4180 /* First time through, we write into the buffer */
4181 4181 if (s->s3->delay_buf_pop_ret == 0)
4182 4182 {
4183 4183 ret=ssl3_write_bytes(s,SSL3_RT_APPLICATION_DATA,
4184 4184 buf,len);
4185 4185 if (ret <= 0) return(ret);
4186 4186
4187 4187 s->s3->delay_buf_pop_ret=ret;
4188 4188 }
4189 4189
4190 4190 s->rwstate=SSL_WRITING;
4191 4191 n=BIO_flush(s->wbio);
4192 4192 if (n <= 0) return(n);
4193 4193 s->rwstate=SSL_NOTHING;
4194 4194
4195 4195 /* We have flushed the buffer, so remove it */
4196 4196 ssl_free_wbio_buffer(s);
4197 4197 s->s3->flags&= ~SSL3_FLAGS_POP_BUFFER;
4198 4198
4199 4199 ret=s->s3->delay_buf_pop_ret;
4200 4200 s->s3->delay_buf_pop_ret=0;
4201 4201 }
4202 4202 else
4203 4203 {
4204 4204 ret=s->method->ssl_write_bytes(s,SSL3_RT_APPLICATION_DATA,
4205 4205 buf,len);
4206 4206 if (ret <= 0) return(ret);
4207 4207 }
4208 4208
4209 4209 return(ret);
4210 4210 }
4211 4211
4212 4212 static int ssl3_read_internal(SSL *s, void *buf, int len, int peek)
4213 4213 {
4214 4214 int ret;
4215 4215
4216 4216 clear_sys_error();
4217 4217 if (s->s3->renegotiate) ssl3_renegotiate_check(s);
4218 4218 s->s3->in_read_app_data=1;
4219 4219 ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,buf,len,peek);
4220 4220 if ((ret == -1) && (s->s3->in_read_app_data == 2))
4221 4221 {
4222 4222 /* ssl3_read_bytes decided to call s->handshake_func, which
4223 4223 * called ssl3_read_bytes to read handshake data.
4224 4224 * However, ssl3_read_bytes actually found application data
4225 4225 * and thinks that application data makes sense here; so disable
4226 4226 * handshake processing and try to read application data again. */
4227 4227 s->in_handshake++;
4228 4228 ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,buf,len,peek);
4229 4229 s->in_handshake--;
4230 4230 }
4231 4231 else
4232 4232 s->s3->in_read_app_data=0;
4233 4233
4234 4234 return(ret);
4235 4235 }
4236 4236
4237 4237 int ssl3_read(SSL *s, void *buf, int len)
4238 4238 {
4239 4239 return ssl3_read_internal(s, buf, len, 0);
4240 4240 }
4241 4241
4242 4242 int ssl3_peek(SSL *s, void *buf, int len)
4243 4243 {
4244 4244 return ssl3_read_internal(s, buf, len, 1);
4245 4245 }
4246 4246
4247 4247 int ssl3_renegotiate(SSL *s)
4248 4248 {
4249 4249 if (s->handshake_func == NULL)
4250 4250 return(1);
4251 4251
4252 4252 if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)
4253 4253 return(0);
4254 4254
4255 4255 s->s3->renegotiate=1;
4256 4256 return(1);
4257 4257 }
4258 4258
4259 4259 int ssl3_renegotiate_check(SSL *s)
4260 4260 {
4261 4261 int ret=0;
4262 4262
4263 4263 if (s->s3->renegotiate)
4264 4264 {
4265 4265 if ( (s->s3->rbuf.left == 0) &&
4266 4266 (s->s3->wbuf.left == 0) &&
4267 4267 !SSL_in_init(s))
4268 4268 {
4269 4269 /*
4270 4270 if we are the server, and we have sent a 'RENEGOTIATE' message, we
4271 4271 need to go to SSL_ST_ACCEPT.
4272 4272 */
4273 4273 /* SSL_ST_ACCEPT */
4274 4274 s->state=SSL_ST_RENEGOTIATE;
4275 4275 s->s3->renegotiate=0;
4276 4276 s->s3->num_renegotiations++;
4277 4277 s->s3->total_renegotiations++;
4278 4278 ret=1;
4279 4279 }
4280 4280 }
4281 4281 return(ret);
4282 4282 }
4283 4283 /* If we are using TLS v1.2 or later and default SHA1+MD5 algorithms switch
4284 4284 * to new SHA256 PRF and handshake macs
4285 4285 */
4286 4286 long ssl_get_algorithm2(SSL *s)
4287 4287 {
4288 4288 long alg2 = s->s3->tmp.new_cipher->algorithm2;
4289 4289 if (s->method->version == TLS1_2_VERSION &&
4290 4290 alg2 == (SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF))
4291 4291 return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256;
4292 4292 return alg2;
4293 4293 }
↓ open down ↓ |
4126 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX