1 /* 2 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 27 package sun.security.ssl; 28 29 import java.util.*; 30 31 import java.security.NoSuchAlgorithmException; 32 import java.security.InvalidKeyException; 33 import java.security.SecureRandom; 34 import java.security.KeyManagementException; 35 36 import javax.crypto.Cipher; 37 import javax.crypto.SecretKey; 38 import javax.crypto.spec.IvParameterSpec; 39 import javax.crypto.spec.SecretKeySpec; 40 41 import static sun.security.ssl.CipherSuite.KeyExchange.*; 42 import static sun.security.ssl.CipherSuite.PRF.*; 43 import static sun.security.ssl.CipherSuite.CipherType.*; 44 import static sun.security.ssl.JsseJce.*; 45 46 /** 47 * An SSL/TLS CipherSuite. Constants for the standard key exchange, cipher, 48 * and mac algorithms are also defined in this class. 49 * 50 * The CipherSuite class and the inner classes defined in this file roughly 51 * follow the type safe enum pattern described in Effective Java. This means: 52 * 53 * . instances are immutable, classes are final 54 * 55 * . there is a unique instance of every value, i.e. there are never two 56 * instances representing the same CipherSuite, etc. This means equality 57 * tests can be performed using == instead of equals() (although that works 58 * as well). [A minor exception are *unsupported* CipherSuites read from a 59 * handshake message, but this is usually irrelevant] 60 * 61 * . instances are obtained using the static valueOf() factory methods. 62 * 63 * . properties are defined as final variables and made available as 64 * package private variables without method accessors 65 * 66 * . if the member variable allowed is false, the given algorithm is either 67 * unavailable or disabled at compile time 68 * 69 */ 70 final class CipherSuite implements Comparable<CipherSuite> { 71 72 // minimum priority for supported CipherSuites 73 final static int SUPPORTED_SUITES_PRIORITY = 1; 74 75 // minimum priority for default enabled CipherSuites 76 final static int DEFAULT_SUITES_PRIORITY = 300; 77 78 // Flag indicating if CipherSuite availability can change dynamically. 79 // This is the case when we rely on a JCE cipher implementation that 80 // may not be available in the installed JCE providers. 81 // It is true because we might not have an ECC implementation. 82 final static boolean DYNAMIC_AVAILABILITY = true; 83 84 private final static boolean ALLOW_ECC = Debug.getBooleanProperty 85 ("com.sun.net.ssl.enableECC", true); 86 87 // Map Integer(id) -> CipherSuite 88 // contains all known CipherSuites 89 private final static Map<Integer,CipherSuite> idMap; 90 91 // Map String(name) -> CipherSuite 92 // contains only supported CipherSuites (i.e. allowed == true) 93 private final static Map<String,CipherSuite> nameMap; 94 95 // Protocol defined CipherSuite name, e.g. SSL_RSA_WITH_RC4_128_MD5 96 // we use TLS_* only for new CipherSuites, still SSL_* for old ones 97 final String name; 98 99 // id in 16 bit MSB format, i.e. 0x0004 for SSL_RSA_WITH_RC4_128_MD5 100 final int id; 101 102 // priority for the internal default preference order. the higher the 103 // better. Each supported CipherSuite *must* have a unique priority. 104 // Ciphersuites with priority >= DEFAULT_SUITES_PRIORITY are enabled 105 // by default 106 final int priority; 107 108 // key exchange, bulk cipher, mac and prf algorithms. See those 109 // classes below. 110 final KeyExchange keyExchange; 111 final BulkCipher cipher; 112 final MacAlg macAlg; 113 final PRF prfAlg; 114 115 // whether a CipherSuite qualifies as exportable under 512/40 bit rules. 116 // TLS 1.1+ (RFC 4346) must not negotiate to these suites. 117 final boolean exportable; 118 119 // true iff implemented and enabled at compile time 120 final boolean allowed; 121 122 // obsoleted since protocol version 123 final int obsoleted; 124 125 // supported since protocol version 126 final int supported; 127 128 /** 129 * Constructor for implemented CipherSuites. 130 */ 131 private CipherSuite(String name, int id, int priority, 132 KeyExchange keyExchange, BulkCipher cipher, 133 boolean allowed, int obsoleted, int supported, PRF prfAlg) { 134 this.name = name; 135 this.id = id; 136 this.priority = priority; 137 this.keyExchange = keyExchange; 138 this.cipher = cipher; 139 this.exportable = cipher.exportable; 140 if (cipher.cipherType == CipherType.AEAD_CIPHER) { 141 macAlg = M_NULL; 142 } else if (name.endsWith("_MD5")) { 143 macAlg = M_MD5; 144 } else if (name.endsWith("_SHA")) { 145 macAlg = M_SHA; 146 } else if (name.endsWith("_SHA256")) { 147 macAlg = M_SHA256; 148 } else if (name.endsWith("_SHA384")) { 149 macAlg = M_SHA384; 150 } else if (name.endsWith("_NULL")) { 151 macAlg = M_NULL; 152 } else if (name.endsWith("_SCSV")) { 153 macAlg = M_NULL; 154 } else { 155 throw new IllegalArgumentException 156 ("Unknown MAC algorithm for ciphersuite " + name); 157 } 158 159 allowed &= keyExchange.allowed; 160 allowed &= cipher.allowed; 161 this.allowed = allowed; 162 this.obsoleted = obsoleted; 163 this.supported = supported; 164 this.prfAlg = prfAlg; 165 } 166 167 /** 168 * Constructor for unimplemented CipherSuites. 169 */ 170 private CipherSuite(String name, int id) { 171 this.name = name; 172 this.id = id; 173 this.allowed = false; 174 175 this.priority = 0; 176 this.keyExchange = null; 177 this.cipher = null; 178 this.macAlg = null; 179 this.exportable = false; 180 this.obsoleted = ProtocolVersion.LIMIT_MAX_VALUE; 181 this.supported = ProtocolVersion.LIMIT_MIN_VALUE; 182 this.prfAlg = P_NONE; 183 } 184 185 /** 186 * Return whether this CipherSuite is available for use. A 187 * CipherSuite may be unavailable even if it is supported 188 * (i.e. allowed == true) if the required JCE cipher is not installed. 189 * In some configuration, this situation may change over time, call 190 * CipherSuiteList.clearAvailableCache() before this method to obtain 191 * the most current status. 192 */ 193 boolean isAvailable() { 194 return allowed && keyExchange.isAvailable() && cipher.isAvailable(); 195 } 196 197 boolean isNegotiable() { 198 return this != C_SCSV && isAvailable(); 199 } 200 201 /** 202 * Compares CipherSuites based on their priority. Has the effect of 203 * sorting CipherSuites when put in a sorted collection, which is 204 * used by CipherSuiteList. Follows standard Comparable contract. 205 * 206 * Note that for unsupported CipherSuites parsed from a handshake 207 * message we violate the equals() contract. 208 */ 209 @Override 210 public int compareTo(CipherSuite o) { 211 return o.priority - priority; 212 } 213 214 /** 215 * Returns this.name. 216 */ 217 @Override 218 public String toString() { 219 return name; 220 } 221 222 /** 223 * Return a CipherSuite for the given name. The returned CipherSuite 224 * is supported by this implementation but may not actually be 225 * currently useable. See isAvailable(). 226 * 227 * @exception IllegalArgumentException if the CipherSuite is unknown or 228 * unsupported. 229 */ 230 static CipherSuite valueOf(String s) { 231 if (s == null) { 232 throw new IllegalArgumentException("Name must not be null"); 233 } 234 235 CipherSuite c = nameMap.get(s); 236 if ((c == null) || (c.allowed == false)) { 237 throw new IllegalArgumentException("Unsupported ciphersuite " + s); 238 } 239 240 return c; 241 } 242 243 /** 244 * Return a CipherSuite with the given ID. A temporary object is 245 * constructed if the ID is unknown. Use isAvailable() to verify that 246 * the CipherSuite can actually be used. 247 */ 248 static CipherSuite valueOf(int id1, int id2) { 249 id1 &= 0xff; 250 id2 &= 0xff; 251 int id = (id1 << 8) | id2; 252 CipherSuite c = idMap.get(id); 253 if (c == null) { 254 String h1 = Integer.toString(id1, 16); 255 String h2 = Integer.toString(id2, 16); 256 c = new CipherSuite("Unknown 0x" + h1 + ":0x" + h2, id); 257 } 258 return c; 259 } 260 261 // for use by CipherSuiteList only 262 static Collection<CipherSuite> allowedCipherSuites() { 263 return nameMap.values(); 264 } 265 266 /* 267 * Use this method when all of the values need to be specified. 268 * This is primarily used when defining a new ciphersuite for 269 * TLS 1.2+ that doesn't use the "default" PRF. 270 */ 271 private static void add(String name, int id, int priority, 272 KeyExchange keyExchange, BulkCipher cipher, 273 boolean allowed, int obsoleted, int supported, PRF prf) { 274 275 CipherSuite c = new CipherSuite(name, id, priority, keyExchange, 276 cipher, allowed, obsoleted, supported, prf); 277 if (idMap.put(id, c) != null) { 278 throw new RuntimeException("Duplicate ciphersuite definition: " 279 + id + ", " + name); 280 } 281 if (c.allowed) { 282 if (nameMap.put(name, c) != null) { 283 throw new RuntimeException("Duplicate ciphersuite definition: " 284 + id + ", " + name); 285 } 286 } 287 } 288 289 /* 290 * Use this method when there is no lower protocol limit where this 291 * suite can be used, and the PRF is P_SHA256. That is, the 292 * existing ciphersuites. From RFC 5246: 293 * 294 * All cipher suites in this document use P_SHA256. 295 */ 296 private static void add(String name, int id, int priority, 297 KeyExchange keyExchange, BulkCipher cipher, 298 boolean allowed, int obsoleted) { 299 // If this is an obsoleted suite, then don't let the TLS 1.2 300 // protocol have a valid PRF value. 301 PRF prf = P_SHA256; 302 if (obsoleted < ProtocolVersion.TLS12.v) { 303 prf = P_NONE; 304 } 305 306 add(name, id, priority, keyExchange, cipher, allowed, obsoleted, 307 ProtocolVersion.LIMIT_MIN_VALUE, prf); 308 } 309 310 /* 311 * Use this method when there is no upper protocol limit. That is, 312 * suites which have not been obsoleted. 313 */ 314 private static void add(String name, int id, int priority, 315 KeyExchange keyExchange, BulkCipher cipher, boolean allowed) { 316 add(name, id, priority, keyExchange, 317 cipher, allowed, ProtocolVersion.LIMIT_MAX_VALUE); 318 } 319 320 /* 321 * Use this method to define an unimplemented suite. This provides 322 * a number<->name mapping that can be used for debugging. 323 */ 324 private static void add(String name, int id) { 325 CipherSuite c = new CipherSuite(name, id); 326 if (idMap.put(id, c) != null) { 327 throw new RuntimeException("Duplicate ciphersuite definition: " 328 + id + ", " + name); 329 } 330 } 331 332 /** 333 * An SSL/TLS key exchange algorithm. 334 */ 335 static enum KeyExchange { 336 337 // key exchange algorithms 338 K_NULL ("NULL", false), 339 K_RSA ("RSA", true), 340 K_RSA_EXPORT ("RSA_EXPORT", true), 341 K_DH_RSA ("DH_RSA", false), 342 K_DH_DSS ("DH_DSS", false), 343 K_DHE_DSS ("DHE_DSS", true), 344 K_DHE_RSA ("DHE_RSA", true), 345 K_DH_ANON ("DH_anon", true), 346 347 K_ECDH_ECDSA ("ECDH_ECDSA", ALLOW_ECC), 348 K_ECDH_RSA ("ECDH_RSA", ALLOW_ECC), 349 K_ECDHE_ECDSA("ECDHE_ECDSA", ALLOW_ECC), 350 K_ECDHE_RSA ("ECDHE_RSA", ALLOW_ECC), 351 K_ECDH_ANON ("ECDH_anon", ALLOW_ECC), 352 353 // Kerberos cipher suites 354 K_KRB5 ("KRB5", true), 355 K_KRB5_EXPORT("KRB5_EXPORT", true), 356 357 // renegotiation protection request signaling cipher suite 358 K_SCSV ("SCSV", true), 359 360 // fallback signaling cipher suite 361 K_FALLBACK_SCSV ("FALLBACK_SCSV", false); 362 363 // name of the key exchange algorithm, e.g. DHE_DSS 364 final String name; 365 final boolean allowed; 366 private final boolean alwaysAvailable; 367 368 KeyExchange(String name, boolean allowed) { 369 this.name = name; 370 this.allowed = allowed; 371 this.alwaysAvailable = allowed && 372 (!name.startsWith("EC")) && (!name.startsWith("KRB")); 373 } 374 375 boolean isAvailable() { 376 if (alwaysAvailable) { 377 return true; 378 } 379 380 if (name.startsWith("EC")) { 381 return (allowed && JsseJce.isEcAvailable()); 382 } else if (name.startsWith("KRB")) { 383 return (allowed && JsseJce.isKerberosAvailable()); 384 } else { 385 return allowed; 386 } 387 } 388 389 @Override 390 public String toString() { 391 return name; 392 } 393 } 394 395 static enum CipherType { 396 STREAM_CIPHER, // null or stream cipher 397 BLOCK_CIPHER, // block cipher in CBC mode 398 AEAD_CIPHER // AEAD cipher 399 } 400 401 /** 402 * An SSL/TLS bulk cipher algorithm. One instance per combination of 403 * cipher and key length. 404 * 405 * Also contains a factory method to obtain in initialized CipherBox 406 * for this algorithm. 407 */ 408 final static class BulkCipher { 409 410 // Map BulkCipher -> Boolean(available) 411 private final static Map<BulkCipher,Boolean> availableCache = 412 new HashMap<>(8); 413 414 // descriptive name including key size, e.g. AES/128 415 final String description; 416 417 // JCE cipher transformation string, e.g. AES/CBC/NoPadding 418 final String transformation; 419 420 // algorithm name, e.g. AES 421 final String algorithm; 422 423 // supported and compile time enabled. Also see isAvailable() 424 final boolean allowed; 425 426 // number of bytes of entropy in the key 427 final int keySize; 428 429 // length of the actual cipher key in bytes. 430 // for non-exportable ciphers, this is the same as keySize 431 final int expandedKeySize; 432 433 // size of the IV 434 final int ivSize; 435 436 // size of fixed IV 437 // 438 // record_iv_length = ivSize - fixedIvSize 439 final int fixedIvSize; 440 441 // exportable under 512/40 bit rules 442 final boolean exportable; 443 444 // Is the cipher algorithm of Cipher Block Chaining (CBC) mode? 445 final CipherType cipherType; 446 447 // size of the authentication tag, only applicable to cipher suites in 448 // Galois Counter Mode (GCM) 449 // 450 // As far as we know, all supported GCM cipher suites use 128-bits 451 // authentication tags. 452 final int tagSize = 16; 453 454 // The secure random used to detect the cipher availability. 455 private final static SecureRandom secureRandom; 456 457 static { 458 try { 459 secureRandom = JsseJce.getSecureRandom(); 460 } catch (KeyManagementException kme) { 461 throw new RuntimeException(kme); 462 } 463 } 464 465 BulkCipher(String transformation, CipherType cipherType, int keySize, 466 int expandedKeySize, int ivSize, 467 int fixedIvSize, boolean allowed) { 468 469 this.transformation = transformation; 470 String[] splits = transformation.split("/"); 471 this.algorithm = splits[0]; 472 this.cipherType = cipherType; 473 this.description = this.algorithm + "/" + (keySize << 3); 474 this.keySize = keySize; 475 this.ivSize = ivSize; 476 this.fixedIvSize = fixedIvSize; 477 this.allowed = allowed; 478 479 this.expandedKeySize = expandedKeySize; 480 this.exportable = true; 481 } 482 483 BulkCipher(String transformation, CipherType cipherType, int keySize, 484 int ivSize, int fixedIvSize, boolean allowed) { 485 this.transformation = transformation; 486 String[] splits = transformation.split("/"); 487 this.algorithm = splits[0]; 488 this.cipherType = cipherType; 489 this.description = this.algorithm + "/" + (keySize << 3); 490 this.keySize = keySize; 491 this.ivSize = ivSize; 492 this.fixedIvSize = fixedIvSize; 493 this.allowed = allowed; 494 495 this.expandedKeySize = keySize; 496 this.exportable = false; 497 } 498 499 /** 500 * Return an initialized CipherBox for this BulkCipher. 501 * IV must be null for stream ciphers. 502 * 503 * @exception NoSuchAlgorithmException if anything goes wrong 504 */ 505 CipherBox newCipher(ProtocolVersion version, SecretKey key, 506 IvParameterSpec iv, SecureRandom random, 507 boolean encrypt) throws NoSuchAlgorithmException { 508 return CipherBox.newCipherBox(version, this, 509 key, iv, random, encrypt); 510 } 511 512 /** 513 * Test if this bulk cipher is available. For use by CipherSuite. 514 * 515 * Currently all supported ciphers except AES are always available 516 * via the JSSE internal implementations. We also assume AES/128 of 517 * CBC mode is always available since it is shipped with the SunJCE 518 * provider. However, AES/256 is unavailable when the default JCE 519 * policy jurisdiction files are installed because of key length 520 * restrictions, and AEAD is unavailable when the underlying providers 521 * do not support AEAD/GCM mode. 522 */ 523 boolean isAvailable() { 524 if (allowed == false) { 525 return false; 526 } 527 528 if ((this == B_AES_256) || 529 (this.cipherType == CipherType.AEAD_CIPHER)) { 530 return isAvailable(this); 531 } 532 533 // always available 534 return true; 535 } 536 537 // for use by CipherSuiteList.clearAvailableCache(); 538 static synchronized void clearAvailableCache() { 539 if (DYNAMIC_AVAILABILITY) { 540 availableCache.clear(); 541 } 542 } 543 544 private static synchronized boolean isAvailable(BulkCipher cipher) { 545 Boolean b = availableCache.get(cipher); 546 if (b == null) { 547 int keySizeInBits = cipher.keySize * 8; 548 if (keySizeInBits > 128) { // need the JCE unlimited 549 // strength jurisdiction policy 550 try { 551 if (Cipher.getMaxAllowedKeyLength( 552 cipher.transformation) < keySizeInBits) { 553 b = Boolean.FALSE; 554 } 555 } catch (Exception e) { 556 b = Boolean.FALSE; 557 } 558 } 559 560 if (b == null) { 561 b = Boolean.FALSE; // may be reset to TRUE if 562 // the cipher is available 563 CipherBox temporary = null; 564 try { 565 SecretKey key = new SecretKeySpec( 566 new byte[cipher.expandedKeySize], 567 cipher.algorithm); 568 IvParameterSpec iv; 569 if (cipher.cipherType == CipherType.AEAD_CIPHER) { 570 iv = new IvParameterSpec( 571 new byte[cipher.fixedIvSize]); 572 } else { 573 iv = new IvParameterSpec(new byte[cipher.ivSize]); 574 } 575 temporary = cipher.newCipher( 576 ProtocolVersion.DEFAULT, 577 key, iv, secureRandom, true); 578 b = temporary.isAvailable(); 579 } catch (NoSuchAlgorithmException e) { 580 // not available 581 } finally { 582 if (temporary != null) { 583 temporary.dispose(); 584 } 585 } 586 } 587 588 availableCache.put(cipher, b); 589 } 590 591 return b.booleanValue(); 592 } 593 594 @Override 595 public String toString() { 596 return description; 597 } 598 } 599 600 /** 601 * An SSL/TLS key MAC algorithm. 602 * 603 * Also contains a factory method to obtain an initialized MAC 604 * for this algorithm. 605 */ 606 final static class MacAlg { 607 608 // descriptive name, e.g. MD5 609 final String name; 610 611 // size of the MAC value (and MAC key) in bytes 612 final int size; 613 614 // block size of the underlying hash algorithm 615 final int hashBlockSize; 616 617 // minimal padding size of the underlying hash algorithm 618 final int minimalPaddingSize; 619 620 MacAlg(String name, int size, 621 int hashBlockSize, int minimalPaddingSize) { 622 this.name = name; 623 this.size = size; 624 this.hashBlockSize = hashBlockSize; 625 this.minimalPaddingSize = minimalPaddingSize; 626 } 627 628 /** 629 * Return an initialized MAC for this MacAlg. ProtocolVersion 630 * must either be SSL30 (SSLv3 custom MAC) or TLS10 (std. HMAC). 631 * 632 * @exception NoSuchAlgorithmException if anything goes wrong 633 */ 634 MAC newMac(ProtocolVersion protocolVersion, SecretKey secret) 635 throws NoSuchAlgorithmException, InvalidKeyException { 636 return new MAC(this, protocolVersion, secret); 637 } 638 639 @Override 640 public String toString() { 641 return name; 642 } 643 } 644 645 // export strength ciphers 646 final static BulkCipher B_NULL = 647 new BulkCipher("NULL", STREAM_CIPHER, 0, 0, 0, 0, true); 648 final static BulkCipher B_RC4_40 = 649 new BulkCipher(CIPHER_RC4, STREAM_CIPHER, 5, 16, 0, 0, true); 650 final static BulkCipher B_RC2_40 = 651 new BulkCipher("RC2", BLOCK_CIPHER, 5, 16, 8, 0, false); 652 final static BulkCipher B_DES_40 = 653 new BulkCipher(CIPHER_DES, BLOCK_CIPHER, 5, 8, 8, 0, true); 654 655 // domestic strength ciphers 656 final static BulkCipher B_RC4_128 = 657 new BulkCipher(CIPHER_RC4, STREAM_CIPHER, 16, 0, 0, true); 658 final static BulkCipher B_DES = 659 new BulkCipher(CIPHER_DES, BLOCK_CIPHER, 8, 8, 0, true); 660 final static BulkCipher B_3DES = 661 new BulkCipher(CIPHER_3DES, BLOCK_CIPHER, 24, 8, 0, true); 662 final static BulkCipher B_IDEA = 663 new BulkCipher("IDEA", BLOCK_CIPHER, 16, 8, 0, false); 664 final static BulkCipher B_AES_128 = 665 new BulkCipher(CIPHER_AES, BLOCK_CIPHER, 16, 16, 0, true); 666 final static BulkCipher B_AES_256 = 667 new BulkCipher(CIPHER_AES, BLOCK_CIPHER, 32, 16, 0, true); 668 final static BulkCipher B_AES_128_GCM = 669 new BulkCipher(CIPHER_AES_GCM, AEAD_CIPHER, 16, 12, 4, true); 670 final static BulkCipher B_AES_256_GCM = 671 new BulkCipher(CIPHER_AES_GCM, AEAD_CIPHER, 32, 12, 4, true); 672 673 // MACs 674 final static MacAlg M_NULL = new MacAlg("NULL", 0, 0, 0); 675 final static MacAlg M_MD5 = new MacAlg("MD5", 16, 64, 9); 676 final static MacAlg M_SHA = new MacAlg("SHA", 20, 64, 9); 677 final static MacAlg M_SHA256 = new MacAlg("SHA256", 32, 64, 9); 678 final static MacAlg M_SHA384 = new MacAlg("SHA384", 48, 128, 17); 679 680 /** 681 * PRFs (PseudoRandom Function) from TLS specifications. 682 * 683 * TLS 1.1- uses a single MD5/SHA1-based PRF algorithm for generating 684 * the necessary material. 685 * 686 * In TLS 1.2+, all existing/known CipherSuites use SHA256, however 687 * new Ciphersuites (e.g. RFC 5288) can define specific PRF hash 688 * algorithms. 689 */ 690 static enum PRF { 691 692 // PRF algorithms 693 P_NONE( "NONE", 0, 0), 694 P_SHA256("SHA-256", 32, 64), 695 P_SHA384("SHA-384", 48, 128), 696 P_SHA512("SHA-512", 64, 128); // not currently used. 697 698 // PRF characteristics 699 private final String prfHashAlg; 700 private final int prfHashLength; 701 private final int prfBlockSize; 702 703 PRF(String prfHashAlg, int prfHashLength, int prfBlockSize) { 704 this.prfHashAlg = prfHashAlg; 705 this.prfHashLength = prfHashLength; 706 this.prfBlockSize = prfBlockSize; 707 } 708 709 String getPRFHashAlg() { 710 return prfHashAlg; 711 } 712 713 int getPRFHashLength() { 714 return prfHashLength; 715 } 716 717 int getPRFBlockSize() { 718 return prfBlockSize; 719 } 720 } 721 722 static { 723 idMap = new HashMap<Integer,CipherSuite>(); 724 nameMap = new HashMap<String,CipherSuite>(); 725 726 final boolean F = false; 727 final boolean T = true; 728 // N: ciphersuites only allowed if we are not in FIPS mode 729 final boolean N = (SunJSSE.isFIPS() == false); 730 731 /* 732 * TLS Cipher Suite Registry, as of August 2010. 733 * 734 * http://www.iana.org/assignments/tls-parameters/tls-parameters.xml 735 * 736 * Range Registration Procedures Notes 737 * 000-191 Standards Action Refers to value of first byte 738 * 192-254 Specification Required Refers to value of first byte 739 * 255 Reserved for Private Use Refers to value of first byte 740 * 741 * Value Description Reference 742 * 0x00,0x00 TLS_NULL_WITH_NULL_NULL [RFC5246] 743 * 0x00,0x01 TLS_RSA_WITH_NULL_MD5 [RFC5246] 744 * 0x00,0x02 TLS_RSA_WITH_NULL_SHA [RFC5246] 745 * 0x00,0x03 TLS_RSA_EXPORT_WITH_RC4_40_MD5 [RFC4346] 746 * 0x00,0x04 TLS_RSA_WITH_RC4_128_MD5 [RFC5246] 747 * 0x00,0x05 TLS_RSA_WITH_RC4_128_SHA [RFC5246] 748 * 0x00,0x06 TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 [RFC4346] 749 * 0x00,0x07 TLS_RSA_WITH_IDEA_CBC_SHA [RFC5469] 750 * 0x00,0x08 TLS_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346] 751 * 0x00,0x09 TLS_RSA_WITH_DES_CBC_SHA [RFC5469] 752 * 0x00,0x0A TLS_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246] 753 * 0x00,0x0B TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA [RFC4346] 754 * 0x00,0x0C TLS_DH_DSS_WITH_DES_CBC_SHA [RFC5469] 755 * 0x00,0x0D TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA [RFC5246] 756 * 0x00,0x0E TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346] 757 * 0x00,0x0F TLS_DH_RSA_WITH_DES_CBC_SHA [RFC5469] 758 * 0x00,0x10 TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246] 759 * 0x00,0x11 TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA [RFC4346] 760 * 0x00,0x12 TLS_DHE_DSS_WITH_DES_CBC_SHA [RFC5469] 761 * 0x00,0x13 TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA [RFC5246] 762 * 0x00,0x14 TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346] 763 * 0x00,0x15 TLS_DHE_RSA_WITH_DES_CBC_SHA [RFC5469] 764 * 0x00,0x16 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246] 765 * 0x00,0x17 TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 [RFC4346] 766 * 0x00,0x18 TLS_DH_anon_WITH_RC4_128_MD5 [RFC5246] 767 * 0x00,0x19 TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA [RFC4346] 768 * 0x00,0x1A TLS_DH_anon_WITH_DES_CBC_SHA [RFC5469] 769 * 0x00,0x1B TLS_DH_anon_WITH_3DES_EDE_CBC_SHA [RFC5246] 770 * 0x00,0x1C-1D Reserved to avoid conflicts with SSLv3 [RFC5246] 771 * 0x00,0x1E TLS_KRB5_WITH_DES_CBC_SHA [RFC2712] 772 * 0x00,0x1F TLS_KRB5_WITH_3DES_EDE_CBC_SHA [RFC2712] 773 * 0x00,0x20 TLS_KRB5_WITH_RC4_128_SHA [RFC2712] 774 * 0x00,0x21 TLS_KRB5_WITH_IDEA_CBC_SHA [RFC2712] 775 * 0x00,0x22 TLS_KRB5_WITH_DES_CBC_MD5 [RFC2712] 776 * 0x00,0x23 TLS_KRB5_WITH_3DES_EDE_CBC_MD5 [RFC2712] 777 * 0x00,0x24 TLS_KRB5_WITH_RC4_128_MD5 [RFC2712] 778 * 0x00,0x25 TLS_KRB5_WITH_IDEA_CBC_MD5 [RFC2712] 779 * 0x00,0x26 TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA [RFC2712] 780 * 0x00,0x27 TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA [RFC2712] 781 * 0x00,0x28 TLS_KRB5_EXPORT_WITH_RC4_40_SHA [RFC2712] 782 * 0x00,0x29 TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 [RFC2712] 783 * 0x00,0x2A TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 [RFC2712] 784 * 0x00,0x2B TLS_KRB5_EXPORT_WITH_RC4_40_MD5 [RFC2712] 785 * 0x00,0x2C TLS_PSK_WITH_NULL_SHA [RFC4785] 786 * 0x00,0x2D TLS_DHE_PSK_WITH_NULL_SHA [RFC4785] 787 * 0x00,0x2E TLS_RSA_PSK_WITH_NULL_SHA [RFC4785] 788 * 0x00,0x2F TLS_RSA_WITH_AES_128_CBC_SHA [RFC5246] 789 * 0x00,0x30 TLS_DH_DSS_WITH_AES_128_CBC_SHA [RFC5246] 790 * 0x00,0x31 TLS_DH_RSA_WITH_AES_128_CBC_SHA [RFC5246] 791 * 0x00,0x32 TLS_DHE_DSS_WITH_AES_128_CBC_SHA [RFC5246] 792 * 0x00,0x33 TLS_DHE_RSA_WITH_AES_128_CBC_SHA [RFC5246] 793 * 0x00,0x34 TLS_DH_anon_WITH_AES_128_CBC_SHA [RFC5246] 794 * 0x00,0x35 TLS_RSA_WITH_AES_256_CBC_SHA [RFC5246] 795 * 0x00,0x36 TLS_DH_DSS_WITH_AES_256_CBC_SHA [RFC5246] 796 * 0x00,0x37 TLS_DH_RSA_WITH_AES_256_CBC_SHA [RFC5246] 797 * 0x00,0x38 TLS_DHE_DSS_WITH_AES_256_CBC_SHA [RFC5246] 798 * 0x00,0x39 TLS_DHE_RSA_WITH_AES_256_CBC_SHA [RFC5246] 799 * 0x00,0x3A TLS_DH_anon_WITH_AES_256_CBC_SHA [RFC5246] 800 * 0x00,0x3B TLS_RSA_WITH_NULL_SHA256 [RFC5246] 801 * 0x00,0x3C TLS_RSA_WITH_AES_128_CBC_SHA256 [RFC5246] 802 * 0x00,0x3D TLS_RSA_WITH_AES_256_CBC_SHA256 [RFC5246] 803 * 0x00,0x3E TLS_DH_DSS_WITH_AES_128_CBC_SHA256 [RFC5246] 804 * 0x00,0x3F TLS_DH_RSA_WITH_AES_128_CBC_SHA256 [RFC5246] 805 * 0x00,0x40 TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 [RFC5246] 806 * 0x00,0x41 TLS_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932] 807 * 0x00,0x42 TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA [RFC5932] 808 * 0x00,0x43 TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932] 809 * 0x00,0x44 TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA [RFC5932] 810 * 0x00,0x45 TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932] 811 * 0x00,0x46 TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA [RFC5932] 812 * 0x00,0x47-4F Reserved to avoid conflicts with 813 * deployed implementations [Pasi_Eronen] 814 * 0x00,0x50-58 Reserved to avoid conflicts [Pasi Eronen] 815 * 0x00,0x59-5C Reserved to avoid conflicts with 816 * deployed implementations [Pasi_Eronen] 817 * 0x00,0x5D-5F Unassigned 818 * 0x00,0x60-66 Reserved to avoid conflicts with widely 819 * deployed implementations [Pasi_Eronen] 820 * 0x00,0x67 TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 [RFC5246] 821 * 0x00,0x68 TLS_DH_DSS_WITH_AES_256_CBC_SHA256 [RFC5246] 822 * 0x00,0x69 TLS_DH_RSA_WITH_AES_256_CBC_SHA256 [RFC5246] 823 * 0x00,0x6A TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 [RFC5246] 824 * 0x00,0x6B TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 [RFC5246] 825 * 0x00,0x6C TLS_DH_anon_WITH_AES_128_CBC_SHA256 [RFC5246] 826 * 0x00,0x6D TLS_DH_anon_WITH_AES_256_CBC_SHA256 [RFC5246] 827 * 0x00,0x6E-83 Unassigned 828 * 0x00,0x84 TLS_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932] 829 * 0x00,0x85 TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA [RFC5932] 830 * 0x00,0x86 TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932] 831 * 0x00,0x87 TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA [RFC5932] 832 * 0x00,0x88 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932] 833 * 0x00,0x89 TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA [RFC5932] 834 * 0x00,0x8A TLS_PSK_WITH_RC4_128_SHA [RFC4279] 835 * 0x00,0x8B TLS_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279] 836 * 0x00,0x8C TLS_PSK_WITH_AES_128_CBC_SHA [RFC4279] 837 * 0x00,0x8D TLS_PSK_WITH_AES_256_CBC_SHA [RFC4279] 838 * 0x00,0x8E TLS_DHE_PSK_WITH_RC4_128_SHA [RFC4279] 839 * 0x00,0x8F TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279] 840 * 0x00,0x90 TLS_DHE_PSK_WITH_AES_128_CBC_SHA [RFC4279] 841 * 0x00,0x91 TLS_DHE_PSK_WITH_AES_256_CBC_SHA [RFC4279] 842 * 0x00,0x92 TLS_RSA_PSK_WITH_RC4_128_SHA [RFC4279] 843 * 0x00,0x93 TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279] 844 * 0x00,0x94 TLS_RSA_PSK_WITH_AES_128_CBC_SHA [RFC4279] 845 * 0x00,0x95 TLS_RSA_PSK_WITH_AES_256_CBC_SHA [RFC4279] 846 * 0x00,0x96 TLS_RSA_WITH_SEED_CBC_SHA [RFC4162] 847 * 0x00,0x97 TLS_DH_DSS_WITH_SEED_CBC_SHA [RFC4162] 848 * 0x00,0x98 TLS_DH_RSA_WITH_SEED_CBC_SHA [RFC4162] 849 * 0x00,0x99 TLS_DHE_DSS_WITH_SEED_CBC_SHA [RFC4162] 850 * 0x00,0x9A TLS_DHE_RSA_WITH_SEED_CBC_SHA [RFC4162] 851 * 0x00,0x9B TLS_DH_anon_WITH_SEED_CBC_SHA [RFC4162] 852 * 0x00,0x9C TLS_RSA_WITH_AES_128_GCM_SHA256 [RFC5288] 853 * 0x00,0x9D TLS_RSA_WITH_AES_256_GCM_SHA384 [RFC5288] 854 * 0x00,0x9E TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 [RFC5288] 855 * 0x00,0x9F TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 [RFC5288] 856 * 0x00,0xA0 TLS_DH_RSA_WITH_AES_128_GCM_SHA256 [RFC5288] 857 * 0x00,0xA1 TLS_DH_RSA_WITH_AES_256_GCM_SHA384 [RFC5288] 858 * 0x00,0xA2 TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 [RFC5288] 859 * 0x00,0xA3 TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 [RFC5288] 860 * 0x00,0xA4 TLS_DH_DSS_WITH_AES_128_GCM_SHA256 [RFC5288] 861 * 0x00,0xA5 TLS_DH_DSS_WITH_AES_256_GCM_SHA384 [RFC5288] 862 * 0x00,0xA6 TLS_DH_anon_WITH_AES_128_GCM_SHA256 [RFC5288] 863 * 0x00,0xA7 TLS_DH_anon_WITH_AES_256_GCM_SHA384 [RFC5288] 864 * 0x00,0xA8 TLS_PSK_WITH_AES_128_GCM_SHA256 [RFC5487] 865 * 0x00,0xA9 TLS_PSK_WITH_AES_256_GCM_SHA384 [RFC5487] 866 * 0x00,0xAA TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 [RFC5487] 867 * 0x00,0xAB TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 [RFC5487] 868 * 0x00,0xAC TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 [RFC5487] 869 * 0x00,0xAD TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 [RFC5487] 870 * 0x00,0xAE TLS_PSK_WITH_AES_128_CBC_SHA256 [RFC5487] 871 * 0x00,0xAF TLS_PSK_WITH_AES_256_CBC_SHA384 [RFC5487] 872 * 0x00,0xB0 TLS_PSK_WITH_NULL_SHA256 [RFC5487] 873 * 0x00,0xB1 TLS_PSK_WITH_NULL_SHA384 [RFC5487] 874 * 0x00,0xB2 TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 [RFC5487] 875 * 0x00,0xB3 TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 [RFC5487] 876 * 0x00,0xB4 TLS_DHE_PSK_WITH_NULL_SHA256 [RFC5487] 877 * 0x00,0xB5 TLS_DHE_PSK_WITH_NULL_SHA384 [RFC5487] 878 * 0x00,0xB6 TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 [RFC5487] 879 * 0x00,0xB7 TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 [RFC5487] 880 * 0x00,0xB8 TLS_RSA_PSK_WITH_NULL_SHA256 [RFC5487] 881 * 0x00,0xB9 TLS_RSA_PSK_WITH_NULL_SHA384 [RFC5487] 882 * 0x00,0xBA TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] 883 * 0x00,0xBB TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] 884 * 0x00,0xBC TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] 885 * 0x00,0xBD TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] 886 * 0x00,0xBE TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] 887 * 0x00,0xBF TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] 888 * 0x00,0xC0 TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] 889 * 0x00,0xC1 TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] 890 * 0x00,0xC2 TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] 891 * 0x00,0xC3 TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] 892 * 0x00,0xC4 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] 893 * 0x00,0xC5 TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] 894 * 0x00,0xC6-FE Unassigned 895 * 0x00,0xFF TLS_EMPTY_RENEGOTIATION_INFO_SCSV [RFC5746] 896 * 0x01-BF,* Unassigned 897 * 0xC0,0x01 TLS_ECDH_ECDSA_WITH_NULL_SHA [RFC4492] 898 * 0xC0,0x02 TLS_ECDH_ECDSA_WITH_RC4_128_SHA [RFC4492] 899 * 0xC0,0x03 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA [RFC4492] 900 * 0xC0,0x04 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA [RFC4492] 901 * 0xC0,0x05 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA [RFC4492] 902 * 0xC0,0x06 TLS_ECDHE_ECDSA_WITH_NULL_SHA [RFC4492] 903 * 0xC0,0x07 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA [RFC4492] 904 * 0xC0,0x08 TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA [RFC4492] 905 * 0xC0,0x09 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA [RFC4492] 906 * 0xC0,0x0A TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA [RFC4492] 907 * 0xC0,0x0B TLS_ECDH_RSA_WITH_NULL_SHA [RFC4492] 908 * 0xC0,0x0C TLS_ECDH_RSA_WITH_RC4_128_SHA [RFC4492] 909 * 0xC0,0x0D TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA [RFC4492] 910 * 0xC0,0x0E TLS_ECDH_RSA_WITH_AES_128_CBC_SHA [RFC4492] 911 * 0xC0,0x0F TLS_ECDH_RSA_WITH_AES_256_CBC_SHA [RFC4492] 912 * 0xC0,0x10 TLS_ECDHE_RSA_WITH_NULL_SHA [RFC4492] 913 * 0xC0,0x11 TLS_ECDHE_RSA_WITH_RC4_128_SHA [RFC4492] 914 * 0xC0,0x12 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA [RFC4492] 915 * 0xC0,0x13 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA [RFC4492] 916 * 0xC0,0x14 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA [RFC4492] 917 * 0xC0,0x15 TLS_ECDH_anon_WITH_NULL_SHA [RFC4492] 918 * 0xC0,0x16 TLS_ECDH_anon_WITH_RC4_128_SHA [RFC4492] 919 * 0xC0,0x17 TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA [RFC4492] 920 * 0xC0,0x18 TLS_ECDH_anon_WITH_AES_128_CBC_SHA [RFC4492] 921 * 0xC0,0x19 TLS_ECDH_anon_WITH_AES_256_CBC_SHA [RFC4492] 922 * 0xC0,0x1A TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA [RFC5054] 923 * 0xC0,0x1B TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA [RFC5054] 924 * 0xC0,0x1C TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA [RFC5054] 925 * 0xC0,0x1D TLS_SRP_SHA_WITH_AES_128_CBC_SHA [RFC5054] 926 * 0xC0,0x1E TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA [RFC5054] 927 * 0xC0,0x1F TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA [RFC5054] 928 * 0xC0,0x20 TLS_SRP_SHA_WITH_AES_256_CBC_SHA [RFC5054] 929 * 0xC0,0x21 TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA [RFC5054] 930 * 0xC0,0x22 TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA [RFC5054] 931 * 0xC0,0x23 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 [RFC5289] 932 * 0xC0,0x24 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 [RFC5289] 933 * 0xC0,0x25 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 [RFC5289] 934 * 0xC0,0x26 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 [RFC5289] 935 * 0xC0,0x27 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 [RFC5289] 936 * 0xC0,0x28 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 [RFC5289] 937 * 0xC0,0x29 TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 [RFC5289] 938 * 0xC0,0x2A TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 [RFC5289] 939 * 0xC0,0x2B TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 [RFC5289] 940 * 0xC0,0x2C TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 [RFC5289] 941 * 0xC0,0x2D TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 [RFC5289] 942 * 0xC0,0x2E TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 [RFC5289] 943 * 0xC0,0x2F TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 [RFC5289] 944 * 0xC0,0x30 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 [RFC5289] 945 * 0xC0,0x31 TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 [RFC5289] 946 * 0xC0,0x32 TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 [RFC5289] 947 * 0xC0,0x33 TLS_ECDHE_PSK_WITH_RC4_128_SHA [RFC5489] 948 * 0xC0,0x34 TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA [RFC5489] 949 * 0xC0,0x35 TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA [RFC5489] 950 * 0xC0,0x36 TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA [RFC5489] 951 * 0xC0,0x37 TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 [RFC5489] 952 * 0xC0,0x38 TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 [RFC5489] 953 * 0xC0,0x39 TLS_ECDHE_PSK_WITH_NULL_SHA [RFC5489] 954 * 0xC0,0x3A TLS_ECDHE_PSK_WITH_NULL_SHA256 [RFC5489] 955 * 0xC0,0x3B TLS_ECDHE_PSK_WITH_NULL_SHA384 [RFC5489] 956 * 0xC0,0x3C-FF Unassigned 957 * 0xC1-FD,* Unassigned 958 * 0xFE,0x00-FD Unassigned 959 * 0xFE,0xFE-FF Reserved to avoid conflicts with widely 960 * deployed implementations [Pasi_Eronen] 961 * 0xFF,0x00-FF Reserved for Private Use [RFC5246] 962 */ 963 964 add("SSL_NULL_WITH_NULL_NULL", 965 0x0000, 1, K_NULL, B_NULL, F); 966 967 /* 968 * Definition of the CipherSuites that are enabled by default. 969 * They are listed in preference order, most preferred first, using 970 * the following criteria: 971 * 1. Prefer Suite B compliant cipher suites, see RFC6460 (To be 972 * changed later, see below). 973 * 2. Prefer the stronger bulk cipher, in the order of AES_256(GCM), 974 * AES_128(GCM), AES_256, AES_128, RC-4, 3DES-EDE. 975 * 3. Prefer the stronger MAC algorithm, in the order of SHA384, 976 * SHA256, SHA, MD5. 977 * 4. Prefer the better performance of key exchange and digital 978 * signature algorithm, in the order of ECDHE-ECDSA, ECDHE-RSA, 979 * RSA, ECDH-ECDSA, ECDH-RSA, DHE-RSA, DHE-DSS. 980 */ 981 int p = DEFAULT_SUITES_PRIORITY * 2; 982 983 // shorten names to fit the following table cleanly. 984 int max = ProtocolVersion.LIMIT_MAX_VALUE; 985 int tls11 = ProtocolVersion.TLS11.v; 986 int tls12 = ProtocolVersion.TLS12.v; 987 988 // ID Key Exchange Cipher A obs suprt PRF 989 // ====== ============ ========= = === ===== ======== 990 991 // Suite B compliant cipher suites, see RFC 6460. 992 // 993 // Note that, at present this provider is not Suite B compliant. The 994 // preference order of the GCM cipher suites does not follow the spec 995 // of RFC 6460. In this section, only two cipher suites are listed 996 // so that applications can make use of Suite-B compliant cipher 997 // suite firstly. 998 add("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", 999 0xc02c, --p, K_ECDHE_ECDSA, B_AES_256_GCM, T, max, tls12, P_SHA384); 1000 add("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", 1001 0xc02b, --p, K_ECDHE_ECDSA, B_AES_128_GCM, T, max, tls12, P_SHA256); 1002 1003 // AES_256(GCM) 1004 add("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", 1005 0xc030, --p, K_ECDHE_RSA, B_AES_256_GCM, T, max, tls12, P_SHA384); 1006 add("TLS_RSA_WITH_AES_256_GCM_SHA384", 1007 0x009d, --p, K_RSA, B_AES_256_GCM, T, max, tls12, P_SHA384); 1008 add("TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", 1009 0xc02e, --p, K_ECDH_ECDSA, B_AES_256_GCM, T, max, tls12, P_SHA384); 1010 add("TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", 1011 0xc032, --p, K_ECDH_RSA, B_AES_256_GCM, T, max, tls12, P_SHA384); 1012 add("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", 1013 0x009f, --p, K_DHE_RSA, B_AES_256_GCM, T, max, tls12, P_SHA384); 1014 add("TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", 1015 0x00a3, --p, K_DHE_DSS, B_AES_256_GCM, T, max, tls12, P_SHA384); 1016 1017 // AES_128(GCM) 1018 add("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", 1019 0xc02f, --p, K_ECDHE_RSA, B_AES_128_GCM, T, max, tls12, P_SHA256); 1020 add("TLS_RSA_WITH_AES_128_GCM_SHA256", 1021 0x009c, --p, K_RSA, B_AES_128_GCM, T, max, tls12, P_SHA256); 1022 add("TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", 1023 0xc02d, --p, K_ECDH_ECDSA, B_AES_128_GCM, T, max, tls12, P_SHA256); 1024 add("TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", 1025 0xc031, --p, K_ECDH_RSA, B_AES_128_GCM, T, max, tls12, P_SHA256); 1026 add("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", 1027 0x009e, --p, K_DHE_RSA, B_AES_128_GCM, T, max, tls12, P_SHA256); 1028 add("TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", 1029 0x00a2, --p, K_DHE_DSS, B_AES_128_GCM, T, max, tls12, P_SHA256); 1030 1031 // AES_256(CBC) 1032 add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", 1033 0xc024, --p, K_ECDHE_ECDSA, B_AES_256, T, max, tls12, P_SHA384); 1034 add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", 1035 0xc028, --p, K_ECDHE_RSA, B_AES_256, T, max, tls12, P_SHA384); 1036 add("TLS_RSA_WITH_AES_256_CBC_SHA256", 1037 0x003d, --p, K_RSA, B_AES_256, T, max, tls12, P_SHA256); 1038 add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", 1039 0xc026, --p, K_ECDH_ECDSA, B_AES_256, T, max, tls12, P_SHA384); 1040 add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", 1041 0xc02a, --p, K_ECDH_RSA, B_AES_256, T, max, tls12, P_SHA384); 1042 add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", 1043 0x006b, --p, K_DHE_RSA, B_AES_256, T, max, tls12, P_SHA256); 1044 add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", 1045 0x006a, --p, K_DHE_DSS, B_AES_256, T, max, tls12, P_SHA256); 1046 1047 add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", 1048 0xC00A, --p, K_ECDHE_ECDSA, B_AES_256, T); 1049 add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", 1050 0xC014, --p, K_ECDHE_RSA, B_AES_256, T); 1051 add("TLS_RSA_WITH_AES_256_CBC_SHA", 1052 0x0035, --p, K_RSA, B_AES_256, T); 1053 add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", 1054 0xC005, --p, K_ECDH_ECDSA, B_AES_256, T); 1055 add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", 1056 0xC00F, --p, K_ECDH_RSA, B_AES_256, T); 1057 add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA", 1058 0x0039, --p, K_DHE_RSA, B_AES_256, T); 1059 add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA", 1060 0x0038, --p, K_DHE_DSS, B_AES_256, T); 1061 1062 // AES_128(CBC) 1063 add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", 1064 0xc023, --p, K_ECDHE_ECDSA, B_AES_128, T, max, tls12, P_SHA256); 1065 add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", 1066 0xc027, --p, K_ECDHE_RSA, B_AES_128, T, max, tls12, P_SHA256); 1067 add("TLS_RSA_WITH_AES_128_CBC_SHA256", 1068 0x003c, --p, K_RSA, B_AES_128, T, max, tls12, P_SHA256); 1069 add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", 1070 0xc025, --p, K_ECDH_ECDSA, B_AES_128, T, max, tls12, P_SHA256); 1071 add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", 1072 0xc029, --p, K_ECDH_RSA, B_AES_128, T, max, tls12, P_SHA256); 1073 add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", 1074 0x0067, --p, K_DHE_RSA, B_AES_128, T, max, tls12, P_SHA256); 1075 add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", 1076 0x0040, --p, K_DHE_DSS, B_AES_128, T, max, tls12, P_SHA256); 1077 1078 add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", 1079 0xC009, --p, K_ECDHE_ECDSA, B_AES_128, T); 1080 add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", 1081 0xC013, --p, K_ECDHE_RSA, B_AES_128, T); 1082 add("TLS_RSA_WITH_AES_128_CBC_SHA", 1083 0x002f, --p, K_RSA, B_AES_128, T); 1084 add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", 1085 0xC004, --p, K_ECDH_ECDSA, B_AES_128, T); 1086 add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", 1087 0xC00E, --p, K_ECDH_RSA, B_AES_128, T); 1088 add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA", 1089 0x0033, --p, K_DHE_RSA, B_AES_128, T); 1090 add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA", 1091 0x0032, --p, K_DHE_DSS, B_AES_128, T); 1092 1093 // RC-4 1094 add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", 1095 0xC007, --p, K_ECDHE_ECDSA, B_RC4_128, N); 1096 add("TLS_ECDHE_RSA_WITH_RC4_128_SHA", 1097 0xC011, --p, K_ECDHE_RSA, B_RC4_128, N); 1098 add("SSL_RSA_WITH_RC4_128_SHA", 1099 0x0005, --p, K_RSA, B_RC4_128, N); 1100 add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA", 1101 0xC002, --p, K_ECDH_ECDSA, B_RC4_128, N); 1102 add("TLS_ECDH_RSA_WITH_RC4_128_SHA", 1103 0xC00C, --p, K_ECDH_RSA, B_RC4_128, N); 1104 1105 // 3DES_EDE 1106 add("TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", 1107 0xC008, --p, K_ECDHE_ECDSA, B_3DES, T); 1108 add("TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", 1109 0xC012, --p, K_ECDHE_RSA, B_3DES, T); 1110 add("SSL_RSA_WITH_3DES_EDE_CBC_SHA", 1111 0x000a, --p, K_RSA, B_3DES, T); 1112 add("TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", 1113 0xC003, --p, K_ECDH_ECDSA, B_3DES, T); 1114 add("TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", 1115 0xC00D, --p, K_ECDH_RSA, B_3DES, T); 1116 add("SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", 1117 0x0016, --p, K_DHE_RSA, B_3DES, T); 1118 add("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", 1119 0x0013, --p, K_DHE_DSS, B_3DES, N); 1120 1121 add("SSL_RSA_WITH_RC4_128_MD5", 1122 0x0004, --p, K_RSA, B_RC4_128, N); 1123 1124 // Renegotiation protection request Signalling Cipher Suite Value (SCSV) 1125 add("TLS_EMPTY_RENEGOTIATION_INFO_SCSV", 1126 0x00ff, --p, K_SCSV, B_NULL, T); 1127 1128 // Fallback in progress Signalling Cipher Suite Value (SCSV) 1129 add("TLS_FALLBACK_SCSV", 1130 0x5600, --p, K_FALLBACK_SCSV, B_NULL, F); 1131 1132 /* 1133 * Definition of the CipherSuites that are supported but not enabled 1134 * by default. 1135 * They are listed in preference order, preferred first, using the 1136 * following criteria: 1137 * 1. CipherSuites for KRB5 need additional KRB5 service 1138 * configuration, and these suites are not common in practice, 1139 * so we put KRB5 based cipher suites at the end of the supported 1140 * list. 1141 * 2. If a cipher suite has been obsoleted, we put it at the end of 1142 * the list. 1143 * 3. Prefer the stronger bulk cipher, in the order of AES_256, 1144 * AES_128, RC-4, 3DES-EDE, DES, RC4_40, DES40, NULL. 1145 * 4. Prefer the stronger MAC algorithm, in the order of SHA384, 1146 * SHA256, SHA, MD5. 1147 * 5. Prefer the better performance of key exchange and digital 1148 * signature algorithm, in the order of ECDHE-ECDSA, ECDHE-RSA, 1149 * RSA, ECDH-ECDSA, ECDH-RSA, DHE-RSA, DHE-DSS, anonymous. 1150 */ 1151 p = DEFAULT_SUITES_PRIORITY; 1152 1153 add("TLS_DH_anon_WITH_AES_256_GCM_SHA384", 1154 0x00a7, --p, K_DH_ANON, B_AES_256_GCM, N, max, tls12, P_SHA384); 1155 add("TLS_DH_anon_WITH_AES_128_GCM_SHA256", 1156 0x00a6, --p, K_DH_ANON, B_AES_128_GCM, N, max, tls12, P_SHA256); 1157 1158 add("TLS_DH_anon_WITH_AES_256_CBC_SHA256", 1159 0x006d, --p, K_DH_ANON, B_AES_256, N, max, tls12, P_SHA256); 1160 add("TLS_ECDH_anon_WITH_AES_256_CBC_SHA", 1161 0xC019, --p, K_ECDH_ANON, B_AES_256, N); 1162 add("TLS_DH_anon_WITH_AES_256_CBC_SHA", 1163 0x003a, --p, K_DH_ANON, B_AES_256, N); 1164 1165 add("TLS_DH_anon_WITH_AES_128_CBC_SHA256", 1166 0x006c, --p, K_DH_ANON, B_AES_128, N, max, tls12, P_SHA256); 1167 add("TLS_ECDH_anon_WITH_AES_128_CBC_SHA", 1168 0xC018, --p, K_ECDH_ANON, B_AES_128, N); 1169 add("TLS_DH_anon_WITH_AES_128_CBC_SHA", 1170 0x0034, --p, K_DH_ANON, B_AES_128, N); 1171 1172 add("TLS_ECDH_anon_WITH_RC4_128_SHA", 1173 0xC016, --p, K_ECDH_ANON, B_RC4_128, N); 1174 add("SSL_DH_anon_WITH_RC4_128_MD5", 1175 0x0018, --p, K_DH_ANON, B_RC4_128, N); 1176 1177 add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", 1178 0xC017, --p, K_ECDH_ANON, B_3DES, N); 1179 add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", 1180 0x001b, --p, K_DH_ANON, B_3DES, N); 1181 1182 add("TLS_RSA_WITH_NULL_SHA256", 1183 0x003b, --p, K_RSA, B_NULL, N, max, tls12, P_SHA256); 1184 add("TLS_ECDHE_ECDSA_WITH_NULL_SHA", 1185 0xC006, --p, K_ECDHE_ECDSA, B_NULL, N); 1186 add("TLS_ECDHE_RSA_WITH_NULL_SHA", 1187 0xC010, --p, K_ECDHE_RSA, B_NULL, N); 1188 add("SSL_RSA_WITH_NULL_SHA", 1189 0x0002, --p, K_RSA, B_NULL, N); 1190 add("TLS_ECDH_ECDSA_WITH_NULL_SHA", 1191 0xC001, --p, K_ECDH_ECDSA, B_NULL, N); 1192 add("TLS_ECDH_RSA_WITH_NULL_SHA", 1193 0xC00B, --p, K_ECDH_RSA, B_NULL, N); 1194 add("TLS_ECDH_anon_WITH_NULL_SHA", 1195 0xC015, --p, K_ECDH_ANON, B_NULL, N); 1196 add("SSL_RSA_WITH_NULL_MD5", 1197 0x0001, --p, K_RSA, B_NULL, N); 1198 1199 // weak cipher suites obsoleted in TLS 1.2 1200 add("SSL_RSA_WITH_DES_CBC_SHA", 1201 0x0009, --p, K_RSA, B_DES, N, tls12); 1202 add("SSL_DHE_RSA_WITH_DES_CBC_SHA", 1203 0x0015, --p, K_DHE_RSA, B_DES, N, tls12); 1204 add("SSL_DHE_DSS_WITH_DES_CBC_SHA", 1205 0x0012, --p, K_DHE_DSS, B_DES, N, tls12); 1206 add("SSL_DH_anon_WITH_DES_CBC_SHA", 1207 0x001a, --p, K_DH_ANON, B_DES, N, tls12); 1208 1209 // weak cipher suites obsoleted in TLS 1.1 1210 add("SSL_RSA_EXPORT_WITH_RC4_40_MD5", 1211 0x0003, --p, K_RSA_EXPORT, B_RC4_40, N, tls11); 1212 add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", 1213 0x0017, --p, K_DH_ANON, B_RC4_40, N, tls11); 1214 1215 add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", 1216 0x0008, --p, K_RSA_EXPORT, B_DES_40, N, tls11); 1217 add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", 1218 0x0014, --p, K_DHE_RSA, B_DES_40, N, tls11); 1219 add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", 1220 0x0011, --p, K_DHE_DSS, B_DES_40, N, tls11); 1221 add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", 1222 0x0019, --p, K_DH_ANON, B_DES_40, N, tls11); 1223 1224 // Supported Kerberos ciphersuites from RFC2712 1225 add("TLS_KRB5_WITH_RC4_128_SHA", 1226 0x0020, --p, K_KRB5, B_RC4_128, N); 1227 add("TLS_KRB5_WITH_RC4_128_MD5", 1228 0x0024, --p, K_KRB5, B_RC4_128, N); 1229 add("TLS_KRB5_WITH_3DES_EDE_CBC_SHA", 1230 0x001f, --p, K_KRB5, B_3DES, N); 1231 add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5", 1232 0x0023, --p, K_KRB5, B_3DES, N); 1233 add("TLS_KRB5_WITH_DES_CBC_SHA", 1234 0x001e, --p, K_KRB5, B_DES, N, tls12); 1235 add("TLS_KRB5_WITH_DES_CBC_MD5", 1236 0x0022, --p, K_KRB5, B_DES, N, tls12); 1237 add("TLS_KRB5_EXPORT_WITH_RC4_40_SHA", 1238 0x0028, --p, K_KRB5_EXPORT, B_RC4_40, N, tls11); 1239 add("TLS_KRB5_EXPORT_WITH_RC4_40_MD5", 1240 0x002b, --p, K_KRB5_EXPORT, B_RC4_40, N, tls11); 1241 add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", 1242 0x0026, --p, K_KRB5_EXPORT, B_DES_40, N, tls11); 1243 add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", 1244 0x0029, --p, K_KRB5_EXPORT, B_DES_40, N, tls11); 1245 1246 /* 1247 * Other values from the TLS Cipher Suite Registry, as of August 2010. 1248 * 1249 * http://www.iana.org/assignments/tls-parameters/tls-parameters.xml 1250 * 1251 * Range Registration Procedures Notes 1252 * 000-191 Standards Action Refers to value of first byte 1253 * 192-254 Specification Required Refers to value of first byte 1254 * 255 Reserved for Private Use Refers to value of first byte 1255 */ 1256 1257 // Register the names of a few additional CipherSuites. 1258 // Makes them show up as names instead of numbers in 1259 // the debug output. 1260 1261 // remaining unsupported ciphersuites defined in RFC2246. 1262 add("SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", 0x0006); 1263 add("SSL_RSA_WITH_IDEA_CBC_SHA", 0x0007); 1264 add("SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x000b); 1265 add("SSL_DH_DSS_WITH_DES_CBC_SHA", 0x000c); 1266 add("SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA", 0x000d); 1267 add("SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x000e); 1268 add("SSL_DH_RSA_WITH_DES_CBC_SHA", 0x000f); 1269 add("SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA", 0x0010); 1270 1271 // SSL 3.0 Fortezza ciphersuites 1272 add("SSL_FORTEZZA_DMS_WITH_NULL_SHA", 0x001c); 1273 add("SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA", 0x001d); 1274 1275 // 1024/56 bit exportable ciphersuites from expired internet draft 1276 add("SSL_RSA_EXPORT1024_WITH_DES_CBC_SHA", 0x0062); 1277 add("SSL_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA", 0x0063); 1278 add("SSL_RSA_EXPORT1024_WITH_RC4_56_SHA", 0x0064); 1279 add("SSL_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA", 0x0065); 1280 add("SSL_DHE_DSS_WITH_RC4_128_SHA", 0x0066); 1281 1282 // Netscape old and new SSL 3.0 FIPS ciphersuites 1283 // see http://www.mozilla.org/projects/security/pki/nss/ssl/fips-ssl-ciphersuites.html 1284 add("NETSCAPE_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 0xffe0); 1285 add("NETSCAPE_RSA_FIPS_WITH_DES_CBC_SHA", 0xffe1); 1286 add("SSL_RSA_FIPS_WITH_DES_CBC_SHA", 0xfefe); 1287 add("SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 0xfeff); 1288 1289 // Unsupported Kerberos cipher suites from RFC 2712 1290 add("TLS_KRB5_WITH_IDEA_CBC_SHA", 0x0021); 1291 add("TLS_KRB5_WITH_IDEA_CBC_MD5", 0x0025); 1292 add("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA", 0x0027); 1293 add("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5", 0x002a); 1294 1295 // Unsupported cipher suites from RFC 4162 1296 add("TLS_RSA_WITH_SEED_CBC_SHA", 0x0096); 1297 add("TLS_DH_DSS_WITH_SEED_CBC_SHA", 0x0097); 1298 add("TLS_DH_RSA_WITH_SEED_CBC_SHA", 0x0098); 1299 add("TLS_DHE_DSS_WITH_SEED_CBC_SHA", 0x0099); 1300 add("TLS_DHE_RSA_WITH_SEED_CBC_SHA", 0x009a); 1301 add("TLS_DH_anon_WITH_SEED_CBC_SHA", 0x009b); 1302 1303 // Unsupported cipher suites from RFC 4279 1304 add("TLS_PSK_WITH_RC4_128_SHA", 0x008a); 1305 add("TLS_PSK_WITH_3DES_EDE_CBC_SHA", 0x008b); 1306 add("TLS_PSK_WITH_AES_128_CBC_SHA", 0x008c); 1307 add("TLS_PSK_WITH_AES_256_CBC_SHA", 0x008d); 1308 add("TLS_DHE_PSK_WITH_RC4_128_SHA", 0x008e); 1309 add("TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA", 0x008f); 1310 add("TLS_DHE_PSK_WITH_AES_128_CBC_SHA", 0x0090); 1311 add("TLS_DHE_PSK_WITH_AES_256_CBC_SHA", 0x0091); 1312 add("TLS_RSA_PSK_WITH_RC4_128_SHA", 0x0092); 1313 add("TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA", 0x0093); 1314 add("TLS_RSA_PSK_WITH_AES_128_CBC_SHA", 0x0094); 1315 add("TLS_RSA_PSK_WITH_AES_256_CBC_SHA", 0x0095); 1316 1317 // Unsupported cipher suites from RFC 4785 1318 add("TLS_PSK_WITH_NULL_SHA", 0x002c); 1319 add("TLS_DHE_PSK_WITH_NULL_SHA", 0x002d); 1320 add("TLS_RSA_PSK_WITH_NULL_SHA", 0x002e); 1321 1322 // Unsupported cipher suites from RFC 5246 1323 add("TLS_DH_DSS_WITH_AES_128_CBC_SHA", 0x0030); 1324 add("TLS_DH_RSA_WITH_AES_128_CBC_SHA", 0x0031); 1325 add("TLS_DH_DSS_WITH_AES_256_CBC_SHA", 0x0036); 1326 add("TLS_DH_RSA_WITH_AES_256_CBC_SHA", 0x0037); 1327 add("TLS_DH_DSS_WITH_AES_128_CBC_SHA256", 0x003e); 1328 add("TLS_DH_RSA_WITH_AES_128_CBC_SHA256", 0x003f); 1329 add("TLS_DH_DSS_WITH_AES_256_CBC_SHA256", 0x0068); 1330 add("TLS_DH_RSA_WITH_AES_256_CBC_SHA256", 0x0069); 1331 1332 // Unsupported cipher suites from RFC 5288 1333 add("TLS_DH_RSA_WITH_AES_128_GCM_SHA256", 0x00a0); 1334 add("TLS_DH_RSA_WITH_AES_256_GCM_SHA384", 0x00a1); 1335 add("TLS_DH_DSS_WITH_AES_128_GCM_SHA256", 0x00a4); 1336 add("TLS_DH_DSS_WITH_AES_256_GCM_SHA384", 0x00a5); 1337 1338 // Unsupported cipher suites from RFC 5487 1339 add("TLS_PSK_WITH_AES_128_GCM_SHA256", 0x00a8); 1340 add("TLS_PSK_WITH_AES_256_GCM_SHA384", 0x00a9); 1341 add("TLS_DHE_PSK_WITH_AES_128_GCM_SHA256", 0x00aa); 1342 add("TLS_DHE_PSK_WITH_AES_256_GCM_SHA384", 0x00ab); 1343 add("TLS_RSA_PSK_WITH_AES_128_GCM_SHA256", 0x00ac); 1344 add("TLS_RSA_PSK_WITH_AES_256_GCM_SHA384", 0x00ad); 1345 add("TLS_PSK_WITH_AES_128_CBC_SHA256", 0x00ae); 1346 add("TLS_PSK_WITH_AES_256_CBC_SHA384", 0x00af); 1347 add("TLS_PSK_WITH_NULL_SHA256", 0x00b0); 1348 add("TLS_PSK_WITH_NULL_SHA384", 0x00b1); 1349 add("TLS_DHE_PSK_WITH_AES_128_CBC_SHA256", 0x00b2); 1350 add("TLS_DHE_PSK_WITH_AES_256_CBC_SHA384", 0x00b3); 1351 add("TLS_DHE_PSK_WITH_NULL_SHA256", 0x00b4); 1352 add("TLS_DHE_PSK_WITH_NULL_SHA384", 0x00b5); 1353 add("TLS_RSA_PSK_WITH_AES_128_CBC_SHA256", 0x00b6); 1354 add("TLS_RSA_PSK_WITH_AES_256_CBC_SHA384", 0x00b7); 1355 add("TLS_RSA_PSK_WITH_NULL_SHA256", 0x00b8); 1356 add("TLS_RSA_PSK_WITH_NULL_SHA384", 0x00b9); 1357 1358 // Unsupported cipher suites from RFC 5932 1359 add("TLS_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0041); 1360 add("TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA", 0x0042); 1361 add("TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0043); 1362 add("TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA", 0x0044); 1363 add("TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0045); 1364 add("TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA", 0x0046); 1365 add("TLS_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0084); 1366 add("TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA", 0x0085); 1367 add("TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0086); 1368 add("TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA", 0x0087); 1369 add("TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0088); 1370 add("TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA", 0x0089); 1371 add("TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00ba); 1372 add("TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256", 0x00bb); 1373 add("TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00bc); 1374 add("TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256", 0x00bd); 1375 add("TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00be); 1376 add("TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256", 0x00bf); 1377 add("TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c0); 1378 add("TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256", 0x00c1); 1379 add("TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c2); 1380 add("TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256", 0x00c3); 1381 add("TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c4); 1382 add("TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256", 0x00c5); 1383 1384 // Unsupported cipher suites from RFC 5054 1385 add("TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA", 0xc01a); 1386 add("TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA", 0xc01b); 1387 add("TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA", 0xc01c); 1388 add("TLS_SRP_SHA_WITH_AES_128_CBC_SHA", 0xc01d); 1389 add("TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA", 0xc01e); 1390 add("TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA", 0xc01f); 1391 add("TLS_SRP_SHA_WITH_AES_256_CBC_SHA", 0xc020); 1392 add("TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA", 0xc021); 1393 add("TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA", 0xc022); 1394 1395 // Unsupported cipher suites from RFC 5489 1396 add("TLS_ECDHE_PSK_WITH_RC4_128_SHA", 0xc033); 1397 add("TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA", 0xc034); 1398 add("TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA", 0xc035); 1399 add("TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA", 0xc036); 1400 add("TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256", 0xc037); 1401 add("TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384", 0xc038); 1402 add("TLS_ECDHE_PSK_WITH_NULL_SHA", 0xc039); 1403 add("TLS_ECDHE_PSK_WITH_NULL_SHA256", 0xc03a); 1404 add("TLS_ECDHE_PSK_WITH_NULL_SHA384", 0xc03b); 1405 } 1406 1407 // ciphersuite SSL_NULL_WITH_NULL_NULL 1408 final static CipherSuite C_NULL = CipherSuite.valueOf(0, 0); 1409 1410 // ciphersuite TLS_EMPTY_RENEGOTIATION_INFO_SCSV 1411 final static CipherSuite C_SCSV = CipherSuite.valueOf(0x00, 0xff); 1412 1413 // ciphersuite TLS_FALLBACK_SCSV 1414 final static CipherSuite C_FALLBACK_SCSV = CipherSuite.valueOf(0x56, 0x00); 1415 }