From d757e0b6d441baaf1288035e4356853b7c637c28 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Wed, 29 May 2019 12:07:53 -0700 Subject: [PATCH] test: move dherror.pem to fixtures/keys/ PR-URL: https://github.com/nodejs/node/pull/27962 Reviewed-By: Sam Roberts Reviewed-By: Ujjwal Sharma Reviewed-By: Rich Trott --- test/fixtures/keys/Makefile | 4 ++++ test/fixtures/{ => keys}/dherror.pem | 3 ++- test/parallel/test-tls-dhe.js | 6 ++---- 3 files changed, 8 insertions(+), 5 deletions(-) rename test/fixtures/{ => keys}/dherror.pem (51%) diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile index d26872e7d55289..198c8e2bd0d7fe 100644 --- a/test/fixtures/keys/Makefile +++ b/test/fixtures/keys/Makefile @@ -24,6 +24,7 @@ all: \ dh512.pem \ dh1024.pem \ dh2048.pem \ + dherror.pem \ dsa_params.pem \ dsa_private.pem \ dsa_private_encrypted.pem \ @@ -578,6 +579,9 @@ dh1024.pem: dh2048.pem: openssl dhparam -out dh2048.pem 2048 +dherror.pem: dh512.pem + sed 's/^[^-].*/AAAAAAAAAA/g' dh512.pem > dherror.pem + dsa_params.pem: openssl dsaparam -out dsa_params.pem 2048 diff --git a/test/fixtures/dherror.pem b/test/fixtures/keys/dherror.pem similarity index 51% rename from test/fixtures/dherror.pem rename to test/fixtures/keys/dherror.pem index 455795fc6cffd3..4f56268d19a23e 100644 --- a/test/fixtures/dherror.pem +++ b/test/fixtures/keys/dherror.pem @@ -1,3 +1,4 @@ -----BEGIN DH PARAMETERS----- -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAA +AAAAAAAAAA -----END DH PARAMETERS----- diff --git a/test/parallel/test-tls-dhe.js b/test/parallel/test-tls-dhe.js index 868686335077a5..ef645ce1b6c624 100644 --- a/test/parallel/test-tls-dhe.js +++ b/test/parallel/test-tls-dhe.js @@ -44,10 +44,8 @@ common.expectWarning('SecurityWarning', 'DH parameter is less than 2048 bits'); function loadDHParam(n) { - const params = [`dh${n}.pem`]; - if (n !== 'error') - params.unshift('keys'); - return fixtures.readSync(params); + const keyname = `dh${n}.pem`; + return fixtures.readKey(keyname); } function test(keylen, expectedCipher, cb) {