From e673b57055e1b2cb83b34a0deb63aa0bcae03866 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Wed, 29 May 2019 11:43:44 -0700 Subject: [PATCH] test: move test_[key|ca|cert] to fixtures/keys/ Lots of changes, but mostly just search/replace of fixtures.readSync(...) to fixtures.readKey([new key]...) Benchmarks modified to use fixtures.readKey(...): benchmark/tls/throughput.js benchmark/tls/tls-connect.js benchmark/tls/secure-pair.js Also be sure to review the change to L16 of test/parallel/test-crypto-sign-verify.js PR-URL: https://github.com/nodejs/node/pull/27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- benchmark/tls/secure-pair.js | 10 +++----- benchmark/tls/throughput.js | 10 +++----- benchmark/tls/tls-connect.js | 10 +++----- test/async-hooks/test-graph.tls-write.js | 4 +-- test/async-hooks/test-tlswrap.js | 4 +-- test/fixtures/keys/Makefile | 12 +++++++++ test/fixtures/keys/rsa_ca.crt | 24 ++++++++++++++++++ test/fixtures/keys/rsa_cert.cnf | 23 +++++++++++++++++ test/fixtures/keys/rsa_cert.crt | 24 ++++++++++++++++++ test/fixtures/keys/rsa_cert.pfx | Bin 0 -> 2629 bytes test/fixtures/test_ca.pem | 20 --------------- test/fixtures/test_cert.pem | 20 --------------- test/fixtures/test_cert.pfx | Bin 1885 -> 0 bytes test/fixtures/test_key.pem | 15 ----------- test/parallel/test-crypto-binary-default.js | 6 ++--- test/parallel/test-crypto-rsa-dsa.js | 4 +-- test/parallel/test-crypto-sign-verify.js | 8 +++--- test/parallel/test-crypto-verify-failure.js | 2 +- test/parallel/test-crypto.js | 2 +- test/parallel/test-https-client-reject.js | 6 ++--- .../test-https-client-renegotiation-limit.js | 4 +-- test/parallel/test-https-drain.js | 4 +-- test/parallel/test-https-pfx.js | 2 +- .../test-https-unix-socket-self-signed.js | 4 +-- .../test-tls-async-cb-after-socket-end.js | 4 +-- test/parallel/test-tls-client-abort.js | 4 +-- test/parallel/test-tls-client-reject.js | 6 ++--- .../test-tls-client-renegotiation-limit.js | 4 +-- .../parallel/test-tls-connect-given-socket.js | 4 +-- test/parallel/test-tls-connect-memleak.js | 4 +-- test/parallel/test-tls-connect-no-host.js | 4 +-- .../test-tls-connect-stream-writes.js | 6 ++--- test/parallel/test-tls-destroy-stream.js | 6 ++--- test/parallel/test-tls-fast-writing.js | 6 ++--- test/parallel/test-tls-handshake-exception.js | 4 +-- .../parallel/test-tls-hello-parser-failure.js | 4 +-- test/parallel/test-tls-inception.js | 4 +-- test/parallel/test-tls-interleave.js | 6 ++--- .../test-tls-net-connect-prefer-path.js | 4 +-- test/parallel/test-tls-no-sslv3.js | 4 +-- test/parallel/test-tls-pause.js | 4 +-- test/parallel/test-tls-securepair-fiftharg.js | 4 +-- test/parallel/test-tls-zero-clear-in.js | 4 +-- test/pummel/test-https-no-reader.js | 4 +-- test/sequential/test-async-wrap-getasyncid.js | 6 ++--- test/sequential/test-tls-connect.js | 8 +++--- 46 files changed, 172 insertions(+), 150 deletions(-) create mode 100644 test/fixtures/keys/rsa_ca.crt create mode 100644 test/fixtures/keys/rsa_cert.cnf create mode 100644 test/fixtures/keys/rsa_cert.crt create mode 100644 test/fixtures/keys/rsa_cert.pfx delete mode 100644 test/fixtures/test_ca.pem delete mode 100644 test/fixtures/test_cert.pem delete mode 100644 test/fixtures/test_cert.pfx delete mode 100644 test/fixtures/test_key.pem diff --git a/benchmark/tls/secure-pair.js b/benchmark/tls/secure-pair.js index ed678b9060983e..c0409febacda00 100644 --- a/benchmark/tls/secure-pair.js +++ b/benchmark/tls/secure-pair.js @@ -6,21 +6,19 @@ const bench = common.createBenchmark(main, { size: [2, 1024, 1024 * 1024] }); -const fs = require('fs'); +const fixtures = require('../../test/common/fixtures'); const tls = require('tls'); const net = require('net'); -const path = require('path'); -const cert_dir = path.resolve(__dirname, '../../test/fixtures'); const REDIRECT_PORT = 28347; function main({ dur, size, securing }) { const chunk = Buffer.alloc(size, 'b'); const options = { - key: fs.readFileSync(`${cert_dir}/test_key.pem`), - cert: fs.readFileSync(`${cert_dir}/test_cert.pem`), - ca: [ fs.readFileSync(`${cert_dir}/test_ca.pem`) ], + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: fixtures.readKey('rsa_ca.crt'), ciphers: 'AES256-GCM-SHA384', isServer: true, requestCert: true, diff --git a/benchmark/tls/throughput.js b/benchmark/tls/throughput.js index cd957ff1edf495..a8f2d19649d04a 100644 --- a/benchmark/tls/throughput.js +++ b/benchmark/tls/throughput.js @@ -6,9 +6,7 @@ const bench = common.createBenchmark(main, { size: [2, 1024, 1024 * 1024] }); -const path = require('path'); -const fs = require('fs'); -const cert_dir = path.resolve(__dirname, '../../test/fixtures'); +const fixtures = require('../../test/common/fixtures'); var options; const tls = require('tls'); @@ -32,9 +30,9 @@ function main({ dur, type, size }) { } options = { - key: fs.readFileSync(`${cert_dir}/test_key.pem`), - cert: fs.readFileSync(`${cert_dir}/test_cert.pem`), - ca: [ fs.readFileSync(`${cert_dir}/test_ca.pem`) ], + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: fixtures.readKey('rsa_ca.crt'), ciphers: 'AES256-GCM-SHA384' }; diff --git a/benchmark/tls/tls-connect.js b/benchmark/tls/tls-connect.js index fa6e2cb80abf06..4300f6841f0cd6 100644 --- a/benchmark/tls/tls-connect.js +++ b/benchmark/tls/tls-connect.js @@ -1,6 +1,5 @@ 'use strict'; -const fs = require('fs'); -const path = require('path'); +const fixtures = require('../../test/common/fixtures'); const tls = require('tls'); const common = require('../common.js'); @@ -18,11 +17,10 @@ var running = true; function main(conf) { dur = conf.dur; concurrency = conf.concurrency; - const cert_dir = path.resolve(__dirname, '../../test/fixtures'); const options = { - key: fs.readFileSync(`${cert_dir}/test_key.pem`), - cert: fs.readFileSync(`${cert_dir}/test_cert.pem`), - ca: [ fs.readFileSync(`${cert_dir}/test_ca.pem`) ], + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: fixtures.readKey('rsa_ca.crt'), ciphers: 'AES256-GCM-SHA384' }; diff --git a/test/async-hooks/test-graph.tls-write.js b/test/async-hooks/test-graph.tls-write.js index 5aee38e6b6841a..f8bee6a879d0b4 100644 --- a/test/async-hooks/test-graph.tls-write.js +++ b/test/async-hooks/test-graph.tls-write.js @@ -20,8 +20,8 @@ hooks.enable(); // const server = tls .createServer({ - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }) .on('listening', common.mustCall(onlistening)) .on('secureConnection', common.mustCall(onsecureConnection)) diff --git a/test/async-hooks/test-tlswrap.js b/test/async-hooks/test-tlswrap.js index d6dcd204703d9d..65a4087d1659c6 100644 --- a/test/async-hooks/test-tlswrap.js +++ b/test/async-hooks/test-tlswrap.js @@ -24,8 +24,8 @@ tls.DEFAULT_MAX_VERSION = 'TLSv1.2'; // const server = tls .createServer({ - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }) .on('listening', common.mustCall(onlistening)) .on('secureConnection', common.mustCall(onsecureConnection)) diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index fd7ca677f63266..d26872e7d55289 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -41,6 +41,9 @@ all: \ rsa_private_pkcs8.pem \ rsa_private_pkcs8_bad.pem \ rsa_public.pem \ + rsa_ca.crt \ + rsa_cert.crt \ + rsa_cert.pfx \ rsa_public_sha1_signature_signedby_rsa_private.sha1 \ rsa_public_sha1_signature_signedby_rsa_private_pkcs8.sha1 \ rsa_private_b.pem \ @@ -617,6 +620,15 @@ rsa_private_pkcs8_bad.pem: rsa_private_pkcs8.pem rsa_public.pem: rsa_private.pem openssl rsa -in rsa_private.pem -pubout -out rsa_public.pem +rsa_cert.crt: rsa_private.pem + openssl req -new -x509 -key rsa_private.pem -config rsa_cert.cnf -out rsa_cert.crt + +rsa_cert.pfx: rsa_cert.crt + openssl pkcs12 -export -passout 'pass:sample' -inkey rsa_private.pem -in rsa_cert.crt -out rsa_cert.pfx + +rsa_ca.crt: rsa_cert.crt + cp rsa_cert.crt rsa_ca.crt + rsa_public_sha1_signature_signedby_rsa_private.sha1: rsa_public.pem rsa_private.pem openssl dgst -sha1 -sign rsa_private.pem -out rsa_public_sha1_signature_signedby_rsa_private.sha1 rsa_public.pem diff --git a/test/fixtures/keys/rsa_ca.crt b/test/fixtures/keys/rsa_ca.crt new file mode 100644 index 00000000000000..ef94a341846101 --- /dev/null +++ b/test/fixtures/keys/rsa_ca.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIUOLbA0Gyeqh/vqRSR98jmSKzv3aswDQYJKoZIhvcNAQEL +BQAwgbAxCzAJBgNVBAYTAlVLMRQwEgYDVQQIDAtBY2tuYWNrIEx0ZDETMBEGA1UE +BwwKUmh5cyBKb25lczEQMA4GA1UECgwHbm9kZS5qczEdMBsGA1UECwwUVGVzdCBU +TFMgQ2VydGlmaWNhdGUxFDASBgNVBAsMC0VuZ2luZWVyaW5nMRIwEAYDVQQDDAls +b2NhbGhvc3QxGzAZBgkqhkiG9w0BCQEWDGFsZXhAYXViLmRldjAeFw0xOTA1Mjky +MDI5NTBaFw0xOTA2MjgyMDI5NTBaMIGwMQswCQYDVQQGEwJVSzEUMBIGA1UECAwL +QWNrbmFjayBMdGQxEzARBgNVBAcMClJoeXMgSm9uZXMxEDAOBgNVBAoMB25vZGUu +anMxHTAbBgNVBAsMFFRlc3QgVExTIENlcnRpZmljYXRlMRQwEgYDVQQLDAtFbmdp +bmVlcmluZzESMBAGA1UEAwwJbG9jYWxob3N0MRswGQYJKoZIhvcNAQkBFgxhbGV4 +QGF1Yi5kZXYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC33FiIiiex +wLe/P8DZx5HsqFlmUO7/lvJ7necJVNwqdZ3ax5jpQB0p6uxfqeOvzcN3k5V7UFb/ +Am+nkSNZMAZhsWzCU2Z4Pjh50QYz3f0Hour7/yIGStOLyYY3hgLK2K8TbhgjQPhd +kw9+QtKlpvbL8fLgONAoGrVOFnRQGcr70iFffsm79mgZhKVMgYiHPJqJgGHvCtkG +g9zMgS7p63+Q3ZWedtFS2RhMX3uCBy/mH6EOlRCNBbRmA4xxNzyf5GQaki3T+Iz9 +tOMjdPP+CwV2LqEdylmBuik8vrfTb3qIHLKKBAI8lXN26wWtA3kN4L7NP+cbKlCR +lqctvhmylLH1AgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQAD +ggEBAFeDkFYcL1pcVA3q1LNWmpDi9MQAOajSyk3bNj0+ckyuOlqaXH2gVAdQh+XB +LOFDXNwAAqMe7FEoyvIaQSFcatRhQnKFxQ9i0o1T8+6Aebjj5oo8lY5CGyOacQV8 +C6LMl4gd/duIoaWkjykiGjTH8SR6VXYhPTm03wQSMMX664E/8onsw6cLuz4COB9q +dhWhkBXiVj3fF9kLOYMiBWc7Mb2Glfs3NLpu7TTltOwNNMWNfzE9XByR7Tg4WtIu +8x45ibQKqUhHCh/jpWns2g/YZXXBrcvYREgakkvJZLV2Z+xeoV5oY071554BfMms +YxLnHtl1YKNg++DSmxeUNK+NLZA= +-----END CERTIFICATE----- diff --git a/test/fixtures/keys/rsa_cert.cnf b/test/fixtures/keys/rsa_cert.cnf new file mode 100644 index 00000000000000..5d30534012e40f --- /dev/null +++ b/test/fixtures/keys/rsa_cert.cnf @@ -0,0 +1,23 @@ +[ req ] +days = 99999 +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no +x509_extensions = v3_ca + +[ req_distinguished_name ] +C = UK +ST = Acknack Ltd +L = Rhys Jones +O = node.js +0.OU = Test TLS Certificate +1.OU = Engineering +CN = localhost +emailAddress = alex@aub.dev + +[ req_attributes ] + +[ v3_ca ] +basicConstraints = CA:TRUE + +[ x509_extensions ] \ No newline at end of file diff --git a/test/fixtures/keys/rsa_cert.crt b/test/fixtures/keys/rsa_cert.crt new file mode 100644 index 00000000000000..ef94a341846101 --- /dev/null +++ b/test/fixtures/keys/rsa_cert.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIUOLbA0Gyeqh/vqRSR98jmSKzv3aswDQYJKoZIhvcNAQEL +BQAwgbAxCzAJBgNVBAYTAlVLMRQwEgYDVQQIDAtBY2tuYWNrIEx0ZDETMBEGA1UE +BwwKUmh5cyBKb25lczEQMA4GA1UECgwHbm9kZS5qczEdMBsGA1UECwwUVGVzdCBU +TFMgQ2VydGlmaWNhdGUxFDASBgNVBAsMC0VuZ2luZWVyaW5nMRIwEAYDVQQDDAls +b2NhbGhvc3QxGzAZBgkqhkiG9w0BCQEWDGFsZXhAYXViLmRldjAeFw0xOTA1Mjky +MDI5NTBaFw0xOTA2MjgyMDI5NTBaMIGwMQswCQYDVQQGEwJVSzEUMBIGA1UECAwL +QWNrbmFjayBMdGQxEzARBgNVBAcMClJoeXMgSm9uZXMxEDAOBgNVBAoMB25vZGUu +anMxHTAbBgNVBAsMFFRlc3QgVExTIENlcnRpZmljYXRlMRQwEgYDVQQLDAtFbmdp +bmVlcmluZzESMBAGA1UEAwwJbG9jYWxob3N0MRswGQYJKoZIhvcNAQkBFgxhbGV4 +QGF1Yi5kZXYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC33FiIiiex +wLe/P8DZx5HsqFlmUO7/lvJ7necJVNwqdZ3ax5jpQB0p6uxfqeOvzcN3k5V7UFb/ +Am+nkSNZMAZhsWzCU2Z4Pjh50QYz3f0Hour7/yIGStOLyYY3hgLK2K8TbhgjQPhd +kw9+QtKlpvbL8fLgONAoGrVOFnRQGcr70iFffsm79mgZhKVMgYiHPJqJgGHvCtkG +g9zMgS7p63+Q3ZWedtFS2RhMX3uCBy/mH6EOlRCNBbRmA4xxNzyf5GQaki3T+Iz9 +tOMjdPP+CwV2LqEdylmBuik8vrfTb3qIHLKKBAI8lXN26wWtA3kN4L7NP+cbKlCR +lqctvhmylLH1AgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQAD +ggEBAFeDkFYcL1pcVA3q1LNWmpDi9MQAOajSyk3bNj0+ckyuOlqaXH2gVAdQh+XB +LOFDXNwAAqMe7FEoyvIaQSFcatRhQnKFxQ9i0o1T8+6Aebjj5oo8lY5CGyOacQV8 +C6LMl4gd/duIoaWkjykiGjTH8SR6VXYhPTm03wQSMMX664E/8onsw6cLuz4COB9q +dhWhkBXiVj3fF9kLOYMiBWc7Mb2Glfs3NLpu7TTltOwNNMWNfzE9XByR7Tg4WtIu +8x45ibQKqUhHCh/jpWns2g/YZXXBrcvYREgakkvJZLV2Z+xeoV5oY071554BfMms +YxLnHtl1YKNg++DSmxeUNK+NLZA= +-----END CERTIFICATE----- diff --git a/test/fixtures/keys/rsa_cert.pfx b/test/fixtures/keys/rsa_cert.pfx new file mode 100644 index 0000000000000000000000000000000000000000..627f27bc7fe14d260d11d1e68d3be27369e9fa8e GIT binary patch literal 2629 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 S8Gxb3C+JEY^Q3!!r~5DRBW1w= diff --git a/test/fixtures/test_key.pem b/test/fixtures/test_key.pem deleted file mode 100644 index 48fd93c9944ff3..00000000000000 --- a/test/fixtures/test_key.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDx3wdzpq2rvwm3Ucun1qAD/ClB+wW+RhR1nVix286QvaNqePAd -CAwwLL82NqXcVQRbQ4s95splQnwvjgkFdKVXFTjPKKJI5aV3wSRN61EBVPdYpCre -535yfG/uDysZFCnVQdnCZ1tnXAR8BirxCNjHqbVyIyBGjsNoNCEPb2R35QIDAQAB -AoGBAJNem9C4ftrFNGtQ2DB0Udz7uDuucepkErUy4MbFsc947GfENjDKJXr42Kx0 -kYx09ImS1vUpeKpH3xiuhwqe7tm4FsCBg4TYqQle14oxxm7TNeBwwGC3OB7hiokb -aAjbPZ1hAuNs6ms3Ybvvj6Lmxzx42m8O5DXCG2/f+KMvaNUhAkEA/ekrOsWkNoW9 -2n3m+msdVuxeek4B87EoTOtzCXb1dybIZUVv4J48VAiM43hhZHWZck2boD/hhwjC -M5NWd4oY6QJBAPPcgBVNdNZSZ8hR4ogI4nzwWrQhl9MRbqqtfOn2TK/tjMv10ALg -lPmn3SaPSNRPKD2hoLbFuHFERlcS79pbCZ0CQQChX3PuIna/gDitiJ8oQLOg7xEM -wk9TRiDK4kl2lnhjhe6PDpaQN4E4F0cTuwqLAoLHtrNWIcOAQvzKMrYdu1MhAkBm -Et3qDMnjDAs05lGT72QeN90/mPAcASf5eTTYGahv21cb6IBxM+AnwAPpqAAsHhYR -9h13Y7uYbaOjvuF23LRhAkBoI9eaSMn+l81WXOVUHnzh3ZwB4GuTyxMXXNOhuiFd -0z4LKAMh99Z4xQmqSoEkXsfM4KPpfhYjF/bwIcP5gOei ------END RSA PRIVATE KEY----- diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index 712a9c7e39977f..c96253bc44d450 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -41,9 +41,9 @@ const DH_NOT_SUITABLE_GENERATOR = crypto.constants.DH_NOT_SUITABLE_GENERATOR; require('internal/crypto/util').setDefaultEncoding('latin1'); // Test Certificates -const certPem = fixtures.readSync('test_cert.pem', 'ascii'); -const certPfx = fixtures.readSync('test_cert.pfx'); -const keyPem = fixtures.readSync('test_key.pem', 'ascii'); +const certPem = fixtures.readKey('rsa_cert.crt'); +const certPfx = fixtures.readKey('rsa_cert.pfx'); +const keyPem = fixtures.readKey('rsa_private.pem'); const rsaPubPem = fixtures.readKey('rsa_public.pem', 'ascii'); const rsaKeyPem = fixtures.readKey('rsa_private.pem', 'ascii'); diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js index 1e657b9e60d494..120a9f1f94f570 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -11,8 +11,8 @@ const constants = crypto.constants; const fixtures = require('../common/fixtures'); // Test certificates -const certPem = fixtures.readSync('test_cert.pem', 'ascii'); -const keyPem = fixtures.readSync('test_key.pem', 'ascii'); +const certPem = fixtures.readKey('rsa_cert.crt'); +const keyPem = fixtures.readKey('rsa_private.pem'); const rsaKeySize = 2048; const rsaPubPem = fixtures.readKey('rsa_public.pem', 'ascii'); const rsaKeyPem = fixtures.readKey('rsa_private.pem', 'ascii'); diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js index 0c7f4fb0bc9e37..66c7ac7d8014df 100644 --- a/test/parallel/test-crypto-sign-verify.js +++ b/test/parallel/test-crypto-sign-verify.js @@ -11,9 +11,9 @@ const crypto = require('crypto'); const fixtures = require('../common/fixtures'); // Test certificates -const certPem = fixtures.readSync('test_cert.pem', 'ascii'); -const keyPem = fixtures.readSync('test_key.pem', 'ascii'); -const modSize = 1024; +const certPem = fixtures.readKey('rsa_cert.crt'); +const keyPem = fixtures.readKey('rsa_private.pem'); +const keySize = 2048; { const Sign = crypto.Sign; @@ -152,7 +152,7 @@ common.expectsError( { function testPSS(algo, hLen) { // Maximum permissible salt length - const max = modSize / 8 - hLen - 2; + const max = keySize / 8 - hLen - 2; function getEffectiveSaltLength(saltLength) { switch (saltLength) { diff --git a/test/parallel/test-crypto-verify-failure.js b/test/parallel/test-crypto-verify-failure.js index 7e9fda9f6791f6..ad7d5d4f86d52b 100644 --- a/test/parallel/test-crypto-verify-failure.js +++ b/test/parallel/test-crypto-verify-failure.js @@ -29,7 +29,7 @@ const crypto = require('crypto'); const tls = require('tls'); const fixtures = require('../common/fixtures'); -const certPem = fixtures.readSync('test_cert.pem', 'ascii'); +const certPem = fixtures.readKey('rsa_cert.crt'); const options = { key: fixtures.readKey('agent1-key.pem'), diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js index 86c617815f2726..9337621d37fcfb 100644 --- a/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js @@ -37,7 +37,7 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); // Test Certificates -const certPfx = fixtures.readSync('test_cert.pfx'); +const certPfx = fixtures.readKey('rsa_cert.pfx'); // 'this' safety // https://github.com/joyent/node/issues/6690 diff --git a/test/parallel/test-https-client-reject.js b/test/parallel/test-https-client-reject.js index 729256df54ff8c..113b56fda66fe4 100644 --- a/test/parallel/test-https-client-reject.js +++ b/test/parallel/test-https-client-reject.js @@ -30,8 +30,8 @@ const assert = require('assert'); const https = require('https'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const server = https.createServer(options, common.mustCall(function(req, res) { @@ -72,7 +72,7 @@ function rejectUnauthorized() { function authorized() { const options = { port: server.address().port, - ca: [fixtures.readSync('test_cert.pem')] + ca: [fixtures.readKey('rsa_cert.crt')] }; options.agent = new https.Agent(options); const req = https.request(options, function(res) { diff --git a/test/parallel/test-https-client-renegotiation-limit.js b/test/parallel/test-https-client-renegotiation-limit.js index 4d3dda3d759e38..6b5aad2d30933f 100644 --- a/test/parallel/test-https-client-renegotiation-limit.js +++ b/test/parallel/test-https-client-renegotiation-limit.js @@ -50,8 +50,8 @@ const LIMITS = [0, 1, 2, 3, 5, 10, 16]; function test(next) { const options = { - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem'), }; const server = https.createServer(options, (req, res) => { diff --git a/test/parallel/test-https-drain.js b/test/parallel/test-https-drain.js index 98e43b27d4cebd..1c8a29258f26f6 100644 --- a/test/parallel/test-https-drain.js +++ b/test/parallel/test-https-drain.js @@ -29,8 +29,8 @@ const assert = require('assert'); const https = require('https'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const bufSize = 1024 * 1024; diff --git a/test/parallel/test-https-pfx.js b/test/parallel/test-https-pfx.js index 7cf23a7dfa17f4..4246913a037ec1 100644 --- a/test/parallel/test-https-pfx.js +++ b/test/parallel/test-https-pfx.js @@ -30,7 +30,7 @@ const fixtures = require('../common/fixtures'); const assert = require('assert'); const https = require('https'); -const pfx = fixtures.readSync('test_cert.pfx'); +const pfx = fixtures.readKey('rsa_cert.pfx'); const options = { host: '127.0.0.1', diff --git a/test/parallel/test-https-unix-socket-self-signed.js b/test/parallel/test-https-unix-socket-self-signed.js index 48207a7a22f52a..9db92ac2aed44a 100644 --- a/test/parallel/test-https-unix-socket-self-signed.js +++ b/test/parallel/test-https-unix-socket-self-signed.js @@ -10,8 +10,8 @@ tmpdir.refresh(); const fixtures = require('../common/fixtures'); const https = require('https'); const options = { - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }; const server = https.createServer(options, common.mustCall((req, res) => { diff --git a/test/parallel/test-tls-async-cb-after-socket-end.js b/test/parallel/test-tls-async-cb-after-socket-end.js index 49ca0cebc9b524..357cef30715d71 100644 --- a/test/parallel/test-tls-async-cb-after-socket-end.js +++ b/test/parallel/test-tls-async-cb-after-socket-end.js @@ -15,8 +15,8 @@ const tls = require('tls'); const options = { secureOptions: SSL_OP_NO_TICKET, - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const server = tls.createServer(options, common.mustCall()); diff --git a/test/parallel/test-tls-client-abort.js b/test/parallel/test-tls-client-abort.js index 09f252db308881..50c9a4b32437fc 100644 --- a/test/parallel/test-tls-client-abort.js +++ b/test/parallel/test-tls-client-abort.js @@ -27,8 +27,8 @@ if (!common.hasCrypto) const tls = require('tls'); const fixtures = require('../common/fixtures'); -const cert = fixtures.readSync('test_cert.pem'); -const key = fixtures.readSync('test_key.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); +const key = fixtures.readKey('rsa_private.pem'); const conn = tls.connect({ cert, key, port: 0 }, common.mustNotCall()); conn.on('error', function() {}); diff --git a/test/parallel/test-tls-client-reject.js b/test/parallel/test-tls-client-reject.js index 329b78c271baaa..d41ad806ea3012 100644 --- a/test/parallel/test-tls-client-reject.js +++ b/test/parallel/test-tls-client-reject.js @@ -29,8 +29,8 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const server = tls.createServer(options, function(socket) { @@ -80,7 +80,7 @@ function rejectUnauthorized() { function authorized() { console.log('connect authorized'); const socket = tls.connect(server.address().port, { - ca: [fixtures.readSync('test_cert.pem')], + ca: [fixtures.readKey('rsa_cert.crt')], servername: 'localhost' }, common.mustCall(function() { console.log('... authorized'); diff --git a/test/parallel/test-tls-client-renegotiation-limit.js b/test/parallel/test-tls-client-renegotiation-limit.js index 38dcf5a80be5a6..9a08efe96f5098 100644 --- a/test/parallel/test-tls-client-renegotiation-limit.js +++ b/test/parallel/test-tls-client-renegotiation-limit.js @@ -49,8 +49,8 @@ const LIMITS = [0, 1, 2, 3, 5, 10, 16]; function test(next) { const options = { - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem'), }; const server = tls.createServer(options, (conn) => { diff --git a/test/parallel/test-tls-connect-given-socket.js b/test/parallel/test-tls-connect-given-socket.js index 5fc5603dd1653b..f25cf4582d59b1 100644 --- a/test/parallel/test-tls-connect-given-socket.js +++ b/test/parallel/test-tls-connect-given-socket.js @@ -30,8 +30,8 @@ const tls = require('tls'); const net = require('net'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const server = tls.createServer(options, common.mustCall((socket) => { diff --git a/test/parallel/test-tls-connect-memleak.js b/test/parallel/test-tls-connect-memleak.js index 162d61fcdc7a66..b0dedfa0bba56d 100644 --- a/test/parallel/test-tls-connect-memleak.js +++ b/test/parallel/test-tls-connect-memleak.js @@ -35,8 +35,8 @@ const fixtures = require('../common/fixtures'); // added using `once()`, i.e. can be gc'ed once that event has occurred. const server = tls.createServer({ - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }).listen(0); let collected = false; diff --git a/test/parallel/test-tls-connect-no-host.js b/test/parallel/test-tls-connect-no-host.js index f6384743ac7081..97b95332c47c2e 100644 --- a/test/parallel/test-tls-connect-no-host.js +++ b/test/parallel/test-tls-connect-no-host.js @@ -8,8 +8,8 @@ if (!common.hasCrypto) const tls = require('tls'); const assert = require('assert'); -const cert = fixtures.readSync('test_cert.pem'); -const key = fixtures.readSync('test_key.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); +const key = fixtures.readKey('rsa_private.pem'); // https://github.com/nodejs/node/issues/1489 // tls.connect(options) with no options.host should accept a cert with diff --git a/test/parallel/test-tls-connect-stream-writes.js b/test/parallel/test-tls-connect-stream-writes.js index 0c6ae2b660d502..001fe985800f28 100644 --- a/test/parallel/test-tls-connect-stream-writes.js +++ b/test/parallel/test-tls-connect-stream-writes.js @@ -9,9 +9,9 @@ const stream = require('stream'); const net = require('net'); const fixtures = require('../common/fixtures'); -const options = { key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem'), - ca: [ fixtures.readSync('test_ca.pem') ], +const options = { key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: [ fixtures.readKey('rsa_ca.crt') ], ciphers: 'AES256-GCM-SHA384' }; const content = 'hello world'; const recv_bufs = []; diff --git a/test/parallel/test-tls-destroy-stream.js b/test/parallel/test-tls-destroy-stream.js index b06d7728dc6764..a49e985a7e0204 100644 --- a/test/parallel/test-tls-destroy-stream.js +++ b/test/parallel/test-tls-destroy-stream.js @@ -18,9 +18,9 @@ tls.DEFAULT_MAX_VERSION = 'TLSv1.3'; const CONTENT = 'Hello World'; const tlsServer = tls.createServer( { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem'), - ca: [fixtures.readSync('test_ca.pem')], + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: [fixtures.readKey('rsa_ca.crt')], }, (socket) => { socket.on('close', common.mustCall()); diff --git a/test/parallel/test-tls-fast-writing.js b/test/parallel/test-tls-fast-writing.js index 398beb0d097701..af40cc33baeda0 100644 --- a/test/parallel/test-tls-fast-writing.js +++ b/test/parallel/test-tls-fast-writing.js @@ -28,9 +28,9 @@ const fixtures = require('../common/fixtures'); const assert = require('assert'); const tls = require('tls'); -const options = { key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem'), - ca: [ fixtures.readSync('test_ca.pem') ] }; +const options = { key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: [ fixtures.readKey('rsa_ca.crt') ] }; const server = tls.createServer(options, onconnection); let gotChunk = false; diff --git a/test/parallel/test-tls-handshake-exception.js b/test/parallel/test-tls-handshake-exception.js index 1ba4bc6438e2f9..4d8ea7d33ae7fb 100644 --- a/test/parallel/test-tls-handshake-exception.js +++ b/test/parallel/test-tls-handshake-exception.js @@ -21,8 +21,8 @@ if (process.argv[2] === 'child') { const { Duplex } = require('stream'); const { mustCall } = common; - const cert = fixtures.readSync('test_cert.pem'); - const key = fixtures.readSync('test_key.pem'); + const cert = fixtures.readKey('rsa_cert.crt'); + const key = fixtures.readKey('rsa_private.pem'); net.createServer(mustCall(onplaintext)).listen(0, mustCall(onlisten)); diff --git a/test/parallel/test-tls-hello-parser-failure.js b/test/parallel/test-tls-hello-parser-failure.js index 4b92f6bde3151c..07776dd89e9227 100644 --- a/test/parallel/test-tls-hello-parser-failure.js +++ b/test/parallel/test-tls-hello-parser-failure.js @@ -36,8 +36,8 @@ const tls = require('tls'); const net = require('net'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const bonkers = Buffer.alloc(1024 * 1024, 42); diff --git a/test/parallel/test-tls-inception.js b/test/parallel/test-tls-inception.js index f28f92373c5500..7310308e6f9876 100644 --- a/test/parallel/test-tls-inception.js +++ b/test/parallel/test-tls-inception.js @@ -32,8 +32,8 @@ const tls = require('tls'); const net = require('net'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const body = 'A'.repeat(40000); diff --git a/test/parallel/test-tls-interleave.js b/test/parallel/test-tls-interleave.js index 70f98f33e4f2b2..91449b5b3ae571 100644 --- a/test/parallel/test-tls-interleave.js +++ b/test/parallel/test-tls-interleave.js @@ -30,9 +30,9 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); -const options = { key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem'), - ca: [ fixtures.readSync('test_ca.pem') ] }; +const options = { key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt'), + ca: [ fixtures.readKey('rsa_ca.crt') ] }; const writes = [ 'some server data', diff --git a/test/parallel/test-tls-net-connect-prefer-path.js b/test/parallel/test-tls-net-connect-prefer-path.js index 263501ae0330ac..1b8231664dce38 100644 --- a/test/parallel/test-tls-net-connect-prefer-path.js +++ b/test/parallel/test-tls-net-connect-prefer-path.js @@ -29,8 +29,8 @@ function mkServer(lib, tcp, cb) { const args = [handler]; if (lib === tls) { args.unshift({ - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }); } const server = lib.createServer(...args); diff --git a/test/parallel/test-tls-no-sslv3.js b/test/parallel/test-tls-no-sslv3.js index 4cbb62e3d595f1..1acb1f93767404 100644 --- a/test/parallel/test-tls-no-sslv3.js +++ b/test/parallel/test-tls-no-sslv3.js @@ -11,8 +11,8 @@ const tls = require('tls'); const spawn = require('child_process').spawn; const fixtures = require('../common/fixtures'); -const cert = fixtures.readSync('test_cert.pem'); -const key = fixtures.readSync('test_key.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); +const key = fixtures.readKey('rsa_private.pem'); const server = tls.createServer({ cert, key }, common.mustNotCall()); const errors = []; let stderr = ''; diff --git a/test/parallel/test-tls-pause.js b/test/parallel/test-tls-pause.js index e246acff807a91..120d6d87a7a913 100644 --- a/test/parallel/test-tls-pause.js +++ b/test/parallel/test-tls-pause.js @@ -32,8 +32,8 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const bufSize = 1024 * 1024; diff --git a/test/parallel/test-tls-securepair-fiftharg.js b/test/parallel/test-tls-securepair-fiftharg.js index 0651f98c6d780d..9adb2bf424818b 100644 --- a/test/parallel/test-tls-securepair-fiftharg.js +++ b/test/parallel/test-tls-securepair-fiftharg.js @@ -9,8 +9,8 @@ const tls = require('tls'); const fixtures = require('../common/fixtures'); const sslcontext = tls.createSecureContext({ - cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + cert: fixtures.readKey('rsa_cert.crt'), + key: fixtures.readKey('rsa_private.pem') }); const pair = tls.createSecurePair(sslcontext, true, false, false, { diff --git a/test/parallel/test-tls-zero-clear-in.js b/test/parallel/test-tls-zero-clear-in.js index b2a07960d4138c..f24fb6f992e75d 100644 --- a/test/parallel/test-tls-zero-clear-in.js +++ b/test/parallel/test-tls-zero-clear-in.js @@ -28,8 +28,8 @@ if (!common.hasCrypto) const tls = require('tls'); const fixtures = require('../common/fixtures'); -const cert = fixtures.readSync('test_cert.pem'); -const key = fixtures.readSync('test_key.pem'); +const cert = fixtures.readKey('rsa_cert.crt'); +const key = fixtures.readKey('rsa_private.pem'); const server = tls.createServer({ cert, diff --git a/test/pummel/test-https-no-reader.js b/test/pummel/test-https-no-reader.js index ad0b56c1f3c7b1..31d2bfa2d3ca34 100644 --- a/test/pummel/test-https-no-reader.js +++ b/test/pummel/test-https-no-reader.js @@ -29,8 +29,8 @@ const https = require('https'); const fixtures = require('../common/fixtures'); const options = { - key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + key: fixtures.readKey('rsa_private.pem'), + cert: fixtures.readKey('rsa_cert.crt') }; const buf = Buffer.allocUnsafe(1024 * 1024); diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js index 9f5c073c9e2d06..13aee51175f618 100644 --- a/test/sequential/test-async-wrap-getasyncid.js +++ b/test/sequential/test-async-wrap-getasyncid.js @@ -266,9 +266,9 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check const { TCP, constants: TCPConstants } = internalBinding('tcp_wrap'); const tcp = new TCP(TCPConstants.SOCKET); - const ca = fixtures.readSync('test_ca.pem', 'ascii'); - const cert = fixtures.readSync('test_cert.pem', 'ascii'); - const key = fixtures.readSync('test_key.pem', 'ascii'); + const ca = fixtures.readKey('rsa_ca.crt'); + const cert = fixtures.readKey('rsa_cert.crt'); + const key = fixtures.readKey('rsa_private.pem'); const credentials = require('tls').createSecureContext({ ca, cert, key }); diff --git a/test/sequential/test-tls-connect.js b/test/sequential/test-tls-connect.js index 291747aea77b49..5cfec7ed04707d 100644 --- a/test/sequential/test-tls-connect.js +++ b/test/sequential/test-tls-connect.js @@ -33,8 +33,8 @@ const tls = require('tls'); // https://github.com/joyent/node/issues/1218 // uncatchable exception on TLS connection error { - const cert = fixtures.readSync('test_cert.pem'); - const key = fixtures.readSync('test_key.pem'); + const cert = fixtures.readKey('rsa_cert.crt'); + const key = fixtures.readKey('rsa_private.pem'); const options = { cert: cert, key: key, port: common.PORT }; const conn = tls.connect(options, common.mustNotCall()); @@ -47,8 +47,8 @@ const tls = require('tls'); // SSL_accept/SSL_connect error handling { - const cert = fixtures.readSync('test_cert.pem'); - const key = fixtures.readSync('test_key.pem'); + const cert = fixtures.readKey('rsa_cert.crt'); + const key = fixtures.readKey('rsa_private.pem'); assert.throws(() => { tls.connect({