| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e20eef6 commit a0e3926
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1051,14 +1051,6 @@ const common = { | |||
| 1051 | 1051 | return hasOpenSSL(3); | |
| 1052 | 1052 | }, | |
| 1053 | 1053 | ||
| 1054 | - get hasOpenSSL31() { | ||
| 1055 | - return hasOpenSSL(3, 1); | ||
| 1056 | - }, | ||
| 1057 | - | ||
| 1058 | - get hasOpenSSL32() { | ||
| 1059 | - return hasOpenSSL(3, 2); | ||
| 1060 | - }, | ||
| 1061 | - | ||
| 1062 | 1054 | get inFreeBSDJail() { | |
| 1063 | 1055 | if (inFreeBSDJail !== null) return inFreeBSDJail; | |
| 1064 | 1056 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -56,7 +56,7 @@ function faultyServer(port) { | |||
| 56 | 56 | function second(server, session) { | |
| 57 | 57 | const req = https.request({ | |
| 58 | 58 | port: server.address().port, | |
| 59 | - ciphers: (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), | ||
| 59 | + ciphers: (common.hasOpenSSL(3, 1) ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), | ||
| 60 | 60 | rejectUnauthorized: false | |
| 61 | 61 | }, function(res) { | |
| 62 | 62 | res.resume(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,7 +42,7 @@ const server = tls.Server({ | |||
| 42 | 42 | cert: loadPEM('agent2-cert') | |
| 43 | 43 | }, null).listen(0, common.mustCall(() => { | |
| 44 | 44 | const args = ['s_client', '-quiet', '-tls1_1', | |
| 45 | - '-cipher', (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), | ||
| 45 | + '-cipher', (common.hasOpenSSL(3, 1) ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), | ||
| 46 | 46 | '-connect', `127.0.0.1:${server.address().port}`]; | |
| 47 | 47 | ||
| 48 | 48 | execFile(common.opensslCli, args, common.mustCall((err, _, stderr) => { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ const server = tls.createServer(options, (c) => { | |||
| 26 | 26 | }, common.mustNotCall()); | |
| 27 | 27 | ||
| 28 | 28 | c.on('error', common.mustCall((err) => { | |
| 29 | - const expectedErr = common.hasOpenSSL32 ? | ||
| 29 | + const expectedErr = common.hasOpenSSL(3, 2) ? | ||
| 30 | 30 | 'ERR_SSL_SSL/TLS_ALERT_HANDSHAKE_FAILURE' : 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE'; | |
| 31 | 31 | assert.strictEqual(err.code, expectedErr); | |
| 32 | 32 | })); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,11 +14,11 @@ const clientConfigs = [ | |||
| 14 | 14 | { | |
| 15 | 15 | secureProtocol: 'TLSv1_method', | |
| 16 | 16 | version: 'TLSv1', | |
| 17 | - ciphers: (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT') | ||
| 17 | + ciphers: (common.hasOpenSSL(3, 1) ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT') | ||
| 18 | 18 | }, { | |
| 19 | 19 | secureProtocol: 'TLSv1_1_method', | |
| 20 | 20 | version: 'TLSv1.1', | |
| 21 | - ciphers: (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT') | ||
| 21 | + ciphers: (common.hasOpenSSL(3, 1) ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT') | ||
| 22 | 22 | }, { | |
| 23 | 23 | secureProtocol: 'TLSv1_2_method', | |
| 24 | 24 | version: 'TLSv1.2' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ function test(cmin, cmax, cprot, smin, smax, sprot, proto, cerr, serr) { | |||
| 22 | 22 | if (serr !== 'ERR_SSL_UNSUPPORTED_PROTOCOL') | |
| 23 | 23 | ciphers = 'ALL@SECLEVEL=0'; | |
| 24 | 24 | } | |
| 25 | - if (common.hasOpenSSL31 && cerr === 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION') { | ||
| 25 | + if (common.hasOpenSSL(3, 1) && cerr === 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION') { | ||
| 26 | 26 | ciphers = 'DEFAULT@SECLEVEL=0'; | |
| 27 | 27 | } | |
| 28 | 28 | // Report where test was called from. Strip leading garbage from | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -62,11 +62,11 @@ test({ psk: USERS.UserA, identity: 'UserA' }, { minVersion: 'TLSv1.3' }); | |||
| 62 | 62 | test({ psk: USERS.UserB, identity: 'UserB' }); | |
| 63 | 63 | test({ psk: USERS.UserB, identity: 'UserB' }, { minVersion: 'TLSv1.3' }); | |
| 64 | 64 | // Unrecognized user should fail handshake | |
| 65 | - const expectedHandshakeErr = common.hasOpenSSL32 ? | ||
| 65 | + const expectedHandshakeErr = common.hasOpenSSL(3, 2) ? | ||
| 66 | 66 | 'ERR_SSL_SSL/TLS_ALERT_HANDSHAKE_FAILURE' : 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE'; | |
| 67 | 67 | test({ psk: USERS.UserB, identity: 'UserC' }, {}, expectedHandshakeErr); | |
| 68 | 68 | // Recognized user but incorrect secret should fail handshake | |
| 69 | - const expectedIllegalParameterErr = common.hasOpenSSL32 ? | ||
| 69 | + const expectedIllegalParameterErr = common.hasOpenSSL(3, 2) ? | ||
| 70 | 70 | 'ERR_SSL_SSL/TLS_ALERT_ILLEGAL_PARAMETER' : 'ERR_SSL_SSLV3_ALERT_ILLEGAL_PARAMETER'; | |
| 71 | 71 | test({ psk: USERS.UserA, identity: 'UserB' }, {}, expectedIllegalParameterErr); | |
| 72 | 72 | test({ psk: USERS.UserB, identity: 'UserB' }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -100,7 +100,7 @@ function doTest(testOptions, callback) { | |||
| 100 | 100 | const args = [ | |
| 101 | 101 | 's_client', | |
| 102 | 102 | '-tls1', | |
| 103 | - '-cipher', (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), | ||
| 103 | + '-cipher', (common.hasOpenSSL(3, 1) ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'), | ||
| 104 | 104 | '-connect', `localhost:${this.address().port}`, | |
| 105 | 105 | '-servername', 'ohgod', | |
| 106 | 106 | '-key', fixtures.path('keys/rsa_private.pem'), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments