--- old/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java 2018-05-11 15:07:26.515088400 -0700 +++ new/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java 2018-05-11 15:07:26.039237100 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, 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 @@ -85,6 +85,12 @@ SSLEngineTestCase.ENABLED_NON_KRB_NOT_ANON_CIPHERS, "Enabled by default non kerberos not anonymous"), /** + * Ciphers supported by TLS 1.3 only. + */ + TLS13_CIPHERS( + SSLEngineTestCase.TLS13_CIPHERS, + "Supported by TLS 1.3 only"), + /** * Ciphers unsupported by the tested SSLEngine. */ UNSUPPORTED_CIPHERS(SSLEngineTestCase.UNSUPPORTED_CIPHERS, @@ -174,6 +180,11 @@ private static final String SERVER_NAME = "service.localhost"; private static final String SNI_PATTERN = ".*"; + private static final String[] TLS13_CIPHERS = { + "TLS_AES_256_GCM_SHA384", + "TLS_AES_128_GCM_SHA256" + }; + private static final String[] SUPPORTED_NON_KRB_CIPHERS; static { @@ -183,8 +194,8 @@ List supportedCiphersList = new LinkedList<>(); for (String cipher : allSupportedCiphers) { if (!cipher.contains("KRB5") - && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { - + && !isTLS13Cipher(cipher) + && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { supportedCiphersList.add(cipher); } } @@ -204,6 +215,7 @@ List supportedCiphersList = new LinkedList<>(); for (String cipher : allSupportedCiphers) { if (!cipher.contains("KRB5") + && !isTLS13Cipher(cipher) && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV") && !cipher.endsWith("_SHA256") && !cipher.endsWith("_SHA384")) { @@ -226,7 +238,8 @@ List supportedCiphersList = new LinkedList<>(); for (String cipher : allSupportedCiphers) { if (cipher.contains("KRB5") - && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { + && !isTLS13Cipher(cipher) + && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { supportedCiphersList.add(cipher); } } @@ -246,7 +259,8 @@ List enabledCiphersList = new LinkedList<>(); for (String cipher : enabledCiphers) { if (!cipher.contains("anon") && !cipher.contains("KRB5") - && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { + && !isTLS13Cipher(cipher) + && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { enabledCiphersList.add(cipher); } } @@ -303,6 +317,16 @@ this.maxPacketSize = 0; } + private static boolean isTLS13Cipher(String cipher) { + for (String cipherSuite : TLS13_CIPHERS) { + if (cipherSuite.equals(cipher)) { + return true; + } + } + + return false; + } + /** * Wraps data with the specified engine. * @@ -713,8 +737,13 @@ case "TLSv1.1": runTests(Ciphers.SUPPORTED_NON_KRB_NON_SHA_CIPHERS); break; - default: + case "DTLSv1.1": + case "TLSv1.2": runTests(Ciphers.SUPPORTED_NON_KRB_CIPHERS); + break; + case "TLSv1.3": + runTests(Ciphers.TLS13_CIPHERS); + break; } break; case "krb":