|
@@ -296,7 +296,8 @@ class Context {
|
296
|
296
|
this._cryptoKeyRing[keyIndex].authenticationKey, encodedFrame.data);
|
297
|
297
|
|
298
|
298
|
// Do truncated hash comparison.
|
299
|
|
- if (!isArrayEqual(authTag, calculatedTag.slice(0, digestLength[encodedFrame.type]))) {
|
|
299
|
+ if (!isArrayEqual(new Uint8Array(authTag),
|
|
300
|
+ new Uint8Array(calculatedTag.slice(0, digestLength[encodedFrame.type])))) {
|
300
|
301
|
// TODO: at this point we need to ratchet until we get a key that works. If we ratchet too often
|
301
|
302
|
// we need to return an error to the app.
|
302
|
303
|
console.error('Authentication tag mismatch', new Uint8Array(authTag), new Uint8Array(calculatedTag,
|