From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- node_modules/pbkdf2/lib/precondition.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'node_modules/pbkdf2/lib/precondition.js') diff --git a/node_modules/pbkdf2/lib/precondition.js b/node_modules/pbkdf2/lib/precondition.js index 1519b0092..683db5630 100644 --- a/node_modules/pbkdf2/lib/precondition.js +++ b/node_modules/pbkdf2/lib/precondition.js @@ -1,5 +1,15 @@ var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs -module.exports = function (iterations, keylen) { + +function checkBuffer (buf, name) { + if (typeof buf !== 'string' && !Buffer.isBuffer(buf)) { + throw new TypeError(name + ' must be a buffer or string') + } +} + +module.exports = function (password, salt, iterations, keylen) { + checkBuffer(password, 'Password') + checkBuffer(salt, 'Salt') + if (typeof iterations !== 'number') { throw new TypeError('Iterations not a number') } -- cgit v1.2.3