Updated dependencies. Removed shim from HMAC op and postinstall js-to-mjs step due to CryptoAPI fixes.

This commit is contained in:
n1474335 committed 2018-11-07 12:29:23 +00:00
1 parent 38838e4dca
commit 18a9dfffc7
3 files changed
+529 -584

No files matched your search

-7
View File
@@ -71,13 +71,6 @@ class HMAC extends Operation {
msg = Utils.arrayBufferToStr(input, false),
hasher = CryptoApi.getHasher(hashFunc);
// Horrible shim to fix constructor bug. Reported in nf404/crypto-api#8
hasher.reset = () => {
hasher.state = {};
const tmp = new hasher.constructor();
hasher.state = tmp.state;
};
const mac = CryptoApi.getHmac(CryptoApi.encoder.fromUtf(key), hasher);
mac.update(msg);
return CryptoApi.encoder.toHex(mac.finalize());