Skip to content

Commit

Permalink
test: move dherror.pem to fixtures/keys/
Browse files Browse the repository at this point in the history
PR-URL: #27962
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
reasonablytall authored and BridgeAR committed Jun 17, 2019
1 parent f9ddcc6 commit d757e0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions test/fixtures/keys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ all: \
dh512.pem \
dh1024.pem \
dh2048.pem \
dherror.pem \
dsa_params.pem \
dsa_private.pem \
dsa_private_encrypted.pem \
Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/dherror.pem → test/fixtures/keys/dherror.pem
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-----BEGIN DH PARAMETERS-----
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAA
AAAAAAAAAA
-----END DH PARAMETERS-----
6 changes: 2 additions & 4 deletions test/parallel/test-tls-dhe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d757e0b

Please sign in to comment.