src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java
branchJDK-8145252-TLS13-branch
changeset 56806 32a737f51e37
parent 56801 76025c6c6e29
equal deleted inserted replaced
56805:985a8862b6bf 56806:32a737f51e37
    53         public byte[] produce(ConnectionContext context,
    53         public byte[] produce(ConnectionContext context,
    54                 HandshakeMessage message) throws IOException {
    54                 HandshakeMessage message) throws IOException {
    55             // The producing happens in server side only.
    55             // The producing happens in server side only.
    56             ServerHandshakeContext shc = (ServerHandshakeContext)context;
    56             ServerHandshakeContext shc = (ServerHandshakeContext)context;
    57 
    57 
    58             SSLKeyExchange ke =
    58             SSLKeyExchange ke = SSLKeyExchange.valueOf(
    59                 SSLKeyExchange.valueOf(shc.negotiatedCipherSuite.keyExchange);
    59                     shc.negotiatedCipherSuite.keyExchange,
       
    60                     shc.negotiatedProtocol);
    60             if (ke != null) {
    61             if (ke != null) {
    61                 for (Map.Entry<Byte, HandshakeProducer> hc :
    62                 for (Map.Entry<Byte, HandshakeProducer> hc :
    62                         ke.getHandshakeProducers(shc)) {
    63                         ke.getHandshakeProducers(shc)) {
    63                     if (hc.getKey() == SSLHandshake.SERVER_KEY_EXCHANGE.id) {
    64                     if (hc.getKey() == SSLHandshake.SERVER_KEY_EXCHANGE.id) {
    64                         return hc.getValue().produce(context, message);
    65                         return hc.getValue().produce(context, message);
    90             ClientHandshakeContext chc = (ClientHandshakeContext)context;
    91             ClientHandshakeContext chc = (ClientHandshakeContext)context;
    91 
    92 
    92             // clean up this consumer
    93             // clean up this consumer
    93             chc.handshakeConsumers.remove(SSLHandshake.SERVER_KEY_EXCHANGE.id);
    94             chc.handshakeConsumers.remove(SSLHandshake.SERVER_KEY_EXCHANGE.id);
    94 
    95 
    95             SSLKeyExchange ke =
    96             SSLKeyExchange ke = SSLKeyExchange.valueOf(
    96                 SSLKeyExchange.valueOf(chc.negotiatedCipherSuite.keyExchange);
    97                     chc.negotiatedCipherSuite.keyExchange,
       
    98                     chc.negotiatedProtocol);
    97             if (ke != null) {
    99             if (ke != null) {
    98                 for (Map.Entry<Byte, SSLConsumer> hc :
   100                 for (Map.Entry<Byte, SSLConsumer> hc :
    99                         ke.getHandshakeConsumers(chc)) {
   101                         ke.getHandshakeConsumers(chc)) {
   100                     if (hc.getKey() == SSLHandshake.SERVER_KEY_EXCHANGE.id) {
   102                     if (hc.getKey() == SSLHandshake.SERVER_KEY_EXCHANGE.id) {
   101                         hc.getValue().consume(context, message);
   103                         hc.getValue().consume(context, message);