--- a/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java Mon Jun 25 21:22:16 2018 +0300
+++ b/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java Mon Jun 25 13:41:39 2018 -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<String> 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<String> 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<String> 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<String> 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.
*
@@ -392,7 +416,7 @@
int length = net.remaining();
System.out.println(wrapper + " wrapped " + length + " bytes.");
System.out.println(wrapper + " handshake status is "
- + engine.getHandshakeStatus());
+ + engine.getHandshakeStatus() + " Result is " + r.getStatus());
if (maxPacketSize < length && maxPacketSize != 0) {
throw new AssertionError("Handshake wrapped net buffer length "
+ length + " exceeds maximum packet size "
@@ -480,7 +504,7 @@
SSLEngineResult r = engine.unwrap(net, app);
app.flip();
System.out.println(unwrapper + " handshake status is "
- + engine.getHandshakeStatus());
+ + engine.getHandshakeStatus() + " Result is " + r.getStatus());
checkResult(r, wantedStatus);
if (result != null && result.length > 0) {
result[0] = r;
@@ -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":