< prev index next >

src/java.base/share/classes/sun/security/ssl/HandshakeContext.java

Print this page

        

@@ -44,12 +44,13 @@
 import java.util.Queue;
 import javax.crypto.SecretKey;
 import javax.net.ssl.SNIServerName;
 import javax.net.ssl.SSLHandshakeException;
 import javax.security.auth.x500.X500Principal;
-import sun.security.ssl.NamedGroup.NamedGroupType;
-import static sun.security.ssl.NamedGroup.NamedGroupType.*;
+import sun.security.ssl.SupportedGroupsExtension.NamedGroup;
+import sun.security.ssl.SupportedGroupsExtension.NamedGroupType;
+import static sun.security.ssl.SupportedGroupsExtension.NamedGroupType.*;
 import sun.security.ssl.SupportedGroupsExtension.SupportedGroups;
 
 abstract class HandshakeContext implements ConnectionContext {
     // System properties
 

@@ -99,12 +100,10 @@
     boolean                                 kickstartMessageDelivered;
 
     // Resumption
     boolean                                 isResumption;
     SSLSessionImpl                          resumingSession;
-    // Session is using stateless resumption
-    boolean                                 statelessResumption = false;
 
     final Queue<Map.Entry<Byte, ByteBuffer>> delegatedActions;
     volatile boolean                        taskDelegated = false;
     volatile Exception                      delegatedThrown = null;
 

@@ -516,52 +515,45 @@
             if (suite.keyExchange == null) {
                 // TLS 1.3, no definition of key exchange in cipher suite.
                 return true;
             }
 
-            // Is at least one of the group types available?
-            boolean groupAvailable, retval = false;
-            NamedGroupType[] groupTypes = suite.keyExchange.groupTypes;
-            for (NamedGroupType groupType : groupTypes) {
-                if (groupType != NAMED_GROUP_NONE) {
-                    Boolean checkedStatus = cachedStatus.get(groupType);
-                    if (checkedStatus == null) {
-                        groupAvailable = SupportedGroups.isActivatable(
-                                algorithmConstraints, groupType);
-                        cachedStatus.put(groupType, groupAvailable);
-
-                        if (!groupAvailable &&
-                                SSLLogger.isOn && SSLLogger.isOn("verbose")) {
-                            SSLLogger.fine(
-                                    "No activated named group in " + groupType);
-                        }
-                    } else {
-                        groupAvailable = checkedStatus;
+            boolean available;
+            NamedGroupType groupType = suite.keyExchange.groupType;
+            if (groupType != NAMED_GROUP_NONE) {
+                Boolean checkedStatus = cachedStatus.get(groupType);
+                if (checkedStatus == null) {
+                    available = SupportedGroups.isActivatable(
+                            algorithmConstraints, groupType);
+                    cachedStatus.put(groupType, available);
+
+                    if (!available &&
+                            SSLLogger.isOn && SSLLogger.isOn("verbose")) {
+                        SSLLogger.fine("No activated named group");
                     }
-
-                    retval |= groupAvailable;
                 } else {
-                    retval |= true;
+                    available = checkedStatus;
                 }
-            }
 
-            if (!retval && SSLLogger.isOn && SSLLogger.isOn("verbose")) {
-                SSLLogger.fine("No active named group(s), ignore " + suite);
+                if (!available && SSLLogger.isOn && SSLLogger.isOn("verbose")) {
+                    SSLLogger.fine(
+                        "No active named group, ignore " + suite);
+                }
+                return available;
+            } else {
+                return true;
             }
-
-            return retval;
-
         } else if (SSLLogger.isOn && SSLLogger.isOn("verbose")) {
             SSLLogger.fine("Ignore disabled cipher suite: " + suite);
         }
 
         return false;
     }
 
     List<SNIServerName> getRequestedServerNames() {
         if (requestedServerNames == null) {
-            return Collections.emptyList();
+            return Collections.<SNIServerName>emptyList();
         }
         return requestedServerNames;
     }
 }
 
< prev index next >