8207237: SSLSocket#setEnabledCipherSuites is accepting empty string
Reviewed-by: xuelei
--- 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;