jdk/src/java.base/share/classes/sun/security/ssl/HelloExtensions.java
changeset 34380 2b2609379881
parent 32032 22badc53802f
child 37814 844e590a011a
equal deleted inserted replaced
34379:e9e364c8c44e 34380:2b2609379881
    31 import javax.net.ssl.*;
    31 import javax.net.ssl.*;
    32 
    32 
    33 /**
    33 /**
    34  * This file contains all the classes relevant to TLS Extensions for the
    34  * This file contains all the classes relevant to TLS Extensions for the
    35  * ClientHello and ServerHello messages. The extension mechanism and
    35  * ClientHello and ServerHello messages. The extension mechanism and
    36  * several extensions are defined in RFC 3546. Additional extensions are
    36  * several extensions are defined in RFC 6066. Additional extensions are
    37  * defined in the ECC RFC 4492.
    37  * defined in the ECC RFC 4492 and the ALPN extension is defined in RFC 7301.
    38  *
    38  *
    39  * Currently, only the two ECC extensions are fully supported.
    39  * Currently, only the two ECC extensions are fully supported.
    40  *
    40  *
    41  * The classes contained in this file are:
    41  * The classes contained in this file are:
    42  *  . HelloExtensions: a List of extensions as used in the client hello
    42  *  . HelloExtensions: a List of extensions as used in the client hello
    50  *  . ServerNameExtension: the server_name extension.
    50  *  . ServerNameExtension: the server_name extension.
    51  *  . SignatureAlgorithmsExtension: the signature_algorithms extension.
    51  *  . SignatureAlgorithmsExtension: the signature_algorithms extension.
    52  *  . SupportedEllipticCurvesExtension: the ECC supported curves extension.
    52  *  . SupportedEllipticCurvesExtension: the ECC supported curves extension.
    53  *  . SupportedEllipticPointFormatsExtension: the ECC supported point formats
    53  *  . SupportedEllipticPointFormatsExtension: the ECC supported point formats
    54  *      (compressed/uncompressed) extension.
    54  *      (compressed/uncompressed) extension.
       
    55  *  . ALPNExtension: the application_layer_protocol_negotiation extension.
    55  *
    56  *
    56  * @since   1.6
    57  * @since   1.6
    57  * @author  Andreas Sterbenz
    58  * @author  Andreas Sterbenz
    58  */
    59  */
    59 final class HelloExtensions {
    60 final class HelloExtensions {
    83             } else if (extType == ExtensionType.EXT_EC_POINT_FORMATS) {
    84             } else if (extType == ExtensionType.EXT_EC_POINT_FORMATS) {
    84                 extension =
    85                 extension =
    85                         new SupportedEllipticPointFormatsExtension(s, extlen);
    86                         new SupportedEllipticPointFormatsExtension(s, extlen);
    86             } else if (extType == ExtensionType.EXT_RENEGOTIATION_INFO) {
    87             } else if (extType == ExtensionType.EXT_RENEGOTIATION_INFO) {
    87                 extension = new RenegotiationInfoExtension(s, extlen);
    88                 extension = new RenegotiationInfoExtension(s, extlen);
       
    89             } else if (extType == ExtensionType.EXT_ALPN) {
       
    90                 extension = new ALPNExtension(s, extlen);
    88             } else if (extType == ExtensionType.EXT_MAX_FRAGMENT_LENGTH) {
    91             } else if (extType == ExtensionType.EXT_MAX_FRAGMENT_LENGTH) {
    89                 extension = new MaxFragmentLengthExtension(s, extlen);
    92                 extension = new MaxFragmentLengthExtension(s, extlen);
    90             } else if (extType == ExtensionType.EXT_STATUS_REQUEST) {
    93             } else if (extType == ExtensionType.EXT_STATUS_REQUEST) {
    91                 extension = new CertStatusReqExtension(s, extlen);
    94                 extension = new CertStatusReqExtension(s, extlen);
    92             } else if (extType == ExtensionType.EXT_STATUS_REQUEST_V2) {
    95             } else if (extType == ExtensionType.EXT_STATUS_REQUEST_V2) {