GeezerVison is showing github.com — test: more regression tests for minDHSize option · nodejs/node@8152248
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/_tls_wrap.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -974,7 +974,7 @@ exports.connect = function(/* [port, host], options, cb */) { | 974 | 974 | assert(typeof options.minDHSize === 'number', | 975 | 975 | 'options.minDHSize is not a number: ' + options.minDHSize); | 976 | 976 | assert(options.minDHSize > 0, | 977 | | - 'options.minDHSize is not a posivie number: ' + | | 977 | + 'options.minDHSize is not a positive number: ' + | 978 | 978 | options.minDHSize); | 979 | 979 |
| 980 | 980 | var hostname = options.servername || | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-tls-client-mindhsize.js +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -78,6 +78,15 @@ testDHE1024(); | 78 | 78 | assert.throws(() => test(512, true, assert.fail), | 79 | 79 | /DH parameter is less than 1024 bits/); | 80 | 80 |
| | 81 | +[0, -1, -Infinity, NaN].forEach(minDHSize => { | | 82 | + assert.throws(() => tls.connect({ minDHSize }), | | 83 | + /minDHSize is not a positive number/); | | 84 | +}); | | 85 | + | | 86 | +[true, false, null, undefined, {}, [], '', '1'].forEach(minDHSize => { | | 87 | + assert.throws(() => tls.connect({ minDHSize }), /minDHSize is not a number/); | | 88 | +}); | | 89 | + | 81 | 90 | process.on('exit', function() { | 82 | 91 | assert.equal(nsuccess, 1); | 83 | 92 | assert.equal(nerror, 1); | |
|