fix: Fix ratchet only working for one message

This commit is contained in:
2022-08-11 11:57:33 +02:00
parent 683a76cc80
commit d0986a4608
2 changed files with 8 additions and 3 deletions

View File

@@ -293,11 +293,15 @@ class OmemoDoubleRatchet {
return plaintext;
}
if (header.dhPub != await dhr?.getBytes()) {
final dhPubMatches = listsEqual(
header.dhPub ?? <int>[],
await dhr?.getBytes() ?? <int>[],
);
if (!dhPubMatches) {
await _skipMessageKeys(header.pn!);
await _dhRatchet(header);
}
await _skipMessageKeys(header.n!);
final newCkr = await kdfCk(ckr!, kdfCkNextChainKey);
final mk = await kdfCk(ckr!, kdfCkNextMessageKey);