Skip to content

Commit 63be0d6

Browse files
tniessenevanlucas
authored andcommitted
test: simplify loadDHParam in TLS test
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]>
1 parent 6b687cf commit 63be0d6

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

test/parallel/test-tls-client-getephemeralkeyinfo.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const fixtures = require('../common/fixtures');
66

77
const assert = require('assert');
88
const tls = require('tls');
9-
const fs = require('fs');
109

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

1716
function loadDHParam(n) {
18-
let path = fixtures.fixturesDir;
19-
if (n !== 'error') path += '/keys';
20-
return fs.readFileSync(`${path}/dh${n}.pem`);
17+
return fixtures.readKey(`dh${n}.pem`);
2118
}
2219

2320
const cipherlist = {

test/parallel/test-tls-client-mindhsize.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ let nsuccess = 0;
1414
let nerror = 0;
1515

1616
function loadDHParam(n) {
17-
const params = [`dh${n}.pem`];
18-
if (n !== 'error')
19-
params.unshift('keys');
20-
return fixtures.readSync(params);
17+
return fixtures.readKey(`dh${n}.pem`);
2118
}
2219

2320
function test(size, err, next) {

0 commit comments

Comments
 (0)