Ensure that message.previousCounter can never go below zero
This commit is contained in:
parent
7461250caf
commit
de630a2ea8
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue