Skip to content

Commit 9c06db7

Browse files
author
Shigeki Ohtsu
committed
test: change tls tests not to use LOW cipher
DES-CBC-SHA is LOW cipher and disabled by default and it is used in tests of hornorcipherorder. They are changed as to - use RC4-SHA instead of DES-CBC-SHA. - add ECDHE-RSA-AES256-SHA to entries to keep the number of ciphers. - remove tests for non-default cipher because only SEED and IDEA are available in !RC4:!HIGH:ALL. Fixes: nodejs/Release#85 PR-URL: #5712 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent a115779 commit 9c06db7

File tree

3 files changed

+22
-29
lines changed

3 files changed

+22
-29
lines changed

deps/openssl/config/opensslconf.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
# ifndef OPENSSL_NO_STORE
4545
# define OPENSSL_NO_STORE
4646
# endif
47-
#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
48-
# define OPENSSL_NO_WEAK_SSL_CIPHERS
49-
#endif
47+
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
48+
# define OPENSSL_NO_WEAK_SSL_CIPHERS
49+
# endif
5050
#endif /* OPENSSL_DOING_MAKEDEPEND */
5151

5252
#ifndef OPENSSL_THREADS

test/simple/test-tls-honorcipherorder-secureOptions.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function test(honorCipherOrder, clientCipher, expectedCipher, secureOptions, cb)
4949
secureProtocol: SSL_Method,
5050
key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'),
5151
cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'),
52-
ciphers: 'AES256-SHA:RC4-SHA:DES-CBC-SHA',
52+
ciphers: 'AES256-SHA:RC4-SHA:ECDHE-RSA-AES256-SHA',
5353
secureOptions: secureOptions,
5454
honorCipherOrder: !!honorCipherOrder
5555
};
@@ -95,37 +95,37 @@ test1();
9595

9696
function test1() {
9797
// Client has the preference of cipher suites by default
98-
test(false, 'DES-CBC-SHA:RC4-SHA:AES256-SHA','DES-CBC-SHA', 0, test2);
98+
test(false, 'RC4-SHA:AES256-SHA:ECDHE-RSA-AES256-SHA','RC4-SHA', 0, test2);
9999
}
100100

101101
function test2() {
102102
// Server has the preference of cipher suites where AES256-SHA is in
103103
// the first.
104-
test(true, 'DES-CBC-SHA:RC4-SHA:AES256-SHA', 'AES256-SHA', 0, test3);
104+
test(true, 'RC4-SHA:AES256-SHA:ECDHE-RSA-AES256-SHA', 'AES256-SHA', 0, test3);
105105
}
106106

107107
function test3() {
108-
// Server has the preference of cipher suites. RC4-SHA is given
109-
// higher priority over DES-CBC-SHA among client cipher suites.
110-
test(true, 'DES-CBC-SHA:RC4-SHA', 'RC4-SHA', 0, test4);
108+
// Server has the preference of cipher suites. AES256-SHA is given
109+
// higher priority over RC4-SHA among client cipher suites.
110+
test(true, 'RC4-SHA:AES256-SHA', 'AES256-SHA', 0, test4);
111111
}
112112

113113
function test4() {
114114
// As client has only one cipher, server has no choice in regardless
115115
// of honorCipherOrder.
116-
test(true, 'DES-CBC-SHA', 'DES-CBC-SHA', 0, test5);
116+
test(true, 'ECDHE-RSA-AES256-SHA', 'ECDHE-RSA-AES256-SHA', 0, test5);
117117
}
118118

119119
function test5() {
120120
test(false,
121-
'DES-CBC-SHA',
122-
'DES-CBC-SHA',
121+
'RC4-SHA',
122+
'RC4-SHA',
123123
process.binding('constants').SSL_OP_SINGLE_DH_USE, test6);
124124
}
125125

126126
function test6() {
127127
test(true,
128-
'DES-CBC-SHA',
129-
'DES-CBC-SHA',
128+
'RC4-SHA',
129+
'RC4-SHA',
130130
process.binding('constants').SSL_OP_SINGLE_DH_USE);
131131
}

test/simple/test-tls-honorcipherorder.js

+8-15
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ var SSL_Method = 'TLSv1_method';
3030
var localhost = '127.0.0.1';
3131

3232
process.on('exit', function() {
33-
assert.equal(nconns, 6);
33+
assert.equal(nconns, 5);
3434
});
3535

3636
function test(honorCipherOrder, clientCipher, expectedCipher, cb) {
3737
var soptions = {
3838
secureProtocol: SSL_Method,
3939
key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'),
4040
cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'),
41-
ciphers: 'DES-CBC-SHA:AES256-SHA:RC4-SHA:ECDHE-RSA-AES256-SHA',
41+
ciphers: 'RC4-SHA:AES256-SHA:ECDHE-RSA-AES256-SHA',
4242
honorCipherOrder: !!honorCipherOrder
4343
};
4444

@@ -75,31 +75,24 @@ function test1() {
7575
}
7676

7777
function test2() {
78-
// Server has the preference of cipher suites where DES-CBC-SHA is in
78+
// Server has the preference of cipher suites where RC4-SHA is in
7979
// the first.
80-
test(true, 'AES256-SHA:DES-CBC-SHA:RC4-SHA', 'DES-CBC-SHA', test3);
80+
test(true, 'AES256-SHA:RC4-SHA', 'RC4-SHA', test3);
8181
}
8282

8383
function test3() {
84-
// Server has the preference of cipher suites. RC4-SHA is given
85-
// higher priority over DES-CBC-SHA among client cipher suites.
86-
test(true, 'RC4-SHA:AES256-SHA', 'AES256-SHA', test4);
84+
// Server has the preference of cipher suites. AES256-SHA is given
85+
// higher priority over ECDHE-RSA-AES256-SHA among client cipher suites.
86+
test(true, 'ECDHE-RSA-AES256-SHA:AES256-SHA', 'AES256-SHA', test4);
8787
}
8888

8989
function test4() {
9090
// As client has only one cipher, server has no choice in regardless
9191
// of honorCipherOrder.
92-
test(true, 'RC4-SHA', 'RC4-SHA', test5);
92+
test(true, 'ECDHE-RSA-AES256-SHA', 'ECDHE-RSA-AES256-SHA', test5);
9393
}
9494

9595
function test5() {
96-
// Client did not explicitly set ciphers. Ensure that client defaults to
97-
// sane ciphers. Even though server gives top priority to DES-CBC-SHA
98-
// it should not be negotiated because it's not in default client ciphers.
99-
test(true, null, 'AES256-SHA', test6);
100-
}
101-
102-
function test6() {
10396
// Ensure that `tls.DEFAULT_CIPHERS` is used
10497
SSL_Method = 'TLSv1_2_method';
10598
tls.DEFAULT_CIPHERS = 'ECDHE-RSA-AES256-SHA';

0 commit comments

Comments
 (0)