From 0d0709ccd37ef2f689c9d22a20994ce8d423e18b Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 7 May 2021 12:19:46 +0200 Subject: Show verification status next to messages --- src/Olm.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/Olm.cpp') diff --git a/src/Olm.cpp b/src/Olm.cpp index b218ba2c..d08c1b3e 100644 --- a/src/Olm.cpp +++ b/src/Olm.cpp @@ -939,7 +939,6 @@ decryptEvent(const MegolmSessionIndex &index, } // TODO: Lookup index,event_id,origin_server_ts tuple for replay attack errors - // TODO: Verify sender_key std::string msg_str; try { @@ -976,6 +975,17 @@ decryptEvent(const MegolmSessionIndex &index, return {std::nullopt, std::nullopt, std::move(te.data)}; } +crypto::Trust +calculate_trust(const std::string &user_id, const std::string &curve25519) +{ + auto status = cache::client()->verificationStatus(user_id); + crypto::Trust trustlevel = crypto::Trust::Unverified; + if (status.verified_device_keys.count(curve25519)) + trustlevel = status.verified_device_keys.at(curve25519); + + return trustlevel; +} + //! Send encrypted to device messages, targets is a map from userid to device ids or {} for all //! devices void -- cgit 1.5.1