/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* and mac algorithms are also defined in this class.
*
* The CipherSuite class and the inner classes defined in this file roughly
* follow the type safe enum pattern described in Effective Java. This means:
*
* . instances are immutable, classes are final
*
* . there is a unique instance of every value, i.e. there are never two
* instances representing the same CipherSuite, etc. This means equality
* tests can be performed using == instead of equals() (although that works
* as well). [A minor exception are *unsupported* CipherSuites read from a
* handshake message, but this is usually irrelevant]
*
* . instances are obtained using the static valueOf() factory methods.
*
* . properties are defined as final variables and made available as
* package private variables without method accessors
*
* . if the member variable allowed is false, the given algorithm is either
* unavailable or disabled at compile time
*
*/
// minimum priority for supported CipherSuites
// minimum priority for default enabled CipherSuites
// Flag indicating if CipherSuite availability can change dynamically.
// This is the case when we rely on a JCE cipher implementation that
// may not be available in the installed JCE providers.
// It is true because we might not have an ECC implementation.
final static boolean DYNAMIC_AVAILABILITY = true;
("com.sun.net.ssl.enableECC", true);
// Map Integer(id) -> CipherSuite
// contains all known CipherSuites
// Map String(name) -> CipherSuite
// contains only supported CipherSuites (i.e. allowed == true)
// Protocol defined CipherSuite name, e.g. SSL_RSA_WITH_RC4_128_MD5
// we use TLS_* only for new CipherSuites, still SSL_* for old ones
// id in 16 bit MSB format, i.e. 0x0004 for SSL_RSA_WITH_RC4_128_MD5
final int id;
// priority for the internal default preference order. the higher the
// better. Each supported CipherSuite *must* have a unique priority.
// Ciphersuites with priority >= DEFAULT_SUITES_PRIORITY are enabled
// by default
final int priority;
// key exchange, bulk cipher, mac and prf algorithms. See those
// classes below.
// whether a CipherSuite qualifies as exportable under 512/40 bit rules.
// TLS 1.1+ (RFC 4346) must not negotiate to these suites.
final boolean exportable;
// true iff implemented and enabled at compile time
final boolean allowed;
// obsoleted since protocol version
final int obsoleted;
// supported since protocol version
final int supported;
/**
* Constructor for implemented CipherSuites.
*/
this.keyExchange = keyExchange;
} else {
throw new IllegalArgumentException
("Unknown MAC algorithm for ciphersuite " + name);
}
}
/**
* Constructor for unimplemented CipherSuites.
*/
this.allowed = false;
this.priority = 0;
this.keyExchange = null;
this.exportable = false;
}
/**
* Return whether this CipherSuite is available for use. A
* CipherSuite may be unavailable even if it is supported
* (i.e. allowed == true) if the required JCE cipher is not installed.
* In some configuration, this situation may change over time, call
* CipherSuiteList.clearAvailableCache() before this method to obtain
* the most current status.
*/
boolean isAvailable() {
}
boolean isNegotiable() {
return this != C_SCSV && isAvailable();
}
/**
* Compares CipherSuites based on their priority. Has the effect of
* sorting CipherSuites when put in a sorted collection, which is
* used by CipherSuiteList. Follows standard Comparable contract.
*
* Note that for unsupported CipherSuites parsed from a handshake
* message we violate the equals() contract.
*/
}
/**
* Returns this.name.
*/
return name;
}
/**
* Return a CipherSuite for the given name. The returned CipherSuite
* is supported by this implementation but may not actually be
* currently useable. See isAvailable().
*
* @exception IllegalArgumentException if the CipherSuite is unknown or
* unsupported.
*/
if (s == null) {
throw new IllegalArgumentException("Name must not be null");
}
throw new IllegalArgumentException("Unsupported ciphersuite " + s);
}
return c;
}
/**
* Return a CipherSuite with the given ID. A temporary object is
* constructed if the ID is unknown. Use isAvailable() to verify that
* the CipherSuite can actually be used.
*/
id1 &= 0xff;
id2 &= 0xff;
if (c == null) {
}
return c;
}
// for use by CipherSuiteList only
}
/*
* Use this method when all of the values need to be specified.
* This is primarily used when defining a new ciphersuite for
* TLS 1.2+ that doesn't use the "default" PRF.
*/
throw new RuntimeException("Duplicate ciphersuite definition: "
}
if (c.allowed) {
throw new RuntimeException("Duplicate ciphersuite definition: "
}
}
}
/*
* Use this method when there is no lower protocol limit where this
* suite can be used, and the PRF is P_SHA256. That is, the
* existing ciphersuites. From RFC 5246:
*
* All cipher suites in this document use P_SHA256.
*/
// If this is an obsoleted suite, then don't let the TLS 1.2
// protocol have a valid PRF value.
}
}
/*
* Use this method when there is no upper protocol limit. That is,
* suites which have not been obsoleted.
*/
}
/*
* Use this method to define an unimplemented suite. This provides
* a number<->name mapping that can be used for debugging.
*/
throw new RuntimeException("Duplicate ciphersuite definition: "
}
}
/**
*/
static enum KeyExchange {
// key exchange algorithms
// Kerberos cipher suites
// renegotiation protection request signaling cipher suite
// name of the key exchange algorithm, e.g. DHE_DSS
final boolean allowed;
private final boolean alwaysAvailable;
this.alwaysAvailable = allowed &&
}
boolean isAvailable() {
if (alwaysAvailable) {
return true;
}
} else {
return allowed;
}
}
return name;
}
}
/**
* cipher and key length.
*
* Also contains a factory method to obtain in initialized CipherBox
* for this algorithm.
*/
final static class BulkCipher {
// Map BulkCipher -> Boolean(available)
new HashMap<>(8);
// descriptive name including key size, e.g. AES/128
// algorithm name, e.g. AES
// supported and compile time enabled. Also see isAvailable()
final boolean allowed;
// number of bytes of entropy in the key
final int keySize;
// length of the actual cipher key in bytes.
// for non-exportable ciphers, this is the same as keySize
final int expandedKeySize;
// size of the IV (also block size)
final int ivSize;
// exportable under 512/40 bit rules
final boolean exportable;
// Is the cipher algorithm of Cipher Block Chaining (CBC) mode?
final boolean isCBCMode;
this.transformation = transformation;
this.isCBCMode =
this.expandedKeySize = expandedKeySize;
this.exportable = true;
}
this.transformation = transformation;
this.isCBCMode =
this.expandedKeySize = keySize;
this.exportable = false;
}
/**
* Return an initialized CipherBox for this BulkCipher.
* IV must be null for stream ciphers.
*
* @exception NoSuchAlgorithmException if anything goes wrong
*/
boolean encrypt) throws NoSuchAlgorithmException {
}
/**
* Test if this bulk cipher is available. For use by CipherSuite.
*
* Currently all supported ciphers except AES are always available
* via the JSSE internal implementations. We also assume AES/128
* is always available since it is shipped with the SunJCE provider.
* However, AES/256 is unavailable when the default JCE policy
* jurisdiction files are installed because of key length restrictions.
*/
boolean isAvailable() {
if (allowed == false) {
return false;
}
if (this == B_AES_256) {
return isAvailable(this);
}
// always available
return true;
}
// for use by CipherSuiteList.clearAvailableCache();
static synchronized void clearAvailableCache() {
if (DYNAMIC_AVAILABILITY) {
}
}
if (b == null) {
try {
} catch (NoSuchAlgorithmException e) {
}
}
return b.booleanValue();
}
return description;
}
}
/**
*
* Also contains a factory method to obtain an initialized MAC
* for this algorithm.
*/
final static class MacAlg {
// descriptive name, e.g. MD5
// size of the MAC value (and MAC key) in bytes
final int size;
// block size of the underlying hash algorithm
final int hashBlockSize;
// minimal padding size of the underlying hash algorithm
final int minimalPaddingSize;
int hashBlockSize, int minimalPaddingSize) {
this.hashBlockSize = hashBlockSize;
this.minimalPaddingSize = minimalPaddingSize;
}
/**
* Return an initialized MAC for this MacAlg. ProtocolVersion
* must either be SSL30 (SSLv3 custom MAC) or TLS10 (std. HMAC).
*
* @exception NoSuchAlgorithmException if anything goes wrong
*/
throws NoSuchAlgorithmException, InvalidKeyException {
}
return name;
}
}
// export strength ciphers
// domestic strength ciphers
// MACs
/**
* PRFs (PseudoRandom Function) from TLS specifications.
*
* TLS 1.1- uses a single MD5/SHA1-based PRF algorithm for generating
* the necessary material.
*
* new Ciphersuites (e.g. RFC 5288) can define specific PRF hash
* algorithms.
*/
static enum PRF {
// PRF algorithms
// PRF characteristics
private final int prfHashLength;
private final int prfBlockSize;
this.prfHashAlg = prfHashAlg;
this.prfHashLength = prfHashLength;
this.prfBlockSize = prfBlockSize;
}
return prfHashAlg;
}
int getPRFHashLength() {
return prfHashLength;
}
int getPRFBlockSize() {
return prfBlockSize;
}
}
static {
final boolean F = false;
final boolean T = true;
// N: ciphersuites only allowed if we are not in FIPS mode
/*
* TLS Cipher Suite Registry, as of August 2010.
*
*
* Range Registration Procedures Notes
* 000-191 Standards Action Refers to value of first byte
* 192-254 Specification Required Refers to value of first byte
* 255 Reserved for Private Use Refers to value of first byte
*
* Value Description Reference
* 0x00,0x00 TLS_NULL_WITH_NULL_NULL [RFC5246]
* 0x00,0x01 TLS_RSA_WITH_NULL_MD5 [RFC5246]
* 0x00,0x02 TLS_RSA_WITH_NULL_SHA [RFC5246]
* 0x00,0x03 TLS_RSA_EXPORT_WITH_RC4_40_MD5 [RFC4346]
* 0x00,0x04 TLS_RSA_WITH_RC4_128_MD5 [RFC5246]
* 0x00,0x05 TLS_RSA_WITH_RC4_128_SHA [RFC5246]
* 0x00,0x06 TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 [RFC4346]
* 0x00,0x07 TLS_RSA_WITH_IDEA_CBC_SHA [RFC5469]
* 0x00,0x08 TLS_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346]
* 0x00,0x09 TLS_RSA_WITH_DES_CBC_SHA [RFC5469]
* 0x00,0x0A TLS_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246]
* 0x00,0x0B TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA [RFC4346]
* 0x00,0x0C TLS_DH_DSS_WITH_DES_CBC_SHA [RFC5469]
* 0x00,0x0D TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA [RFC5246]
* 0x00,0x0E TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346]
* 0x00,0x0F TLS_DH_RSA_WITH_DES_CBC_SHA [RFC5469]
* 0x00,0x10 TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246]
* 0x00,0x11 TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA [RFC4346]
* 0x00,0x12 TLS_DHE_DSS_WITH_DES_CBC_SHA [RFC5469]
* 0x00,0x13 TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA [RFC5246]
* 0x00,0x14 TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346]
* 0x00,0x15 TLS_DHE_RSA_WITH_DES_CBC_SHA [RFC5469]
* 0x00,0x16 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246]
* 0x00,0x17 TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 [RFC4346]
* 0x00,0x18 TLS_DH_anon_WITH_RC4_128_MD5 [RFC5246]
* 0x00,0x19 TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA [RFC4346]
* 0x00,0x1A TLS_DH_anon_WITH_DES_CBC_SHA [RFC5469]
* 0x00,0x1B TLS_DH_anon_WITH_3DES_EDE_CBC_SHA [RFC5246]
* 0x00,0x1C-1D Reserved to avoid conflicts with SSLv3 [RFC5246]
* 0x00,0x1E TLS_KRB5_WITH_DES_CBC_SHA [RFC2712]
* 0x00,0x1F TLS_KRB5_WITH_3DES_EDE_CBC_SHA [RFC2712]
* 0x00,0x20 TLS_KRB5_WITH_RC4_128_SHA [RFC2712]
* 0x00,0x21 TLS_KRB5_WITH_IDEA_CBC_SHA [RFC2712]
* 0x00,0x22 TLS_KRB5_WITH_DES_CBC_MD5 [RFC2712]
* 0x00,0x23 TLS_KRB5_WITH_3DES_EDE_CBC_MD5 [RFC2712]
* 0x00,0x24 TLS_KRB5_WITH_RC4_128_MD5 [RFC2712]
* 0x00,0x25 TLS_KRB5_WITH_IDEA_CBC_MD5 [RFC2712]
* 0x00,0x26 TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA [RFC2712]
* 0x00,0x27 TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA [RFC2712]
* 0x00,0x28 TLS_KRB5_EXPORT_WITH_RC4_40_SHA [RFC2712]
* 0x00,0x29 TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 [RFC2712]
* 0x00,0x2A TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 [RFC2712]
* 0x00,0x2B TLS_KRB5_EXPORT_WITH_RC4_40_MD5 [RFC2712]
* 0x00,0x2C TLS_PSK_WITH_NULL_SHA [RFC4785]
* 0x00,0x2D TLS_DHE_PSK_WITH_NULL_SHA [RFC4785]
* 0x00,0x2E TLS_RSA_PSK_WITH_NULL_SHA [RFC4785]
* 0x00,0x2F TLS_RSA_WITH_AES_128_CBC_SHA [RFC5246]
* 0x00,0x30 TLS_DH_DSS_WITH_AES_128_CBC_SHA [RFC5246]
* 0x00,0x31 TLS_DH_RSA_WITH_AES_128_CBC_SHA [RFC5246]
* 0x00,0x32 TLS_DHE_DSS_WITH_AES_128_CBC_SHA [RFC5246]
* 0x00,0x33 TLS_DHE_RSA_WITH_AES_128_CBC_SHA [RFC5246]
* 0x00,0x34 TLS_DH_anon_WITH_AES_128_CBC_SHA [RFC5246]
* 0x00,0x35 TLS_RSA_WITH_AES_256_CBC_SHA [RFC5246]
* 0x00,0x36 TLS_DH_DSS_WITH_AES_256_CBC_SHA [RFC5246]
* 0x00,0x37 TLS_DH_RSA_WITH_AES_256_CBC_SHA [RFC5246]
* 0x00,0x38 TLS_DHE_DSS_WITH_AES_256_CBC_SHA [RFC5246]
* 0x00,0x39 TLS_DHE_RSA_WITH_AES_256_CBC_SHA [RFC5246]
* 0x00,0x3A TLS_DH_anon_WITH_AES_256_CBC_SHA [RFC5246]
* 0x00,0x3B TLS_RSA_WITH_NULL_SHA256 [RFC5246]
* 0x00,0x3C TLS_RSA_WITH_AES_128_CBC_SHA256 [RFC5246]
* 0x00,0x3D TLS_RSA_WITH_AES_256_CBC_SHA256 [RFC5246]
* 0x00,0x3E TLS_DH_DSS_WITH_AES_128_CBC_SHA256 [RFC5246]
* 0x00,0x3F TLS_DH_RSA_WITH_AES_128_CBC_SHA256 [RFC5246]
* 0x00,0x40 TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 [RFC5246]
* 0x00,0x41 TLS_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932]
* 0x00,0x42 TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA [RFC5932]
* 0x00,0x43 TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932]
* 0x00,0x44 TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA [RFC5932]
* 0x00,0x45 TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932]
* 0x00,0x46 TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA [RFC5932]
* 0x00,0x47-4F Reserved to avoid conflicts with
* deployed implementations [Pasi_Eronen]
* 0x00,0x50-58 Reserved to avoid conflicts [Pasi Eronen]
* 0x00,0x59-5C Reserved to avoid conflicts with
* deployed implementations [Pasi_Eronen]
* 0x00,0x5D-5F Unassigned
* 0x00,0x60-66 Reserved to avoid conflicts with widely
* deployed implementations [Pasi_Eronen]
* 0x00,0x67 TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 [RFC5246]
* 0x00,0x68 TLS_DH_DSS_WITH_AES_256_CBC_SHA256 [RFC5246]
* 0x00,0x69 TLS_DH_RSA_WITH_AES_256_CBC_SHA256 [RFC5246]
* 0x00,0x6A TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 [RFC5246]
* 0x00,0x6B TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 [RFC5246]
* 0x00,0x6C TLS_DH_anon_WITH_AES_128_CBC_SHA256 [RFC5246]
* 0x00,0x6D TLS_DH_anon_WITH_AES_256_CBC_SHA256 [RFC5246]
* 0x00,0x6E-83 Unassigned
* 0x00,0x84 TLS_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932]
* 0x00,0x85 TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA [RFC5932]
* 0x00,0x86 TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932]
* 0x00,0x87 TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA [RFC5932]
* 0x00,0x88 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932]
* 0x00,0x89 TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA [RFC5932]
* 0x00,0x8A TLS_PSK_WITH_RC4_128_SHA [RFC4279]
* 0x00,0x8B TLS_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279]
* 0x00,0x8C TLS_PSK_WITH_AES_128_CBC_SHA [RFC4279]
* 0x00,0x8D TLS_PSK_WITH_AES_256_CBC_SHA [RFC4279]
* 0x00,0x8E TLS_DHE_PSK_WITH_RC4_128_SHA [RFC4279]
* 0x00,0x8F TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279]
* 0x00,0x90 TLS_DHE_PSK_WITH_AES_128_CBC_SHA [RFC4279]
* 0x00,0x91 TLS_DHE_PSK_WITH_AES_256_CBC_SHA [RFC4279]
* 0x00,0x92 TLS_RSA_PSK_WITH_RC4_128_SHA [RFC4279]
* 0x00,0x93 TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279]
* 0x00,0x94 TLS_RSA_PSK_WITH_AES_128_CBC_SHA [RFC4279]
* 0x00,0x95 TLS_RSA_PSK_WITH_AES_256_CBC_SHA [RFC4279]
* 0x00,0x96 TLS_RSA_WITH_SEED_CBC_SHA [RFC4162]
* 0x00,0x97 TLS_DH_DSS_WITH_SEED_CBC_SHA [RFC4162]
* 0x00,0x98 TLS_DH_RSA_WITH_SEED_CBC_SHA [RFC4162]
* 0x00,0x99 TLS_DHE_DSS_WITH_SEED_CBC_SHA [RFC4162]
* 0x00,0x9A TLS_DHE_RSA_WITH_SEED_CBC_SHA [RFC4162]
* 0x00,0x9B TLS_DH_anon_WITH_SEED_CBC_SHA [RFC4162]
* 0x00,0x9C TLS_RSA_WITH_AES_128_GCM_SHA256 [RFC5288]
* 0x00,0x9D TLS_RSA_WITH_AES_256_GCM_SHA384 [RFC5288]
* 0x00,0x9E TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 [RFC5288]
* 0x00,0x9F TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 [RFC5288]
* 0x00,0xA0 TLS_DH_RSA_WITH_AES_128_GCM_SHA256 [RFC5288]
* 0x00,0xA1 TLS_DH_RSA_WITH_AES_256_GCM_SHA384 [RFC5288]
* 0x00,0xA2 TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 [RFC5288]
* 0x00,0xA3 TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 [RFC5288]
* 0x00,0xA4 TLS_DH_DSS_WITH_AES_128_GCM_SHA256 [RFC5288]
* 0x00,0xA5 TLS_DH_DSS_WITH_AES_256_GCM_SHA384 [RFC5288]
* 0x00,0xA6 TLS_DH_anon_WITH_AES_128_GCM_SHA256 [RFC5288]
* 0x00,0xA7 TLS_DH_anon_WITH_AES_256_GCM_SHA384 [RFC5288]
* 0x00,0xA8 TLS_PSK_WITH_AES_128_GCM_SHA256 [RFC5487]
* 0x00,0xA9 TLS_PSK_WITH_AES_256_GCM_SHA384 [RFC5487]
* 0x00,0xAA TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 [RFC5487]
* 0x00,0xAB TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 [RFC5487]
* 0x00,0xAC TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 [RFC5487]
* 0x00,0xAD TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 [RFC5487]
* 0x00,0xAE TLS_PSK_WITH_AES_128_CBC_SHA256 [RFC5487]
* 0x00,0xAF TLS_PSK_WITH_AES_256_CBC_SHA384 [RFC5487]
* 0x00,0xB0 TLS_PSK_WITH_NULL_SHA256 [RFC5487]
* 0x00,0xB1 TLS_PSK_WITH_NULL_SHA384 [RFC5487]
* 0x00,0xB2 TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 [RFC5487]
* 0x00,0xB3 TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 [RFC5487]
* 0x00,0xB4 TLS_DHE_PSK_WITH_NULL_SHA256 [RFC5487]
* 0x00,0xB5 TLS_DHE_PSK_WITH_NULL_SHA384 [RFC5487]
* 0x00,0xB6 TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 [RFC5487]
* 0x00,0xB7 TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 [RFC5487]
* 0x00,0xB8 TLS_RSA_PSK_WITH_NULL_SHA256 [RFC5487]
* 0x00,0xB9 TLS_RSA_PSK_WITH_NULL_SHA384 [RFC5487]
* 0x00,0xBA TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932]
* 0x00,0xBB TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932]
* 0x00,0xBC TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932]
* 0x00,0xBD TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932]
* 0x00,0xBE TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932]
* 0x00,0xBF TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932]
* 0x00,0xC0 TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932]
* 0x00,0xC1 TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932]
* 0x00,0xC2 TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932]
* 0x00,0xC3 TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932]
* 0x00,0xC4 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932]
* 0x00,0xC5 TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932]
* 0x00,0xC6-FE Unassigned
* 0x00,0xFF TLS_EMPTY_RENEGOTIATION_INFO_SCSV [RFC5746]
* 0x01-BF,* Unassigned
* 0xC0,0x01 TLS_ECDH_ECDSA_WITH_NULL_SHA [RFC4492]
* 0xC0,0x02 TLS_ECDH_ECDSA_WITH_RC4_128_SHA [RFC4492]
* 0xC0,0x03 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA [RFC4492]
* 0xC0,0x04 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA [RFC4492]
* 0xC0,0x05 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA [RFC4492]
* 0xC0,0x06 TLS_ECDHE_ECDSA_WITH_NULL_SHA [RFC4492]
* 0xC0,0x07 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA [RFC4492]
* 0xC0,0x08 TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA [RFC4492]
* 0xC0,0x09 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA [RFC4492]
* 0xC0,0x0A TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA [RFC4492]
* 0xC0,0x0B TLS_ECDH_RSA_WITH_NULL_SHA [RFC4492]
* 0xC0,0x0C TLS_ECDH_RSA_WITH_RC4_128_SHA [RFC4492]
* 0xC0,0x0D TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA [RFC4492]
* 0xC0,0x0E TLS_ECDH_RSA_WITH_AES_128_CBC_SHA [RFC4492]
* 0xC0,0x0F TLS_ECDH_RSA_WITH_AES_256_CBC_SHA [RFC4492]
* 0xC0,0x10 TLS_ECDHE_RSA_WITH_NULL_SHA [RFC4492]
* 0xC0,0x11 TLS_ECDHE_RSA_WITH_RC4_128_SHA [RFC4492]
* 0xC0,0x12 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA [RFC4492]
* 0xC0,0x13 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA [RFC4492]
* 0xC0,0x14 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA [RFC4492]
* 0xC0,0x15 TLS_ECDH_anon_WITH_NULL_SHA [RFC4492]
* 0xC0,0x16 TLS_ECDH_anon_WITH_RC4_128_SHA [RFC4492]
* 0xC0,0x17 TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA [RFC4492]
* 0xC0,0x18 TLS_ECDH_anon_WITH_AES_128_CBC_SHA [RFC4492]
* 0xC0,0x19 TLS_ECDH_anon_WITH_AES_256_CBC_SHA [RFC4492]
* 0xC0,0x1A TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA [RFC5054]
* 0xC0,0x1B TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA [RFC5054]
* 0xC0,0x1C TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA [RFC5054]
* 0xC0,0x1D TLS_SRP_SHA_WITH_AES_128_CBC_SHA [RFC5054]
* 0xC0,0x1E TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA [RFC5054]
* 0xC0,0x1F TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA [RFC5054]
* 0xC0,0x20 TLS_SRP_SHA_WITH_AES_256_CBC_SHA [RFC5054]
* 0xC0,0x21 TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA [RFC5054]
* 0xC0,0x22 TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA [RFC5054]
* 0xC0,0x23 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 [RFC5289]
* 0xC0,0x24 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 [RFC5289]
* 0xC0,0x25 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 [RFC5289]
* 0xC0,0x26 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 [RFC5289]
* 0xC0,0x27 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 [RFC5289]
* 0xC0,0x28 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 [RFC5289]
* 0xC0,0x29 TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 [RFC5289]
* 0xC0,0x2A TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 [RFC5289]
* 0xC0,0x2B TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 [RFC5289]
* 0xC0,0x2C TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 [RFC5289]
* 0xC0,0x2D TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 [RFC5289]
* 0xC0,0x2E TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 [RFC5289]
* 0xC0,0x2F TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 [RFC5289]
* 0xC0,0x30 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 [RFC5289]
* 0xC0,0x31 TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 [RFC5289]
* 0xC0,0x32 TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 [RFC5289]
* 0xC0,0x33 TLS_ECDHE_PSK_WITH_RC4_128_SHA [RFC5489]
* 0xC0,0x34 TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA [RFC5489]
* 0xC0,0x35 TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA [RFC5489]
* 0xC0,0x36 TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA [RFC5489]
* 0xC0,0x37 TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 [RFC5489]
* 0xC0,0x38 TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 [RFC5489]
* 0xC0,0x39 TLS_ECDHE_PSK_WITH_NULL_SHA [RFC5489]
* 0xC0,0x3A TLS_ECDHE_PSK_WITH_NULL_SHA256 [RFC5489]
* 0xC0,0x3B TLS_ECDHE_PSK_WITH_NULL_SHA384 [RFC5489]
* 0xC0,0x3C-FF Unassigned
* 0xC1-FD,* Unassigned
* 0xFE,0x00-FD Unassigned
* 0xFE,0xFE-FF Reserved to avoid conflicts with widely
* deployed implementations [Pasi_Eronen]
* 0xFF,0x00-FF Reserved for Private Use [RFC5246]
*/
add("SSL_NULL_WITH_NULL_NULL",
/*
* Definition of the CipherSuites that are enabled by default.
* They are listed in preference order, most preferred first, using
* the following criteria:
* 1. Prefer the stronger buld cipher, in the order of AES_256,
* AES_128, RC-4, 3DES-EDE.
* 2. Prefer the stronger MAC algorithm, in the order of SHA384,
* SHA256, SHA, MD5.
* 3. Prefer the better performance of key exchange and digital
* signature algorithm, in the order of ECDHE-ECDSA, ECDHE-RSA,
* RSA, ECDH-ECDSA, ECDH-RSA, DHE-RSA, DHE-DSS.
*/
int p = DEFAULT_SUITES_PRIORITY * 2;
// shorten names to fit the following table cleanly.
// ID Key Exchange Cipher A obs suprt PRF
// ====== ============ ========= = === ===== ========
add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
add("TLS_RSA_WITH_AES_256_CBC_SHA256",
add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
add("TLS_RSA_WITH_AES_256_CBC_SHA",
add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA",
add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
add("TLS_RSA_WITH_AES_128_CBC_SHA256",
add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
add("TLS_RSA_WITH_AES_128_CBC_SHA",
add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
add("TLS_ECDHE_RSA_WITH_RC4_128_SHA",
add("SSL_RSA_WITH_RC4_128_SHA",
add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
add("TLS_ECDH_RSA_WITH_RC4_128_SHA",
add("TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
add("TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
add("SSL_RSA_WITH_3DES_EDE_CBC_SHA",
add("TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
add("TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
add("SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
add("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
add("SSL_RSA_WITH_RC4_128_MD5",
// Renegotiation protection request Signalling Cipher Suite Value (SCSV)
add("TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
/*
* Definition of the CipherSuites that are supported but not enabled
* by default.
* They are listed in preference order, preferred first, using the
* following criteria:
* 1. CipherSuites for KRB5 need additional KRB5 service
* configuration, and these suites are not common in practice,
* so we put KRB5 based cipher suites at the end of the supported
* list.
* 2. If a cipher suite has been obsoleted, we put it at the end of
* the list.
* 3. Prefer the stronger bulk cipher, in the order of AES_256,
* AES_128, RC-4, 3DES-EDE, DES, RC4_40, DES40, NULL.
* 4. Prefer the stronger MAC algorithm, in the order of SHA384,
* SHA256, SHA, MD5.
* 5. Prefer the better performance of key exchange and digital
* signature algorithm, in the order of ECDHE-ECDSA, ECDHE-RSA,
* RSA, ECDH-ECDSA, ECDH-RSA, DHE-RSA, DHE-DSS, anonymous.
*/
add("TLS_DH_anon_WITH_AES_256_CBC_SHA256",
add("TLS_ECDH_anon_WITH_AES_256_CBC_SHA",
add("TLS_DH_anon_WITH_AES_256_CBC_SHA",
add("TLS_DH_anon_WITH_AES_128_CBC_SHA256",
add("TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
add("TLS_DH_anon_WITH_AES_128_CBC_SHA",
add("TLS_ECDH_anon_WITH_RC4_128_SHA",
add("SSL_DH_anon_WITH_RC4_128_MD5",
add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
add("TLS_RSA_WITH_NULL_SHA256",
add("TLS_ECDHE_ECDSA_WITH_NULL_SHA",
add("TLS_ECDHE_RSA_WITH_NULL_SHA",
add("SSL_RSA_WITH_NULL_SHA",
add("TLS_ECDH_ECDSA_WITH_NULL_SHA",
add("TLS_ECDH_RSA_WITH_NULL_SHA",
add("TLS_ECDH_anon_WITH_NULL_SHA",
add("SSL_RSA_WITH_NULL_MD5",
// weak cipher suites obsoleted in TLS 1.2
add("SSL_RSA_WITH_DES_CBC_SHA",
add("SSL_DHE_RSA_WITH_DES_CBC_SHA",
add("SSL_DHE_DSS_WITH_DES_CBC_SHA",
add("SSL_DH_anon_WITH_DES_CBC_SHA",
// weak cipher suites obsoleted in TLS 1.1
add("SSL_RSA_EXPORT_WITH_RC4_40_MD5",
add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
// Supported Kerberos ciphersuites from RFC2712
add("TLS_KRB5_WITH_RC4_128_SHA",
add("TLS_KRB5_WITH_RC4_128_MD5",
add("TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
add("TLS_KRB5_WITH_DES_CBC_SHA",
add("TLS_KRB5_WITH_DES_CBC_MD5",
add("TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
add("TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
/*
* Other values from the TLS Cipher Suite Registry, as of August 2010.
*
*
* Range Registration Procedures Notes
* 000-191 Standards Action Refers to value of first byte
* 192-254 Specification Required Refers to value of first byte
* 255 Reserved for Private Use Refers to value of first byte
*/
// Register the names of a few additional CipherSuites.
// Makes them show up as names instead of numbers in
// the debug output.
// remaining unsupported ciphersuites defined in RFC2246.
// SSL 3.0 Fortezza ciphersuites
// 1024/56 bit exportable ciphersuites from expired internet draft
// Netscape old and new SSL 3.0 FIPS ciphersuites
// Unsupported Kerberos cipher suites from RFC 2712
// Unsupported cipher suites from RFC 4162
// Unsupported cipher suites from RFC 4279
// Unsupported cipher suites from RFC 4785
// Unsupported cipher suites from RFC 5246
// Unsupported cipher suites from RFC 5288
// Unsupported cipher suites from RFC 5487
// Unsupported cipher suites from RFC 5932
// Unsupported cipher suites from RFC 5054
// Unsupported cipher suites from RFC 5289
// Unsupported cipher suites from RFC 5489
}
// ciphersuite SSL_NULL_WITH_NULL_NULL
// ciphersuite TLS_EMPTY_RENEGOTIATION_INFO_SCSV
}