Skip to content

Commit 40cc131

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: nodejs#5712 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 5141bf4 commit 40cc131

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

deps/openssl/config/opensslconf.h

Lines changed: 3 additions & 3 deletions
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

Lines changed: 11 additions & 11 deletions
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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function test(honorCipherOrder, clientCipher, expectedCipher, cb) {
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: 'AES256-SHA:RC4-SHA:DES-CBC-SHA',
41+
ciphers: 'AES256-SHA:RC4-SHA:ECDHE-RSA-AES256-SHA',
4242
honorCipherOrder: !!honorCipherOrder
4343
};
4444

@@ -67,23 +67,23 @@ test1();
6767

6868
function test1() {
6969
// Client has the preference of cipher suites by default
70-
test(false, 'DES-CBC-SHA:RC4-SHA:AES256-SHA','DES-CBC-SHA', test2);
70+
test(false, 'RC4-SHA:AES256-SHA:ECDHE-RSA-AES256-SHA','RC4-SHA', test2);
7171
}
7272

7373
function test2() {
7474
// Server has the preference of cipher suites where AES256-SHA is in
7575
// the first.
76-
test(true, 'DES-CBC-SHA:RC4-SHA:AES256-SHA', 'AES256-SHA', test3);
76+
test(true, 'RC4-SHA:AES256-SHA:ECDHE-RSA-AES256-SHA', 'AES256-SHA', test3);
7777
}
7878

7979
function test3() {
80-
// Server has the preference of cipher suites. RC4-SHA is given
81-
// higher priority over DES-CBC-SHA among client cipher suites.
82-
test(true, 'DES-CBC-SHA:RC4-SHA', 'RC4-SHA', test4);
80+
// Server has the preference of cipher suites. AES256-SHA is given
81+
// higher priority over ECDHE-RSA-AES256-SHA among client cipher suites.
82+
test(true, 'RC4-SHA:AES256-SHA', 'AES256-SHA', test4);
8383
}
8484

8585
function test4() {
8686
// As client has only one cipher, server has no choice in regardless
8787
// of honorCipherOrder.
88-
test(true, 'DES-CBC-SHA', 'DES-CBC-SHA');
88+
test(true, 'ECDHE-RSA-AES256-SHA', 'ECDHE-RSA-AES256-SHA');
8989
}

0 commit comments

Comments
 (0)