1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

keep track of event ID and timestamp of decrypted messages

This is to avoid false positives when detecting replay attacks.

fixes: vector-im/riot-web#3712

Signed-off-by: Hubert Chathi <hubert@uhoreg.ca>
This commit is contained in:
Hubert Chathi
2017-10-11 22:49:44 -04:00
parent f5f8867326
commit 8f252992e4
3 changed files with 109 additions and 7 deletions

View File

@@ -628,6 +628,7 @@ MegolmDecryption.prototype.decryptEvent = async function(event) {
try {
res = await this._olmDevice.decryptGroupMessage(
event.getRoomId(), content.sender_key, content.session_id, content.ciphertext,
event.getId(), event.getTs(),
);
} catch (e) {
if (e.message === 'OLM.UNKNOWN_MESSAGE_INDEX') {