Double the max old ratchet list length
Attempt to mitigate Bad MAC errors due to repeated ciphertext from more than 5 exchanges ago.
This commit is contained in:
parent
7bc356ac15
commit
8334fa5699
5
dist/libsignal-protocol.js
vendored
5
dist/libsignal-protocol.js
vendored
@ -35515,6 +35515,7 @@ Internal.ChainType = {
|
||||
Internal.SessionRecord = function() {
|
||||
'use strict';
|
||||
var ARCHIVED_STATES_MAX_LENGTH = 40;
|
||||
var OLD_RATCHETS_MAX_LENGTH = 10;
|
||||
var SESSION_RECORD_VERSION = 'v1';
|
||||
|
||||
var StaticByteBufferProto = new dcodeIO.ByteBuffer().__proto__;
|
||||
@ -35747,8 +35748,8 @@ Internal.SessionRecord = function() {
|
||||
removeOldChains: function(session) {
|
||||
// Sending ratchets are always removed when we step because we never need them again
|
||||
// Receiving ratchets are added to the oldRatchetList, which we parse
|
||||
// here and remove all but the last five.
|
||||
while (session.oldRatchetList.length > 5) {
|
||||
// here and remove all but the last ten.
|
||||
while (session.oldRatchetList.length > OLD_RATCHETS_MAX_LENGTH) {
|
||||
var index = 0;
|
||||
var oldest = session.oldRatchetList[0];
|
||||
for (var i = 0; i < session.oldRatchetList.length; i++) {
|
||||
|
||||
@ -16,6 +16,7 @@ Internal.ChainType = {
|
||||
Internal.SessionRecord = function() {
|
||||
'use strict';
|
||||
var ARCHIVED_STATES_MAX_LENGTH = 40;
|
||||
var OLD_RATCHETS_MAX_LENGTH = 10;
|
||||
var SESSION_RECORD_VERSION = 'v1';
|
||||
|
||||
var StaticByteBufferProto = new dcodeIO.ByteBuffer().__proto__;
|
||||
@ -248,8 +249,8 @@ Internal.SessionRecord = function() {
|
||||
removeOldChains: function(session) {
|
||||
// Sending ratchets are always removed when we step because we never need them again
|
||||
// Receiving ratchets are added to the oldRatchetList, which we parse
|
||||
// here and remove all but the last five.
|
||||
while (session.oldRatchetList.length > 5) {
|
||||
// here and remove all but the last ten.
|
||||
while (session.oldRatchetList.length > OLD_RATCHETS_MAX_LENGTH) {
|
||||
var index = 0;
|
||||
var oldest = session.oldRatchetList[0];
|
||||
for (var i = 0; i < session.oldRatchetList.length; i++) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user