crypto fix for mac

This commit is contained in:
Kyle Spearrin 2017-04-20 16:32:03 -04:00
parent 180101400f
commit f92c5a214f
1 changed files with 1 additions and 1 deletions

View File

@ -354,7 +354,7 @@ angular
var ivBytes = forge.util.decode64(encPieces[0]); var ivBytes = forge.util.decode64(encPieces[0]);
var ctBytes = forge.util.decode64(encPieces[1]); var ctBytes = forge.util.decode64(encPieces[1]);
if (key.macKey) { if (key.macKey && encPieces.length > 2) {
var computedMac = computeMac(ctBytes, ivBytes, key.macKey); var computedMac = computeMac(ctBytes, ivBytes, key.macKey);
if (computedMac !== encPieces[2]) { if (computedMac !== encPieces[2]) {
console.error('MAC failed.'); console.error('MAC failed.');