mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Ensure that message.previousCounter can never go below zero
This commit is contained in:
@@ -36092,6 +36092,9 @@ SessionCipher.prototype = {
|
||||
delete chain.messageKeys[chain.chainKey.counter];
|
||||
msg.counter = chain.chainKey.counter;
|
||||
msg.previousCounter = session.currentRatchet.previousCounter;
|
||||
if (msg.previousCounter < 0) {
|
||||
msg.previousCounter = 0;
|
||||
}
|
||||
|
||||
return Internal.crypto.encrypt(
|
||||
keys[0], buffer, keys[2].slice(0, 16)
|
||||
|
||||
Reference in New Issue
Block a user