crypto fix for mac
This commit is contained in:
parent
180101400f
commit
f92c5a214f
|
@ -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.');
|
||||||
|
|
Loading…
Reference in New Issue