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