@@ -11,21 +11,17 @@ var debug = require('debug')('test-node-ssl');
11
11
12
12
var common = require ( '../../common' ) ;
13
13
14
- var SSL2_COMPATIBLE_CIPHERS = 'RC4-MD5' ;
15
-
16
- var CMD_LINE_OPTIONS = [ null , "--enable-ssl2" , "--enable-ssl3" ] ;
14
+ var CMD_LINE_OPTIONS = [ null , "--enable-ssl3" ] ;
17
15
18
16
var SERVER_SSL_PROTOCOLS = [
19
17
null ,
20
- 'SSLv2_method' , 'SSLv2_server_method' ,
21
18
'SSLv3_method' , 'SSLv3_server_method' ,
22
19
'TLSv1_method' , 'TLSv1_server_method' ,
23
20
'SSLv23_method' , 'SSLv23_server_method'
24
21
] ;
25
22
26
23
var CLIENT_SSL_PROTOCOLS = [
27
24
null ,
28
- 'SSLv2_method' , 'SSLv2_client_method' ,
29
25
'SSLv3_method' , 'SSLv3_client_method' ,
30
26
'TLSv1_method' , 'TLSv1_client_method' ,
31
27
'SSLv23_method' , 'SSLv23_client_method'
@@ -34,9 +30,7 @@ var CLIENT_SSL_PROTOCOLS = [
34
30
var SECURE_OPTIONS = [
35
31
null ,
36
32
0 ,
37
- constants . SSL_OP_NO_SSLv2 ,
38
33
constants . SSL_OP_NO_SSLv3 ,
39
- constants . SSL_OP_NO_SSLv2 | constants . SSL_OP_NO_SSLv3
40
34
] ;
41
35
42
36
function xtend ( source ) {
@@ -105,30 +99,13 @@ function isSsl3Protocol(secureProtocol) {
105
99
secureProtocol === 'SSLv3_server_method' ;
106
100
}
107
101
108
- function isSsl2Protocol ( secureProtocol ) {
109
- assert ( secureProtocol === null || typeof secureProtocol === 'string' ) ;
110
-
111
- return secureProtocol === 'SSLv2_method' ||
112
- secureProtocol === 'SSLv2_client_method' ||
113
- secureProtocol === 'SSLv2_server_method' ;
114
- }
115
-
116
102
function secureProtocolCompatibleWithSecureOptions ( secureProtocol , secureOptions , cmdLineOption ) {
117
103
if ( secureOptions == null ) {
118
- if ( isSsl2Protocol ( secureProtocol ) &&
119
- ( ! cmdLineOption || cmdLineOption . indexOf ( '--enable-ssl2' ) === - 1 ) ) {
120
- return false ;
121
- }
122
-
123
104
if ( isSsl3Protocol ( secureProtocol ) &&
124
105
( ! cmdLineOption || cmdLineOption . indexOf ( '--enable-ssl3' ) === - 1 ) ) {
125
106
return false ;
126
107
}
127
108
} else {
128
- if ( secureOptions & constants . SSL_OP_NO_SSLv2 && isSsl2Protocol ( secureProtocol ) ) {
129
- return false ;
130
- }
131
-
132
109
if ( secureOptions & constants . SSL_OP_NO_SSLv3 && isSsl3Protocol ( secureProtocol ) ) {
133
110
return false ;
134
111
}
@@ -169,30 +146,10 @@ function testSetupsCompatible(serverSetup, clientSetup) {
169
146
return false ;
170
147
}
171
148
172
- var ssl2Used = isSsl2Protocol ( serverSetup . secureProtocol ) ||
173
- isSsl2Protocol ( clientSetup . secureProtocol ) ;
174
- if ( ssl2Used &&
175
- ( ( serverSetup . ciphers !== SSL2_COMPATIBLE_CIPHERS ) ||
176
- ( clientSetup . ciphers !== SSL2_COMPATIBLE_CIPHERS ) ) ) {
177
- /*
178
- * Default ciphers are not compatible with SSLv2. Both client *and*
179
- * server need to specify a SSLv2 compatible cipher to be able to use
180
- * SSLv2.
181
- */
182
- return false ;
183
- }
184
-
185
149
return true ;
186
150
}
187
151
188
152
function sslSetupMakesSense ( cmdLineOption , secureProtocol , secureOption ) {
189
- if ( isSsl2Protocol ( secureProtocol ) ) {
190
- if ( secureOption & constants . SSL_OP_NO_SSLv2 ||
191
- ( secureOption == null && ( ! cmdLineOption || cmdLineOption . indexOf ( '--enable-ssl2' ) === - 1 ) ) ) {
192
- return false ;
193
- }
194
- }
195
-
196
153
if ( isSsl3Protocol ( secureProtocol ) ) {
197
154
if ( secureOption & constants . SSL_OP_NO_SSLv3 ||
198
155
( secureOption == null && ( ! cmdLineOption || cmdLineOption . indexOf ( '--enable-ssl3' ) === - 1 ) ) ) {
@@ -221,12 +178,6 @@ function createTestsSetups() {
221
178
} ;
222
179
223
180
serversSetup . push ( serverSetup ) ;
224
-
225
- if ( isSsl2Protocol ( serverSecureProtocol ) ) {
226
- var setupWithSsl2Ciphers = xtend ( serverSetup ) ;
227
- setupWithSsl2Ciphers . ciphers = SSL2_COMPATIBLE_CIPHERS ;
228
- serversSetup . push ( setupWithSsl2Ciphers ) ;
229
- }
230
181
}
231
182
} ) ;
232
183
} ) ;
@@ -243,12 +194,6 @@ function createTestsSetups() {
243
194
} ;
244
195
245
196
clientsSetup . push ( clientSetup ) ;
246
-
247
- if ( isSsl2Protocol ( clientSecureProtocol ) ) {
248
- var setupWithSsl2Ciphers = xtend ( clientSetup ) ;
249
- setupWithSsl2Ciphers . ciphers = SSL2_COMPATIBLE_CIPHERS ;
250
- clientsSetup . push ( setupWithSsl2Ciphers ) ;
251
- }
252
197
}
253
198
} ) ;
254
199
} ) ;
@@ -359,10 +304,6 @@ function stringToSecureOptions(secureOptionsString) {
359
304
360
305
var optionStrings = secureOptionsString . split ( '|' ) ;
361
306
optionStrings . forEach ( function ( option ) {
362
- if ( option === 'SSL_OP_NO_SSLv2' ) {
363
- secureOptions |= constants . SSL_OP_NO_SSLv2 ;
364
- }
365
-
366
307
if ( option === 'SSL_OP_NO_SSLv3' ) {
367
308
secureOptions |= constants . SSL_OP_NO_SSLv3 ;
368
309
}
@@ -422,10 +363,6 @@ function checkTestExitCode(testSetup, serverExitCode, clientExitCode) {
422
363
function secureOptionsToString ( secureOptions ) {
423
364
var secureOptsString = '' ;
424
365
425
- if ( secureOptions & constants . SSL_OP_NO_SSLv2 ) {
426
- secureOptsString += 'SSL_OP_NO_SSLv2' ;
427
- }
428
-
429
366
if ( secureOptions & constants . SSL_OP_NO_SSLv3 ) {
430
367
secureOptsString += '|SSL_OP_NO_SSLv3' ;
431
368
}
0 commit comments