Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'Create 2048bit dhparam key': (test: any) => {
pem.createDhparam(2048, (error: any, data: any) => {
const dhparam = (data && data.dhparam || '').toString();
test.ifError(error);
test.ok(dhparam);
test.ok(dhparam.match(/^\n*\-\-\-\-\-BEGIN DH PARAMETERS\-\-\-\-\-\n/));
test.ok(dhparam.match(/\n\-\-\-\-\-END DH PARAMETERS\-\-\-\-\-\n*$/));
test.ok(dhparam.trim().length > 420 && dhparam.trim().length < 430);
// test.ok(fs.readdirSync('./tmp').length === 0);
test.done();
});
},
'Create 2048bit dhparam key': (test: any) => {
pem.createDhparam(2048, (error: any, data: any) => {
var dhparam = (data && data.dhparam || '').toString();
test.ifError(error);
test.ok(dhparam);
test.ok(dhparam.match(/^\n*\-\-\-\-\-BEGIN DH PARAMETERS\-\-\-\-\-\n/));
test.ok(dhparam.match(/\n\-\-\-\-\-END DH PARAMETERS\-\-\-\-\-\n*$/));
test.ok(dhparam.trim().length > 420 && dhparam.trim().length < 430);
// test.ok(fs.readdirSync('./tmp').length === 0);
test.done();
});
},