From 935b97769eaec84e34047f71f54d7ec9ad89d25a Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 2 Nov 2015 13:06:26 +0100 Subject: [PATCH] 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 --- test/parallel/test-tls-client-mindhsize.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/parallel/test-tls-client-mindhsize.js b/test/parallel/test-tls-client-mindhsize.js index fde3de512cdc26..a497fdd9f2de62 100644 --- a/test/parallel/test-tls-client-mindhsize.js +++ b/test/parallel/test-tls-client-mindhsize.js @@ -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);