From 6e3014895b7624505ef4b1065493bcfbab9d31a2 Mon Sep 17 00:00:00 2001 From: lilia Date: Fri, 31 Oct 2014 21:10:01 -0700 Subject: [PATCH] Fix cryptojs hmac implementation Apparently the bowerized version of cryptojs's WordArray.create doesn't handle arraybuffers correctly. --- js/webcrypto.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/webcrypto.js b/js/webcrypto.js index e19061cfd..174c699c2 100644 --- a/js/webcrypto.js +++ b/js/webcrypto.js @@ -30,7 +30,7 @@ assertIsArrayBuffer(key); assertIsArrayBuffer(input); return CryptoJS.HmacSHA256( - CryptoJS.lib.WordArray.create(input), + CryptoJS.enc.Latin1.parse(getString(input)), CryptoJS.enc.Latin1.parse(getString(key)) ).toString(CryptoJS.enc.Latin1); };