Skip to content
Permalink
Browse files

test: move non-pummel crypto DH tests to parallel

Some parts of pummel/test-crypto-dh.js will be just fine in
parallel/test-crypto-dh.js. Move them there.

PR-URL: #28390
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
  • Loading branch information...
Trott authored and targos committed Jun 22, 2019
1 parent 16926a8 commit e16174461002d9b28729bed5cdb47c582ae9d800
Showing with 27 additions and 27 deletions.
  1. +27 −0 test/parallel/test-crypto-dh.js
  2. +0 −27 test/pummel/test-crypto-dh.js
@@ -388,3 +388,30 @@ common.expectsError(
message: 'The "curve" argument must be of type string. ' +
'Received type undefined'
});

assert.throws(
function() {
crypto.getDiffieHellman('unknown-group');
},
/^Error: Unknown group$/,
'crypto.getDiffieHellman(\'unknown-group\') ' +
'failed to throw the expected error.'
);
assert.throws(
function() {
crypto.getDiffieHellman('modp1').setPrivateKey('');
},
new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
'setPrivateKey is not a function$'),
'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' +
'failed to throw the expected error.'
);
assert.throws(
function() {
crypto.getDiffieHellman('modp1').setPublicKey('');
},
new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
'setPublicKey is not a function$'),
'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' +
'failed to throw the expected error.'
);
@@ -27,33 +27,6 @@ if (!common.hasCrypto)
const assert = require('assert');
const crypto = require('crypto');

assert.throws(
function() {
crypto.getDiffieHellman('unknown-group');
},
/^Error: Unknown group$/,
'crypto.getDiffieHellman(\'unknown-group\') ' +
'failed to throw the expected error.'
);
assert.throws(
function() {
crypto.getDiffieHellman('modp1').setPrivateKey('');
},
new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
'setPrivateKey is not a function$'),
'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' +
'failed to throw the expected error.'
);
assert.throws(
function() {
crypto.getDiffieHellman('modp1').setPublicKey('');
},
new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
'setPublicKey is not a function$'),
'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' +
'failed to throw the expected error.'
);

const hashes = {
modp1: '630e9acd2cc63f7e80d8507624ba60ac0757201a',
modp2: '18f7aa964484137f57bca64b21917a385b6a0b60',

0 comments on commit e161744

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