summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2019-07-26 10:32:40 -0400
committercjihrig <cjihrig@gmail.com>2019-07-29 03:33:28 -1000
commit92ca2c208bf8c1a8abb21df800619b2890f72461 (patch)
tree840d53a7d9f4099e711a4cab379c954623709195 /test
parent62a809fa54949fb1416b2462f995bb98037db2d0 (diff)
downloadandroid-node-v8-92ca2c208bf8c1a8abb21df800619b2890f72461.tar.gz
android-node-v8-92ca2c208bf8c1a8abb21df800619b2890f72461.tar.bz2
android-node-v8-92ca2c208bf8c1a8abb21df800619b2890f72461.zip
crypto: add null check to outputLength logic
The Hash constructor's outputLength logic checks if the options input is an object, but doesn't check for null objects. This commit adds that check. PR-URL: https://github.com/nodejs/node/pull/28864 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-crypto-hash.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js
index 7f185146bc..4d3214adb2 100644
--- a/test/parallel/test-crypto-hash.js
+++ b/test/parallel/test-crypto-hash.js
@@ -191,6 +191,8 @@ common.expectsError(
// Default outputLengths.
assert.strictEqual(crypto.createHash('shake128').digest('hex'),
'7f9c2ba4e88f827d616045507605853e');
+ assert.strictEqual(crypto.createHash('shake128', null).digest('hex'),
+ '7f9c2ba4e88f827d616045507605853e');
assert.strictEqual(crypto.createHash('shake256').digest('hex'),
'46b9dd2b0ba88d13233b3feb743eeb24' +
'3fcd52ea62b81b82b50c27646ed5762f');