Fix bad mac on repeated deliveries
`MessageCounterError` is the expected result of repeated deliveries. Error handling in decryptWithSessionList should immediately return such an error if it occurs. Previous to this change, a Bad MAC error to be returned instead of a MessageCounterError, if the message in question was encrypted for a closed session.
This commit is contained in:
parent
3c0d6dc24b
commit
b01ac22eb9
4
dist/libsignal-protocol.js
vendored
4
dist/libsignal-protocol.js
vendored
@ -36176,6 +36176,10 @@ SessionCipher.prototype = {
|
||||
return this.doDecryptWhisperMessage(buffer, session).then(function(plaintext) {
|
||||
return { plaintext: plaintext, session: session };
|
||||
}).catch(function(e) {
|
||||
if (e.name === 'MessageCounterError') {
|
||||
return Promise.reject(e);
|
||||
}
|
||||
|
||||
errors.push(e);
|
||||
return this.decryptWithSessionList(buffer, sessionList, errors);
|
||||
}.bind(this));
|
||||
|
||||
@ -124,6 +124,10 @@ SessionCipher.prototype = {
|
||||
return this.doDecryptWhisperMessage(buffer, session).then(function(plaintext) {
|
||||
return { plaintext: plaintext, session: session };
|
||||
}).catch(function(e) {
|
||||
if (e.name === 'MessageCounterError') {
|
||||
return Promise.reject(e);
|
||||
}
|
||||
|
||||
errors.push(e);
|
||||
return this.decryptWithSessionList(buffer, sessionList, errors);
|
||||
}.bind(this));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user