diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2015-11-02 13:14:14 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-11-03 11:47:26 +0100 |
commit | 82022a79b035c25f8a41df1f2a20793d356c1511 (patch) | |
tree | 66ed9db15bf61c59fb281a8e7b2e93bd3ffbb9b2 /test | |
parent | cddf358f682349dea22e78ce8df5afe26cd5cd1c (diff) | |
download | android-node-v8-82022a79b035c25f8a41df1f2a20793d356c1511.tar.gz android-node-v8-82022a79b035c25f8a41df1f2a20793d356c1511.tar.bz2 android-node-v8-82022a79b035c25f8a41df1f2a20793d356c1511.zip |
test: more regression tests for minDHSize option
Check that tls.connect() fails in the expected way when passing in
invalid minDHSize options.
PR-URL: https://github.com/nodejs/node/pull/3629
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-tls-client-mindhsize.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/parallel/test-tls-client-mindhsize.js b/test/parallel/test-tls-client-mindhsize.js index a497fdd9f2..a67a3cd67d 100644 --- a/test/parallel/test-tls-client-mindhsize.js +++ b/test/parallel/test-tls-client-mindhsize.js @@ -78,6 +78,15 @@ testDHE1024(); assert.throws(() => test(512, true, assert.fail), /DH parameter is less than 1024 bits/); +[0, -1, -Infinity, NaN].forEach(minDHSize => { + assert.throws(() => tls.connect({ minDHSize }), + /minDHSize is not a positive number/); +}); + +[true, false, null, undefined, {}, [], '', '1'].forEach(minDHSize => { + assert.throws(() => tls.connect({ minDHSize }), /minDHSize is not a number/); +}); + process.on('exit', function() { assert.equal(nsuccess, 1); assert.equal(nerror, 1); |