src/java.base/share/classes/sun/security/ssl/HandshakeContext.java
branchJDK-8145252-TLS13-branch
changeset 56715 b152d06ed6a9
parent 56702 75527e40bdfd
equal deleted inserted replaced
56714:2d7e08d730b6 56715:b152d06ed6a9
   116 
   116 
   117     // protocol version being established
   117     // protocol version being established
   118     int                                     clientHelloVersion;
   118     int                                     clientHelloVersion;
   119     String                                  applicationProtocol;
   119     String                                  applicationProtocol;
   120 
   120 
   121     // the preferable signature algorithm used by ServerKeyExchange message
       
   122     SignatureScheme                         preferableSignatureAlgorithm;
       
   123 
       
   124     RandomCookie                            clientHelloRandom;
   121     RandomCookie                            clientHelloRandom;
   125     RandomCookie                            serverHelloRandom;
   122     RandomCookie                            serverHelloRandom;
   126     byte[]                                  certRequestContext;
   123     byte[]                                  certRequestContext;
   127 
   124 
   128     ////////////////////
   125     ////////////////////
   226         this.handshakePossessions = null;
   223         this.handshakePossessions = null;
   227         this.handshakeCredentials = null;
   224         this.handshakeCredentials = null;
   228     }
   225     }
   229 
   226 
   230     // Initialize the non-final class variables.
   227     // Initialize the non-final class variables.
   231     private void initialize() throws IOException {
   228     private void initialize() {
   232         ProtocolVersion inputHelloVersion;
   229         ProtocolVersion inputHelloVersion;
   233         ProtocolVersion outputHelloVersion;
   230         ProtocolVersion outputHelloVersion;
   234         if (conContext.isNegotiated) {
   231         if (conContext.isNegotiated) {
   235             inputHelloVersion = conContext.protocolVersion;
   232             inputHelloVersion = conContext.protocolVersion;
   236             outputHelloVersion = conContext.protocolVersion;
   233             outputHelloVersion = conContext.protocolVersion;
   496      */
   493      */
   497     boolean isNegotiable(ProtocolVersion protocolVersion) {
   494     boolean isNegotiable(ProtocolVersion protocolVersion) {
   498         return activeProtocols.contains(protocolVersion);
   495         return activeProtocols.contains(protocolVersion);
   499     }
   496     }
   500 
   497 
   501     boolean isNegotiable(byte majorVersion, byte minorVersion) {
       
   502         ProtocolVersion pv =
       
   503                 ProtocolVersion.valueOf(majorVersion, minorVersion);
       
   504         if (pv == null) {
       
   505             // unsupported protocol version
       
   506             return false;
       
   507         }
       
   508 
       
   509         return activeProtocols.contains(pv);
       
   510     }
       
   511 
       
   512     /**
   498     /**
   513      * Set the active protocol version and propagate it to the SSLSocket
   499      * Set the active protocol version and propagate it to the SSLSocket
   514      * and our handshake streams. Called from ClientHandshaker
   500      * and our handshake streams. Called from ClientHandshaker
   515      * and ServerHandshaker with the negotiated protocol version.
   501      * and ServerHandshaker with the negotiated protocol version.
   516      */
   502      */