src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java
branchJDK-8145252-TLS13-branch
changeset 56603 f103e0c2be1e
parent 56542 56aaa6cb3693
child 56806 32a737f51e37
equal deleted inserted replaced
56600:58ad02eb44c3 56603:f103e0c2be1e
   229                 // unlikely
   229                 // unlikely
   230                 chc.conContext.fatal(Alert.INTERNAL_ERROR,
   230                 chc.conContext.fatal(Alert.INTERNAL_ERROR,
   231                         "Not supported key exchange type");
   231                         "Not supported key exchange type");
   232             } else {
   232             } else {
   233                 SSLKeyDerivation masterKD = ke.createKeyDerivation(chc);
   233                 SSLKeyDerivation masterKD = ke.createKeyDerivation(chc);
   234                 SecretKey masterSecret = masterKD.deriveKey("TODO", null);
   234                 SecretKey masterSecret =
       
   235                         masterKD.deriveKey("MasterSecret", null);
   235                 chc.handshakeSession.setMasterSecret(masterSecret);
   236                 chc.handshakeSession.setMasterSecret(masterSecret);
   236 
   237 
   237                 SSLTrafficKeyDerivation kd =
   238                 SSLTrafficKeyDerivation kd =
   238                         SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
   239                         SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
   239                 if (kd == null) {
   240                 if (kd == null) {
   340                         "Could not generate ECPublicKey").initCause(e));
   341                         "Could not generate ECPublicKey").initCause(e));
   341             }
   342             }
   342 
   343 
   343             // update the states
   344             // update the states
   344             SSLKeyDerivation masterKD = ke.createKeyDerivation(shc);
   345             SSLKeyDerivation masterKD = ke.createKeyDerivation(shc);
   345             SecretKey masterSecret = masterKD.deriveKey("TODO", null);
   346             SecretKey masterSecret =
       
   347                     masterKD.deriveKey("MasterSecret", null);
   346             shc.handshakeSession.setMasterSecret(masterSecret);
   348             shc.handshakeSession.setMasterSecret(masterSecret);
   347 
   349 
   348             SSLTrafficKeyDerivation kd =
   350             SSLTrafficKeyDerivation kd =
   349                     SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
   351                     SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
   350             if (kd == null) {
   352             if (kd == null) {
   409                 // unlikely
   411                 // unlikely
   410                 chc.conContext.fatal(Alert.INTERNAL_ERROR,
   412                 chc.conContext.fatal(Alert.INTERNAL_ERROR,
   411                         "Not supported key exchange type");
   413                         "Not supported key exchange type");
   412             } else {
   414             } else {
   413                 SSLKeyDerivation masterKD = ke.createKeyDerivation(chc);
   415                 SSLKeyDerivation masterKD = ke.createKeyDerivation(chc);
   414                 SecretKey masterSecret = masterKD.deriveKey("TODO", null);
   416                 SecretKey masterSecret =
       
   417                         masterKD.deriveKey("MasterSecret", null);
   415                 chc.handshakeSession.setMasterSecret(masterSecret);
   418                 chc.handshakeSession.setMasterSecret(masterSecret);
   416 
   419 
   417                 SSLTrafficKeyDerivation kd =
   420                 SSLTrafficKeyDerivation kd =
   418                         SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
   421                         SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol);
   419                 if (kd == null) {
   422                 if (kd == null) {
   512                         "Could not generate ECPublicKey").initCause(e));
   515                         "Could not generate ECPublicKey").initCause(e));
   513             }
   516             }
   514 
   517 
   515             // update the states
   518             // update the states
   516             SSLKeyDerivation masterKD = ke.createKeyDerivation(shc);
   519             SSLKeyDerivation masterKD = ke.createKeyDerivation(shc);
   517             SecretKey masterSecret = masterKD.deriveKey("TODO", null);
   520             SecretKey masterSecret =
       
   521                     masterKD.deriveKey("MasterSecret", null);
   518             shc.handshakeSession.setMasterSecret(masterSecret);
   522             shc.handshakeSession.setMasterSecret(masterSecret);
   519 
   523 
   520             SSLTrafficKeyDerivation kd =
   524             SSLTrafficKeyDerivation kd =
   521                     SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
   525                     SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol);
   522             if (kd == null) {
   526             if (kd == null) {