Skip to content

Commit b1e2ea8

Browse files
committed
8279164: Disable TLS_ECDH_* cipher suites
Reviewed-by: sgehwolf, andrew, mbalao Backport-of: 5dddf69319480251cdc904cf7a1d4fcd81573bb8
1 parent 6abb3f2 commit b1e2ea8

File tree

7 files changed

+47
-91
lines changed

7 files changed

+47
-91
lines changed

jdk/src/share/lib/security/java.security-aix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \
704704
# jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
705705
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
706706
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
707+
ECDH, \
707708
include jdk.disabled.namedCurves
708709

709710
# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)

jdk/src/share/lib/security/java.security-linux

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \
704704
# jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
705705
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
706706
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
707+
ECDH, \
707708
include jdk.disabled.namedCurves
708709

709710
# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)

jdk/src/share/lib/security/java.security-macosx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \
707707
# jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
708708
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
709709
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
710+
ECDH, \
710711
include jdk.disabled.namedCurves
711712

712713
# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)

jdk/src/share/lib/security/java.security-solaris

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@ jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \
705705
# jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
706706
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
707707
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
708+
ECDH, \
708709
include jdk.disabled.namedCurves
709710

710711
# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)

jdk/src/share/lib/security/java.security-windows

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \
707707
# jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
708708
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
709709
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
710+
ECDH, \
710711
include jdk.disabled.namedCurves
711712

712713
# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)

jdk/test/javax/net/ssl/ciphersuites/DisabledAlgorithms.java

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 8076221 8211883
26+
* @bug 8076221 8211883 8279164
2727
* @summary Check if weak cipher suites are disabled
2828
* @run main/othervm DisabledAlgorithms default
2929
* @run main/othervm DisabledAlgorithms empty
@@ -59,9 +59,9 @@ public class DisabledAlgorithms {
5959
System.getProperty("test.src", "./") + "/" + pathToStores +
6060
"/" + trustStoreFile;
6161

62-
// supported RC4, NULL, and anon cipher suites
63-
// it does not contain KRB5 cipher suites because they need a KDC
64-
private static final String[] rc4_null_anon_ciphersuites = new String[] {
62+
// disabled RC4, NULL, anon, and ECDH cipher suites
63+
private static final String[] disabled_ciphersuites
64+
= new String[] {
6565
"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
6666
"TLS_ECDHE_RSA_WITH_RC4_128_SHA",
6767
"SSL_RSA_WITH_RC4_128_SHA",
@@ -93,7 +93,19 @@ public class DisabledAlgorithms {
9393
"TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
9494
"TLS_ECDH_anon_WITH_AES_256_CBC_SHA",
9595
"TLS_ECDH_anon_WITH_NULL_SHA",
96-
"TLS_ECDH_anon_WITH_RC4_128_SHA"
96+
"TLS_ECDH_anon_WITH_RC4_128_SHA",
97+
"TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384",
98+
"TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384",
99+
"TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
100+
"TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
101+
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
102+
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
103+
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
104+
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
105+
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
106+
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
107+
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
108+
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA"
97109
};
98110

99111
public static void main(String[] args) throws Exception {
@@ -112,19 +124,18 @@ public static void main(String[] args) throws Exception {
112124
System.out.println("jdk.tls.disabledAlgorithms = "
113125
+ Security.getProperty("jdk.tls.disabledAlgorithms"));
114126

115-
// check if RC4, NULL, and anon cipher suites
116-
// can't be used by default
117-
checkFailure(rc4_null_anon_ciphersuites);
127+
// check that disabled cipher suites can't be used by default
128+
checkFailure(disabled_ciphersuites);
118129
break;
119130
case "empty":
120131
// reset jdk.tls.disabledAlgorithms
121132
Security.setProperty("jdk.tls.disabledAlgorithms", "");
122133
System.out.println("jdk.tls.disabledAlgorithms = "
123134
+ Security.getProperty("jdk.tls.disabledAlgorithms"));
124135

125-
// check if RC4, NULL, and anon cipher suites can be used
126-
// if jdk.tls.disabledAlgorithms is empty
127-
checkSuccess(rc4_null_anon_ciphersuites);
136+
// check that disabled cipher suites can be used if
137+
// jdk.tls.disabledAlgorithms is empty
138+
checkSuccess(disabled_ciphersuites);
128139
break;
129140
default:
130141
throw new RuntimeException("Wrong parameter: " + args[0]);
@@ -150,11 +161,12 @@ private static void checkFailure(String[] ciphersuites) throws Exception {
150161
throw new RuntimeException("Expected SSLHandshakeException "
151162
+ "not thrown");
152163
} catch (SSLHandshakeException e) {
153-
System.out.println("Expected exception on client side: "
164+
System.out.println("Got expected exception on client side: "
154165
+ e);
155166
}
156167
}
157168

169+
server.stop();
158170
while (server.isRunning()) {
159171
sleep();
160172
}
@@ -250,7 +262,6 @@ public void run() {
250262
} catch (SSLHandshakeException e) {
251263
System.out.println("Server: run: " + e);
252264
sslError = true;
253-
stopped = true;
254265
} catch (IOException e) {
255266
if (!stopped) {
256267
System.out.println("Server: run: unexpected exception: "

jdk/test/javax/net/ssl/sanity/ciphersuites/CheckCipherSuites.java

Lines changed: 18 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 4750141 4895631 8217579 8163326
26+
* @bug 4750141 4895631 8217579 8163326 8279164
2727
* @summary Check enabled and supported ciphersuites are correct
2828
* @run main/othervm CheckCipherSuites default
2929
* @run main/othervm CheckCipherSuites limited
@@ -46,52 +46,36 @@ public class CheckCipherSuites {
4646
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
4747
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
4848

49-
// AES_256(GCM) - ECDHE - forward screcy
49+
// AES_256(GCM) - ECDHE - forward secrecy
5050
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
5151

52-
// AES_128(GCM) - ECDHE - forward screcy
52+
// AES_128(GCM) - ECDHE - forward secrecy
5353
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
5454

55-
// AES_256(GCM) - DHE - forward screcy
55+
// AES_256(GCM) - DHE - forward secrecy
5656
"TLS_DHE_RSA_WITH_AES_256_GCM_SHA384",
5757
"TLS_DHE_DSS_WITH_AES_256_GCM_SHA384",
5858

59-
// AES_128(GCM) - DHE - forward screcy
59+
// AES_128(GCM) - DHE - forward secrecy
6060
"TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
6161
"TLS_DHE_DSS_WITH_AES_128_GCM_SHA256",
6262

63-
// AES_256(CBC) - ECDHE - forward screcy
63+
// AES_256(CBC) - ECDHE - forward secrecy
6464
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
6565
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
6666

67-
// AES_256(CBC) - ECDHE - forward screcy
67+
// AES_256(CBC) - ECDHE - forward secrecy
6868
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
6969
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
7070

71-
// AES_256(CBC) - DHE - forward screcy
71+
// AES_256(CBC) - DHE - forward secrecy
7272
"TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
7373
"TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
7474

75-
// AES_128(CBC) - DHE - forward screcy
75+
// AES_128(CBC) - DHE - forward secrecy
7676
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
7777
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
7878

79-
// AES_256(GCM) - not forward screcy
80-
"TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384",
81-
"TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384",
82-
83-
// AES_128(GCM) - not forward screcy
84-
"TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
85-
"TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
86-
87-
// AES_256(CBC) - not forward screcy
88-
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
89-
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
90-
91-
// AES_128(CBC) - not forward screcy
92-
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
93-
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
94-
9579
// AES_256(CBC) - ECDHE - using SHA
9680
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
9781
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
@@ -108,14 +92,6 @@ public class CheckCipherSuites {
10892
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
10993
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
11094

111-
// AES_256(CBC) - using SHA, not forward screcy
112-
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
113-
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
114-
115-
// AES_128(CBC) - using SHA, not forward screcy
116-
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
117-
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
118-
11995
// deprecated
12096
"TLS_RSA_WITH_AES_256_GCM_SHA384",
12197
"TLS_RSA_WITH_AES_128_GCM_SHA256",
@@ -138,16 +114,10 @@ public class CheckCipherSuites {
138114
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
139115
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
140116
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
141-
"TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
142-
"TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
143-
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
144-
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
145117
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
146118
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
147119
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
148120
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
149-
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
150-
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
151121
"TLS_RSA_WITH_AES_128_GCM_SHA256",
152122
"TLS_RSA_WITH_AES_128_CBC_SHA256",
153123
"TLS_RSA_WITH_AES_128_CBC_SHA",
@@ -165,52 +135,36 @@ public class CheckCipherSuites {
165135
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
166136
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
167137

168-
// AES_256(GCM) - ECDHE - forward screcy
138+
// AES_256(GCM) - ECDHE - forward secrecy
169139
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
170140

171-
// AES_128(GCM) - ECDHE - forward screcy
141+
// AES_128(GCM) - ECDHE - forward secrecy
172142
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
173143

174-
// AES_256(GCM) - DHE - forward screcy
144+
// AES_256(GCM) - DHE - forward secrecy
175145
"TLS_DHE_RSA_WITH_AES_256_GCM_SHA384",
176146
"TLS_DHE_DSS_WITH_AES_256_GCM_SHA384",
177147

178-
// AES_128(GCM) - DHE - forward screcy
148+
// AES_128(GCM) - DHE - forward secrecy
179149
"TLS_DHE_RSA_WITH_AES_128_GCM_SHA256",
180150
"TLS_DHE_DSS_WITH_AES_128_GCM_SHA256",
181151

182-
// AES_256(CBC) - ECDHE - forward screcy
152+
// AES_256(CBC) - ECDHE - forward secrecy
183153
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
184154
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
185155

186-
// AES_256(CBC) - ECDHE - forward screcy
156+
// AES_256(CBC) - ECDHE - forward secrecy
187157
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
188158
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
189159

190-
// AES_256(CBC) - DHE - forward screcy
160+
// AES_256(CBC) - DHE - forward secrecy
191161
"TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
192162
"TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
193163

194-
// AES_128(CBC) - DHE - forward screcy
164+
// AES_128(CBC) - DHE - forward secrecy
195165
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
196166
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
197167

198-
// AES_256(GCM) - not forward screcy
199-
"TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384",
200-
"TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384",
201-
202-
// AES_128(GCM) - not forward screcy
203-
"TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
204-
"TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
205-
206-
// AES_256(CBC) - not forward screcy
207-
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
208-
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
209-
210-
// AES_128(CBC) - not forward screcy
211-
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
212-
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
213-
214168
// AES_256(CBC) - ECDHE - using SHA
215169
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
216170
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
@@ -227,14 +181,6 @@ public class CheckCipherSuites {
227181
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
228182
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
229183

230-
// AES_256(CBC) - using SHA, not forward screcy
231-
"TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
232-
"TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
233-
234-
// AES_128(CBC) - using SHA, not forward screcy
235-
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
236-
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
237-
238184
// deprecated
239185
"TLS_RSA_WITH_AES_256_GCM_SHA384",
240186
"TLS_RSA_WITH_AES_128_GCM_SHA256",
@@ -257,16 +203,10 @@ public class CheckCipherSuites {
257203
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
258204
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
259205
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
260-
"TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",
261-
"TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256",
262-
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
263-
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
264206
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
265207
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
266208
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
267209
"TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
268-
"TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
269-
"TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
270210
"TLS_RSA_WITH_AES_128_GCM_SHA256",
271211
"TLS_RSA_WITH_AES_128_CBC_SHA256",
272212
"TLS_RSA_WITH_AES_128_CBC_SHA",

0 commit comments

Comments
 (0)