8207237: SSLSocket#setEnabledCipherSuites is accepting empty string
authorjnimeh
Wed, 18 Jul 2018 14:32:46 -0700
changeset 51115 6659a00bc2ea
parent 51114 990db216e719
child 51116 7e34f3da2293
8207237: SSLSocket#setEnabledCipherSuites is accepting empty string Reviewed-by: xuelei
src/java.base/share/classes/sun/security/ssl/CipherSuite.java
--- a/src/java.base/share/classes/sun/security/ssl/CipherSuite.java	Wed Jul 18 09:50:04 2018 -0700
+++ b/src/java.base/share/classes/sun/security/ssl/CipherSuite.java	Wed Jul 18 14:32:46 2018 -0700
@@ -891,9 +891,10 @@
 
         List<CipherSuite> cipherSuites = new ArrayList<>(names.length);
         for (String name : names) {
-            if (name == null) {
+            if (name == null || name.isEmpty()) {
                 throw new IllegalArgumentException(
-                    "The specified CipherSuites array contain null element");
+                        "The specified CipherSuites array contains " +
+                        "invalid null or empty string elements");
             }
 
             boolean found = false;