8207237: SSLSocket#setEnabledCipherSuites is accepting empty string
Reviewed-by: xuelei
--- a/src/java.base/share/classes/sun/security/ssl/CipherSuite.java Wed Jul 25 12:32:06 2018 -0400
+++ b/src/java.base/share/classes/sun/security/ssl/CipherSuite.java Wed Jul 25 09:48:31 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;