diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2019-02-01 10:57:04 -0800 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2019-02-04 08:06:41 -0800 |
commit | 6b7c402518d4b77687584eba2a9284674962f343 (patch) | |
tree | 5bf42b6dd9b5b470d507d8f6a17bf9247f870648 /test/parallel | |
parent | c6ecbd36faa3ddf3cc174609e8522d9faa69812c (diff) | |
download | android-node-v8-6b7c402518d4b77687584eba2a9284674962f343.tar.gz android-node-v8-6b7c402518d4b77687584eba2a9284674962f343.tar.bz2 android-node-v8-6b7c402518d4b77687584eba2a9284674962f343.zip |
tls: check arg types of renegotiate()
Don't throw on invalid property access if options is not provided, and
ensure callback is a function.
PR-URL: https://github.com/nodejs/node/pull/25876
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/parallel')
-rw-r--r-- | test/parallel/test-tls-disable-renegotiation.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/parallel/test-tls-disable-renegotiation.js b/test/parallel/test-tls-disable-renegotiation.js index f432764609..42042a21bf 100644 --- a/test/parallel/test-tls-disable-renegotiation.js +++ b/test/parallel/test-tls-disable-renegotiation.js @@ -47,6 +47,22 @@ server.listen(0, common.mustCall(() => { }; const client = tls.connect(options, common.mustCall(() => { client.write(''); + + common.expectsError(() => client.renegotiate(), { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError, + }); + + common.expectsError(() => client.renegotiate(common.mustNotCall()), { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError, + }); + + common.expectsError(() => client.renegotiate({}, false), { + code: 'ERR_INVALID_CALLBACK', + type: TypeError, + }); + // Negotiation is still permitted for this first // attempt. This should succeed. let ok = client.renegotiate(options, common.mustCall((err) => { |