changeset 51115:6659a00bc2ea

8207237: SSLSocket#setEnabledCipherSuites is accepting empty string Reviewed-by: xuelei
author jnimeh
date Wed, 18 Jul 2018 14:32:46 -0700
parents 990db216e719
children 7e34f3da2293
files src/java.base/share/classes/sun/security/ssl/CipherSuite.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;