Skip to content
Snippets Groups Projects
Verified Commit 54169880 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Trust key forwards from the original sender

parent 71a15353
No related branches found
No related tags found
No related merge requests found
Pipeline #1638 passed
...@@ -835,6 +835,13 @@ import_inbound_megolm_session( ...@@ -835,6 +835,13 @@ import_inbound_megolm_session(
data.sender_claimed_ed25519_key = roomKey.content.sender_claimed_ed25519_key; data.sender_claimed_ed25519_key = roomKey.content.sender_claimed_ed25519_key;
// may have come from online key backup, so we can't trust it... // may have come from online key backup, so we can't trust it...
data.trusted = false; data.trusted = false;
// if we got it forwarded from the sender, assume it is trusted. They may still have
// used key backup, but it is unlikely.
if (roomKey.content.forwarding_curve25519_key_chain.size() == 1 &&
roomKey.content.forwarding_curve25519_key_chain.back() ==
roomKey.content.sender_key) {
data.trusted = true;
}
cache::saveInboundMegolmSession(index, std::move(megolm_session), data); cache::saveInboundMegolmSession(index, std::move(megolm_session), data);
} catch (const lmdb::error &e) { } catch (const lmdb::error &e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment