Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
Minor recover tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
tinybike committed Apr 8, 2017
1 parent fc325ef commit a937a2b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,11 @@ module.exports = {
return Buffer.from(self.decrypt(ciphertext, key, iv, algo), "hex");
}

iv = keyObjectCrypto.cipherparams.iv;
salt = keyObjectCrypto.kdfparams.salt;
ciphertext = keyObjectCrypto.ciphertext;
iv = this.str2buf(keyObjectCrypto.cipherparams.iv);
salt = this.str2buf(keyObjectCrypto.kdfparams.salt);
ciphertext = this.str2buf(keyObjectCrypto.ciphertext);
algo = keyObjectCrypto.cipher;

iv = this.str2buf(iv);
salt = this.str2buf(salt);
ciphertext = this.str2buf(ciphertext);

if (keyObjectCrypto.kdf === "pbkdf2" && keyObjectCrypto.kdfparams.prf !== "hmac-sha256") {
throw new Error("PBKDF2 only supported with HMAC-SHA256");
}
Expand Down

0 comments on commit a937a2b

Please sign in to comment.