@@ -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,39 +146,10 @@ function testSetupsCompatible(serverSetup, clientSetup) {
169
146
return false ;
170
147
}
171
148
172
- if ( isSsl2Protocol ( serverSetup . secureProtocol ) ||
173
- isSsl2Protocol ( clientSetup . secureProtocol ) ) {
174
-
175
- /*
176
- * It seems that in order to be able to use SSLv2, at least the server
177
- * *needs* to advertise at least one cipher compatible with it.
178
- */
179
- if ( serverSetup . ciphers !== SSL2_COMPATIBLE_CIPHERS ) {
180
- return false ;
181
- }
182
-
183
- /*
184
- * If only either one of the client or server specify SSLv2 as their
185
- * protocol, then *both* of them *need* to advertise at least one cipher
186
- * that is compatible with SSLv2.
187
- */
188
- if ( ( ! isSsl2Protocol ( serverSetup . secureProtocol ) || ! isSsl2Protocol ( clientSetup . secureProtocol ) ) &&
189
- ( clientSetup . ciphers !== SSL2_COMPATIBLE_CIPHERS || serverSetup . ciphers !== SSL2_COMPATIBLE_CIPHERS ) ) {
190
- return false ;
191
- }
192
- }
193
-
194
149
return true ;
195
150
}
196
151
197
152
function sslSetupMakesSense ( cmdLineOption , secureProtocol , secureOption ) {
198
- if ( isSsl2Protocol ( secureProtocol ) ) {
199
- if ( secureOption & constants . SSL_OP_NO_SSLv2 ||
200
- ( secureOption == null && ( ! cmdLineOption || cmdLineOption . indexOf ( '--enable-ssl2' ) === - 1 ) ) ) {
201
- return false ;
202
- }
203
- }
204
-
205
153
if ( isSsl3Protocol ( secureProtocol ) ) {
206
154
if ( secureOption & constants . SSL_OP_NO_SSLv3 ||
207
155
( secureOption == null && ( ! cmdLineOption || cmdLineOption . indexOf ( '--enable-ssl3' ) === - 1 ) ) ) {
@@ -230,12 +178,6 @@ function createTestsSetups() {
230
178
} ;
231
179
232
180
serversSetup . push ( serverSetup ) ;
233
-
234
- if ( isSsl2Protocol ( serverSecureProtocol ) ) {
235
- var setupWithSsl2Ciphers = xtend ( serverSetup ) ;
236
- setupWithSsl2Ciphers . ciphers = SSL2_COMPATIBLE_CIPHERS ;
237
- serversSetup . push ( setupWithSsl2Ciphers ) ;
238
- }
239
181
}
240
182
} ) ;
241
183
} ) ;
@@ -252,12 +194,6 @@ function createTestsSetups() {
252
194
} ;
253
195
254
196
clientsSetup . push ( clientSetup ) ;
255
-
256
- if ( isSsl2Protocol ( clientSecureProtocol ) ) {
257
- var setupWithSsl2Ciphers = xtend ( clientSetup ) ;
258
- setupWithSsl2Ciphers . ciphers = SSL2_COMPATIBLE_CIPHERS ;
259
- clientsSetup . push ( setupWithSsl2Ciphers ) ;
260
- }
261
197
}
262
198
} ) ;
263
199
} ) ;
@@ -367,10 +303,6 @@ function stringToSecureOptions(secureOptionsString) {
367
303
368
304
var optionStrings = secureOptionsString . split ( '|' ) ;
369
305
optionStrings . forEach ( function ( option ) {
370
- if ( option === 'SSL_OP_NO_SSLv2' ) {
371
- secureOptions |= constants . SSL_OP_NO_SSLv2 ;
372
- }
373
-
374
306
if ( option === 'SSL_OP_NO_SSLv3' ) {
375
307
secureOptions |= constants . SSL_OP_NO_SSLv3 ;
376
308
}
@@ -430,10 +362,6 @@ function checkTestExitCode(testSetup, serverExitCode, clientExitCode) {
430
362
function secureOptionsToString ( secureOptions ) {
431
363
var secureOptsString = '' ;
432
364
433
- if ( secureOptions & constants . SSL_OP_NO_SSLv2 ) {
434
- secureOptsString += 'SSL_OP_NO_SSLv2' ;
435
- }
436
-
437
365
if ( secureOptions & constants . SSL_OP_NO_SSLv3 ) {
438
366
secureOptsString += '|SSL_OP_NO_SSLv3' ;
439
367
}
0 commit comments