Throw error if asked to jump forward in chain by over 2000 (#43)
As libsignal-protocol-java has had for more than three years. This check
was present when it was first pulled out into its own repo in late 2014:
60800e1556/src/main/java/org/whispersystems/libaxolotl/SessionCipher.java (L383)
This commit is contained in:
parent
5679fe7a49
commit
d08705329a
4
dist/libsignal-protocol.js
vendored
4
dist/libsignal-protocol.js
vendored
@ -36303,6 +36303,10 @@ SessionCipher.prototype = {
|
||||
return Promise.resolve(); // Already calculated
|
||||
}
|
||||
|
||||
if (counter - chain.chainKey.counter > 2000) {
|
||||
throw new Error('Over 2000 messages into the future!');
|
||||
}
|
||||
|
||||
if (chain.chainKey.key === undefined) {
|
||||
throw new Error("Got invalid request to extend chain after it was already closed");
|
||||
}
|
||||
|
||||
@ -287,6 +287,10 @@ SessionCipher.prototype = {
|
||||
return Promise.resolve(); // Already calculated
|
||||
}
|
||||
|
||||
if (counter - chain.chainKey.counter > 2000) {
|
||||
throw new Error('Over 2000 messages into the future!');
|
||||
}
|
||||
|
||||
if (chain.chainKey.key === undefined) {
|
||||
throw new Error("Got invalid request to extend chain after it was already closed");
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user