test: add regression test for 512 bits DH key

Check that trying to use a < 1024 bits DH key throws an exception.

parallel/test-tls-dhe tests this as well but it feels incongruous not to
do it here when both tests have similar logic for 1024/2048 bits keys.

PR-URL: https://github.com/nodejs/node/pull/3629
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This commit is contained in:
Ben Noordhuis committed 2015-11-03 11:46:55 +01:00
1 parent 6d6bc5d9d8
commit cddf358f68
1 file changed
+3
@@ -75,6 +75,9 @@ function testDHE2048() {
testDHE1024();
assert.throws(() => test(512, true, assert.fail),
/DH parameter is less than 1024 bits/);
process.on('exit', function() {
assert.equal(nsuccess, 1);
assert.equal(nerror, 1);