Skip to content

Commit

Permalink
Added missing digest argument
Browse files Browse the repository at this point in the history
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: nodejs/node#4047
  • Loading branch information
lSoleyl authored Apr 11, 2018
1 parent 328e2a9 commit ab3f6f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/endecrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ab3f6f3

Please sign in to comment.