Skip to content
Permalink
Browse files

test: simplify loadDHParam in TLS test

PR-URL: #18103
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information...
tniessen authored and MylesBorins committed Jan 11, 2018
1 parent 58fbcab commit 5d66c20c7aeeaf0b328555a398414f0e6bd38235
@@ -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');
@@ -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 = {
@@ -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) {

0 comments on commit 5d66c20

Please sign in to comment.
You can’t perform that action at this time.