Remove 1000 messageKey limit entirely, along with custom limits (#42)

This commit is contained in:
Scott Nonnenberg 2018-02-14 11:35:41 -08:00 committed by GitHub
parent d08705329a
commit a80285cc83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 30 deletions

View File

@ -36014,14 +36014,7 @@ libsignal.SessionBuilder = function (storage, remoteAddress) {
this.processV3 = builder.processV3.bind(builder);
};
function SessionCipher(storage, remoteAddress, options) {
options = options || {};
if (typeof options.messageKeysLimit === 'undefined') {
options.messageKeysLimit = 1000;
}
this.messageKeysLimit = options.messageKeysLimit;
function SessionCipher(storage, remoteAddress) {
this.remoteAddress = remoteAddress;
this.storage = storage;
}
@ -36294,11 +36287,6 @@ SessionCipher.prototype = {
});
},
fillMessageKeys: function(chain, counter) {
if (this.messageKeysLimit && Object.keys(chain.messageKeys).length >= this.messageKeysLimit) {
console.log("Too many message keys for chain");
return Promise.resolve(); // Stalker, much?
}
if (chain.chainKey.counter >= counter) {
return Promise.resolve(); // Already calculated
}
@ -36435,8 +36423,8 @@ SessionCipher.prototype = {
}
};
libsignal.SessionCipher = function(storage, remoteAddress, options) {
var cipher = new SessionCipher(storage, remoteAddress, options);
libsignal.SessionCipher = function(storage, remoteAddress) {
var cipher = new SessionCipher(storage, remoteAddress);
// returns a Promise that resolves to a ciphertext object
this.encrypt = cipher.encrypt.bind(cipher);

View File

@ -1,11 +1,4 @@
function SessionCipher(storage, remoteAddress, options) {
options = options || {};
if (typeof options.messageKeysLimit === 'undefined') {
options.messageKeysLimit = 1000;
}
this.messageKeysLimit = options.messageKeysLimit;
function SessionCipher(storage, remoteAddress) {
this.remoteAddress = remoteAddress;
this.storage = storage;
}
@ -278,11 +271,6 @@ SessionCipher.prototype = {
});
},
fillMessageKeys: function(chain, counter) {
if (this.messageKeysLimit && Object.keys(chain.messageKeys).length >= this.messageKeysLimit) {
console.log("Too many message keys for chain");
return Promise.resolve(); // Stalker, much?
}
if (chain.chainKey.counter >= counter) {
return Promise.resolve(); // Already calculated
}
@ -419,8 +407,8 @@ SessionCipher.prototype = {
}
};
libsignal.SessionCipher = function(storage, remoteAddress, options) {
var cipher = new SessionCipher(storage, remoteAddress, options);
libsignal.SessionCipher = function(storage, remoteAddress) {
var cipher = new SessionCipher(storage, remoteAddress);
// returns a Promise that resolves to a ciphertext object
this.encrypt = cipher.encrypt.bind(cipher);