summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorAdam Vartanian <flooey@google.com>2018-09-12 11:32:53 +0100
committerAdam Vartanian <flooey@google.com>2018-09-13 10:55:55 +0100
commitd2d3cddb90929ef0bfee37433282bc1e7b13c094 (patch)
treebfb918a5034cd3821ef5960d1dd77992271cd694 /support
parent0a4a4d8c4d4cc5c5737d969491f924578c33d10e (diff)
Update tests for Conscrypt update
This mainly updates the tests to account for the existence of TLS 1.3. In particular, add the new TLS 1.3-related constants to StandardNames and update some old harmony tests to handle the fact that we now report TLS 1.3 cipher suites as being supported. Bug: 110403171 Test: cts -m CtsLibcoreTestCases Test: cts -m CtsLibcoreOkHttpTestCases Test: cts -m CtsLibcoreWycheproofConscryptTestCases Change-Id: I1ff6aa5961438527b0eb882488a5dbfaaeaacc6c
Diffstat (limited to 'support')
-rw-r--r--support/src/test/java/libcore/java/security/StandardNames.java31
1 files changed, 25 insertions, 6 deletions
diff --git a/support/src/test/java/libcore/java/security/StandardNames.java b/support/src/test/java/libcore/java/security/StandardNames.java
index 336929309c..3ca350114c 100644
--- a/support/src/test/java/libcore/java/security/StandardNames.java
+++ b/support/src/test/java/libcore/java/security/StandardNames.java
@@ -264,6 +264,7 @@ public final class StandardNames {
provide("SSLContext", "TLSv1");
provide("SSLContext", "TLSv1.1");
provide("SSLContext", "TLSv1.2");
+ provide("SSLContext", "TLSv1.3");
provide("SecretKeyFactory", "DES");
provide("SecretKeyFactory", "DESede");
provide("SecretKeyFactory", "PBEWithMD5AndDES");
@@ -683,7 +684,8 @@ public final class StandardNames {
public static final Set<String> SSL_SOCKET_PROTOCOLS = new HashSet<String>(Arrays.asList(
"TLSv1",
"TLSv1.1",
- "TLSv1.2"));
+ "TLSv1.2",
+ "TLSv1.3"));
public static final Set<String> SSL_SOCKET_PROTOCOLS_CLIENT_DEFAULT =
new HashSet<String>(Arrays.asList(
"TLSv1",
@@ -710,11 +712,13 @@ public final class StandardNames {
}
}
- private static enum TLSVersion {
+ private enum TLSVersion {
SSLv3("SSLv3"),
TLSv1("TLSv1"),
TLSv11("TLSv1.1"),
- TLSv12("TLSv1.2");
+ TLSv12("TLSv1.2"),
+ TLSv13("TLSv1.3"),
+ ;
private final String name;
@@ -735,8 +739,9 @@ public final class StandardNames {
/**
* Valid values for X509TrustManager.checkServerTrusted authType,
- * either key exchange algorithm part of the cipher suite
- * or UNKNOWN.
+ * either key exchange algorithm part of the cipher suite, UNKNOWN,
+ * or GENERIC (for TLS 1.3 cipher suites that don't imply a specific
+ * key exchange method).
*/
public static final Set<String> SERVER_AUTH_TYPES = new HashSet<String>(Arrays.asList(
"DHE_DSS",
@@ -756,7 +761,8 @@ public final class StandardNames {
"ECDH_RSA",
"ECDHE_ECDSA",
"ECDHE_RSA",
- "UNKNOWN"));
+ "UNKNOWN",
+ "GENERIC"));
public static final String CIPHER_SUITE_INVALID = "SSL_NULL_WITH_NULL_NULL";
@@ -811,6 +817,11 @@ public final class StandardNames {
addOpenSsl("TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256");
addOpenSsl("TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256");
+ // TLSv1.3 cipher suites
+ addOpenSsl("TLS_AES_128_GCM_SHA256");
+ addOpenSsl("TLS_AES_256_GCM_SHA384");
+ addOpenSsl("TLS_CHACHA20_POLY1305_SHA256");
+
// Pre-Shared Key (PSK) cipher suites
addOpenSsl("TLS_PSK_WITH_AES_128_CBC_SHA");
addOpenSsl("TLS_PSK_WITH_AES_256_CBC_SHA");
@@ -943,6 +954,14 @@ public final class StandardNames {
"SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA"
);
+ /**
+ * Cipher suites that are only supported with TLS 1.3.
+ */
+ public static final List<String> CIPHER_SUITES_TLS13 = Arrays.asList(
+ "TLS_AES_128_GCM_SHA256",
+ "TLS_AES_256_GCM_SHA384",
+ "TLS_CHACHA20_POLY1305_SHA256");
+
// NOTE: This list needs to be kept in sync with Javadoc of javax.net.ssl.SSLSocket and
// javax.net.ssl.SSLEngine.
private static final List<String> CIPHER_SUITES_ANDROID_AES_HARDWARE = Arrays.asList(