Skip to content

Commit

Permalink
test: simplify loadDHParam in TLS test
Browse files Browse the repository at this point in the history
PR-URL: #18103
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
tniessen authored and evanlucas committed Jan 30, 2018
1 parent 6b687cf commit 63be0d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions test/parallel/test-tls-client-getephemeralkeyinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const fixtures = require('../common/fixtures');

const assert = require('assert');
const tls = require('tls');
const fs = require('fs');

const key = fixtures.readKey('agent2-key.pem');
const cert = fixtures.readKey('agent2-cert.pem');
Expand All @@ -15,9 +14,7 @@ let ntests = 0;
let nsuccess = 0;

function loadDHParam(n) {
let path = fixtures.fixturesDir;
if (n !== 'error') path += '/keys';
return fs.readFileSync(`${path}/dh${n}.pem`);
return fixtures.readKey(`dh${n}.pem`);
}

const cipherlist = {
Expand Down
5 changes: 1 addition & 4 deletions test/parallel/test-tls-client-mindhsize.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ let nsuccess = 0;
let nerror = 0;

function loadDHParam(n) {
const params = [`dh${n}.pem`];
if (n !== 'error')
params.unshift('keys');
return fixtures.readSync(params);
return fixtures.readKey(`dh${n}.pem`);
}

function test(size, err, next) {
Expand Down

0 comments on commit 63be0d6

Please sign in to comment.