From ab3f6f31e77e6cb6f496eaf0d721cae0feba040f Mon Sep 17 00:00:00 2001 From: lSoleyl Date: Wed, 11 Apr 2018 18:04:40 +0200 Subject: [PATCH] Added missing digest argument Passing no digest to pbkdf2() has been deprecated and throws an error with the newest node version. Default value for the digest was "sha1" see: https://github.com/nodejs/node/pull/4047 --- src/endecrypt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/endecrypt.js b/src/endecrypt.js index e13e041..0032d51 100644 --- a/src/endecrypt.js +++ b/src/endecrypt.js @@ -183,7 +183,7 @@ Decrypt.prototype._transform = function(chunk, encoding, done) { if (this.cipher === null) { // Set up // FIXME: node's crypto module uses HMAC-SHA1 so deriving a 256 bit key and 128 bit iv is suboptimal. However, // a plain JavaScript implementation would be much slower and a C module would need a compile step. Any ideas? - crypto.pbkdf2(this.passphrase, this.salt, this.options.rounds, 48, function(err, keyiv) { + crypto.pbkdf2(this.passphrase, this.salt, this.options.rounds, 48, "sha1", function(err, keyiv) { if (err) { this.emit("error", err); return;