# HG changeset patch # User ssahoo # Date 1575008947 28800 # Node ID 753ab8dcdbbaf8c124c2dae7fee35c8d1bc05cfe # Parent e0d919d7c1a64cccccd7c20f8dcc4d6f2a165f87 8234723: javax/net/ssl/TLS tests support TLSv1.3 Summary: Missing TLSv1.3 test cases Reviewed-by: xuelei diff -r e0d919d7c1a6 -r 753ab8dcdbba test/jdk/javax/net/ssl/TLS/TLSClientPropertyTest.java --- a/test/jdk/javax/net/ssl/TLS/TLSClientPropertyTest.java Fri Nov 29 14:07:16 2019 +0800 +++ b/test/jdk/javax/net/ssl/TLS/TLSClientPropertyTest.java Thu Nov 28 22:29:07 2019 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8049432 8069038 + * @bug 8049432 8069038 8234723 * @summary New tests for TLS property jdk.tls.client.protocols * @summary javax/net/ssl/TLS/TLSClientPropertyTest.java needs to be * updated for JDK-8061210 @@ -40,6 +40,8 @@ * @run main/othervm TLSClientPropertyTest TLSv1 * @run main/othervm TLSClientPropertyTest TLSv11 * @run main/othervm TLSClientPropertyTest TLSv12 + * @run main/othervm TLSClientPropertyTest TLSv13 + * @run main/othervm TLSClientPropertyTest TLS * @run main/othervm TLSClientPropertyTest WrongProperty */ @@ -57,7 +59,7 @@ */ public class TLSClientPropertyTest { private final String[] expectedSupportedProtos = new String[] { - "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2" + "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" }; public static void main(String[] args) throws Exception { @@ -77,7 +79,7 @@ } contextProtocol = null; expectedDefaultProtos = new String[] { - "TLSv1", "TLSv1.1", "TLSv1.2" + "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" }; break; case "SSLv3": @@ -103,6 +105,13 @@ "TLSv1", "TLSv1.1", "TLSv1.2" }; break; + case "TLSv13": + case "TLS": + contextProtocol = "TLSv1.3"; + expectedDefaultProtos = new String[] { + "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" + }; + break; case "WrongProperty": expectedDefaultProtos = new String[] {}; contextProtocol = "TLSV"; diff -r e0d919d7c1a6 -r 753ab8dcdbba test/jdk/javax/net/ssl/TLS/TestJSSEClientDefaultProtocol.java --- a/test/jdk/javax/net/ssl/TLS/TestJSSEClientDefaultProtocol.java Fri Nov 29 14:07:16 2019 +0800 +++ b/test/jdk/javax/net/ssl/TLS/TestJSSEClientDefaultProtocol.java Thu Nov 28 22:29:07 2019 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8049429 + * @bug 8049429 8234723 * @modules java.management * jdk.crypto.ec/sun.security.ec * @summary Test that all cipher suites work in all versions and all client @@ -33,23 +33,35 @@ * @run main/othervm * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1 * -DCLIENT_PROTOCOL=DEFAULT - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_CBC_SHA * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 * -DCLIENT_PROTOCOL=DEFAULT - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_GCM_SHA256 * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 * -DCLIENT_PROTOCOL=DEFAULT * -Djdk.tls.client.protocols=TLSv1 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_CBC_SHA * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1 * -DCLIENT_PROTOCOL=DEFAULT * -Djdk.tls.client.protocols=TLSv1.2 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_GCM_SHA256 + * TestJSSE javax.net.ssl.SSLHandshakeException + * @run main/othervm + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=DEFAULT + * -Djdk.tls.client.protocols=TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 + * TestJSSE + * @run main/othervm + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1 + * -DCLIENT_PROTOCOL=DEFAULT + * -Djdk.tls.client.protocols=TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 * TestJSSE javax.net.ssl.SSLHandshakeException */ diff -r e0d919d7c1a6 -r 753ab8dcdbba test/jdk/javax/net/ssl/TLS/TestJSSEClientProtocol.java --- a/test/jdk/javax/net/ssl/TLS/TestJSSEClientProtocol.java Fri Nov 29 14:07:16 2019 +0800 +++ b/test/jdk/javax/net/ssl/TLS/TestJSSEClientProtocol.java Thu Nov 28 22:29:07 2019 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8049429 8172273 + * @bug 8049429 8172273 8234723 * @modules java.management * jdk.crypto.ec/sun.security.ec * @summary Test that all cipher suites work in all versions and all client @@ -31,21 +31,26 @@ * and all checking is done on the client side. * @compile CipherTestUtils.java JSSEClient.java JSSEServer.java * @run main/othervm - * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 * TestJSSE * @run main/othervm - * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 * -DCIPHER=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 * TestJSSE * @run main/othervm - * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2 + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 * -DCIPHER=TLS_DHE_RSA_WITH_AES_128_CBC_SHA * TestJSSE * @run main/othervm + * -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 + * TestJSSE + * @run main/othervm * -DSERVER_PROTOCOL=SSLv3 * -DCLIENT_PROTOCOL=SSLv3 * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 @@ -53,16 +58,21 @@ * @run main/othervm * -DSERVER_PROTOCOL=SSLv3,TLSv1 * -DCLIENT_PROTOCOL=TLSv1 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_CBC_SHA * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=SSLv3,TLSv1,TLSv1.1 * -DCLIENT_PROTOCOL=TLSv1.1 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_256_CBC_SHA * TestJSSE * @run main/othervm - * -DSERVER_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2 + * -DSERVER_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 * -DCLIENT_PROTOCOL=TLSv1.2 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_GCM_SHA256 + * TestJSSE + * @run main/othervm + * -DSERVER_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCLIENT_PROTOCOL=TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 * TestJSSE */ diff -r e0d919d7c1a6 -r 753ab8dcdbba test/jdk/javax/net/ssl/TLS/TestJSSEServerProtocol.java --- a/test/jdk/javax/net/ssl/TLS/TestJSSEServerProtocol.java Fri Nov 29 14:07:16 2019 +0800 +++ b/test/jdk/javax/net/ssl/TLS/TestJSSEServerProtocol.java Thu Nov 28 22:29:07 2019 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8049429 + * @bug 8049429 8234723 * @modules java.management * jdk.crypto.ec/sun.security.ec * @summary Test that all cipher suites work in all versions and all client @@ -38,16 +38,26 @@ * @run main/othervm * -DSERVER_PROTOCOL=TLSv1 * -DCLIENT_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_CBC_SHA * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=TLSv1.1 * -DCLIENT_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_256_CBC_SHA * TestJSSE * @run main/othervm * -DSERVER_PROTOCOL=TLSv1.2 * -DCLIENT_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2 - * -DCIPHER=SSL_RSA_WITH_RC4_128_MD5 + * -DCIPHER=TLS_RSA_WITH_AES_128_GCM_SHA256 + * TestJSSE + * @run main/othervm + * -DSERVER_PROTOCOL=TLSv1.3 + * -DCLIENT_PROTOCOL=SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 * TestJSSE + * @run main/othervm + * -DSERVER_PROTOCOL=TLSv1.2 + * -DCLIENT_PROTOCOL=TLSv1.3 + * -DCIPHER=TLS_AES_256_GCM_SHA384 + * TestJSSE javax.net.ssl.SSLHandshakeException */