| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b3e0cf1 commit 99a2090
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -97,8 +97,6 @@ const der = Buffer.from( | |||
| 97 | 97 | assert.strictEqual(x509.infoAccess, infoAccessCheck); | |
| 98 | 98 | assert.strictEqual(x509.validFrom, 'Sep 3 21:40:37 2022 GMT'); | |
| 99 | 99 | assert.strictEqual(x509.validTo, 'Jun 17 21:40:37 2296 GMT'); | |
| 100 | - assert.deepStrictEqual(x509.validFromDate, new Date('2022-09-03T21:40:37Z')); | ||
| 101 | - assert.deepStrictEqual(x509.validToDate, new Date('2296-06-17T21:40:37Z')); | ||
| 102 | 100 | assert.strictEqual( | |
| 103 | 101 | x509.fingerprint, | |
| 104 | 102 | '8B:89:16:C4:99:87:D2:13:1A:64:94:36:38:A5:32:01:F0:95:3B:53'); | |
@@ -118,6 +116,11 @@ const der = Buffer.from( | |||
| 118 | 116 | ||
| 119 | 117 | assert.deepStrictEqual(x509.raw, der); | |
| 120 | 118 | ||
| 119 | + if (!process.features.openssl_is_boringssl) { | ||
| 120 | + assert.deepStrictEqual(x509.validFromDate, new Date('2022-09-03T21:40:37Z')); | ||
| 121 | + assert.deepStrictEqual(x509.validToDate, new Date('2296-06-17T21:40:37Z')); | ||
| 122 | + } | ||
| 123 | + | ||
| 121 | 124 | assert(x509.publicKey); | |
| 122 | 125 | assert.strictEqual(x509.publicKey.type, 'public'); | |
| 123 | 126 | ||
@@ -356,13 +359,15 @@ tAt3hIKFD1bJt6c6WtMH2Su3syosWxmdmGk5ihslB00lvLpfj/wed8i3bkcB1doq | |||
| 356 | 359 | UcXd/5qu2GhokrKU2cPttU+XAN2Om6a0 | |
| 357 | 360 | -----END CERTIFICATE-----`; | |
| 358 | 361 | ||
| 359 | - const cert = new X509Certificate(certPem); | ||
| 360 | - assert.throws(() => cert.publicKey, { | ||
| 361 | - message: hasOpenSSL3 ? /decode error/ : /wrong tag/, | ||
| 362 | - name: 'Error' | ||
| 363 | - }); | ||
| 362 | + if (!process.features.openssl_is_boringssl) { | ||
| 363 | + const cert = new X509Certificate(certPem); | ||
| 364 | + assert.throws(() => cert.publicKey, { | ||
| 365 | + message: hasOpenSSL3 ? /decode error/ : /wrong tag/, | ||
| 366 | + name: 'Error' | ||
| 367 | + }); | ||
| 364 | 368 | ||
| 365 | - assert.strictEqual(cert.checkIssued(cert), false); | ||
| 369 | + assert.strictEqual(cert.checkIssued(cert), false); | ||
| 370 | + } | ||
| 366 | 371 | } | |
| 367 | 372 | ||
| 368 | 373 | { | |
@@ -401,8 +406,10 @@ UidvpWWipVLZgK+oDks+bKTobcoXGW9oXobiIYqslXPy | |||
| 401 | 406 | -----END CERTIFICATE-----`.trim(); | |
| 402 | 407 | const c1 = new X509Certificate(certPemUTCTime); | |
| 403 | 408 | ||
| 404 | - assert.deepStrictEqual(c1.validFromDate, new Date('1949-12-25T23:59:58Z')); | ||
| 405 | - assert.deepStrictEqual(c1.validToDate, new Date('1950-01-01T23:59:58Z')); | ||
| 409 | + if (!process.features.openssl_is_boringssl) { | ||
| 410 | + assert.deepStrictEqual(c1.validFromDate, new Date('1949-12-25T23:59:58Z')); | ||
| 411 | + assert.deepStrictEqual(c1.validToDate, new Date('1950-01-01T23:59:58Z')); | ||
| 412 | + } | ||
| 406 | 413 | ||
| 407 | 414 | // The GeneralizedTime format is used for dates in 2050 or later. | |
| 408 | 415 | const certPemGeneralizedTime = `-----BEGIN CERTIFICATE----- | |
@@ -436,6 +443,8 @@ CWwQO8JZjJqFtqtuzy2n+gLCvqePgG/gmSqHOPm2ZbLW | |||
| 436 | 443 | -----END CERTIFICATE-----`.trim(); | |
| 437 | 444 | const c2 = new X509Certificate(certPemGeneralizedTime); | |
| 438 | 445 | ||
| 439 | - assert.deepStrictEqual(c2.validFromDate, new Date('2049-12-26T00:00:01Z')); | ||
| 440 | - assert.deepStrictEqual(c2.validToDate, new Date('2050-01-02T00:00:01Z')); | ||
| 446 | + if (!process.features.openssl_is_boringssl) { | ||
| 447 | + assert.deepStrictEqual(c2.validFromDate, new Date('2049-12-26T00:00:01Z')); | ||
| 448 | + assert.deepStrictEqual(c2.validToDate, new Date('2050-01-02T00:00:01Z')); | ||
| 449 | + } | ||
| 441 | 450 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,23 +13,31 @@ const options = { | |||
| 13 | 13 | cert: fixtures.readKey('agent1-cert.pem'), | |
| 14 | 14 | ca: fixtures.readKey('ca1-cert.pem'), | |
| 15 | 15 | minVersion: 'TLSv1.1', | |
| 16 | - ciphers: 'ALL@SECLEVEL=0' | ||
| 17 | 16 | }; | |
| 18 | 17 | ||
| 18 | + if (!process.features.openssl_is_boringssl) { | ||
| 19 | + options.ciphers = 'ALL@SECLEVEL=0'; | ||
| 20 | + } | ||
| 21 | + | ||
| 19 | 22 | const server = https.Server(options, (req, res) => { | |
| 20 | 23 | res.writeHead(200); | |
| 21 | 24 | res.end('hello world\n'); | |
| 22 | 25 | }); | |
| 23 | 26 | ||
| 24 | 27 | function getBaseOptions(port) { | |
| 25 | - return { | ||
| 28 | + const baseOptions = { | ||
| 26 | 29 | path: '/', | |
| 27 | 30 | port: port, | |
| 28 | 31 | ca: options.ca, | |
| 29 | 32 | rejectUnauthorized: true, | |
| 30 | 33 | servername: 'agent1', | |
| 31 | - ciphers: 'ALL@SECLEVEL=0' | ||
| 32 | 34 | }; | |
| 35 | + | ||
| 36 | + if (!process.features.openssl_is_boringssl) { | ||
| 37 | + baseOptions.ciphers = 'ALL@SECLEVEL=0'; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + return baseOptions; | ||
| 33 | 41 | } | |
| 34 | 42 | ||
| 35 | 43 | const updatedValues = new Map([ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,9 +17,12 @@ const options = { | |||
| 17 | 17 | key: readKey('agent1-key.pem'), | |
| 18 | 18 | cert: readKey('agent1-cert.pem'), | |
| 19 | 19 | secureOptions: SSL_OP_NO_TICKET, | |
| 20 | - ciphers: 'RSA@SECLEVEL=0' | ||
| 21 | 20 | }; | |
| 22 | 21 | ||
| 22 | + if (!process.features.openssl_is_boringssl) { | ||
| 23 | + options.ciphers = 'RSA@SECLEVEL=0'; | ||
| 24 | + } | ||
| 25 | + | ||
| 23 | 26 | // Create TLS1.2 server | |
| 24 | 27 | https.createServer(options, function(req, res) { | |
| 25 | 28 | res.writeHead(200, { 'Connection': 'close' }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -123,6 +123,8 @@ const { subtle } = globalThis.crypto; | |||
| 123 | 123 | assert.deepStrictEqual(secret1, secret2); | |
| 124 | 124 | } | |
| 125 | 125 | ||
| 126 | - test('X25519').then(common.mustCall()); | ||
| 127 | - test('X448').then(common.mustCall()); | ||
| 126 | + if (!process.features.openssl_is_boringssl) { | ||
| 127 | + test('X25519').then(common.mustCall()); | ||
| 128 | + test('X448').then(common.mustCall()); | ||
| 129 | + } | ||
| 128 | 130 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -206,6 +206,8 @@ const { KeyObject } = require('crypto'); | |||
| 206 | 206 | assert.deepStrictEqual(raw1, raw2); | |
| 207 | 207 | } | |
| 208 | 208 | ||
| 209 | - test('X25519').then(common.mustCall()); | ||
| 210 | - test('X448').then(common.mustCall()); | ||
| 209 | + if (!process.features.openssl_is_boringssl) { | ||
| 210 | + test('X25519').then(common.mustCall()); | ||
| 211 | + test('X448').then(common.mustCall()); | ||
| 212 | + } | ||
| 211 | 213 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -121,8 +121,9 @@ const { subtle } = globalThis.crypto; | |||
| 121 | 121 | name: 'Ed25519', | |
| 122 | 122 | }, publicKey, signature, ec.encode(data))); | |
| 123 | 123 | } | |
| 124 | - | ||
| 125 | - test('hello world').then(common.mustCall()); | ||
| 124 | + if (!process.features.openssl_is_boringssl) { | ||
| 125 | + test('hello world').then(common.mustCall()); | ||
| 126 | + } | ||
| 126 | 127 | } | |
| 127 | 128 | ||
| 128 | 129 | // Test Sign/Verify Ed448 | |
@@ -142,5 +143,7 @@ const { subtle } = globalThis.crypto; | |||
| 142 | 143 | }, publicKey, signature, ec.encode(data))); | |
| 143 | 144 | } | |
| 144 | 145 | ||
| 145 | - test('hello world').then(common.mustCall()); | ||
| 146 | + if (!process.features.openssl_is_boringssl) { | ||
| 147 | + test('hello world').then(common.mustCall()); | ||
| 148 | + } | ||
| 146 | 149 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments