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/CacheCryptoStructs.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/CacheCryptoStructs.h') diff --git a/src/CacheCryptoStructs.h b/src/CacheCryptoStructs.h index c884107e..b665be86 100644 --- a/src/CacheCryptoStructs.h +++ b/src/CacheCryptoStructs.h @@ -4,12 +4,28 @@ #pragma once +#include + #include #include +#include #include #include +namespace crypto { +Q_NAMESPACE +//! How much a participant is trusted. +enum Trust +{ + Unverified, //! Device unverified or master key changed. + TOFU, //! Device is signed by the sender, but the user is not verified, but they never + //! changed the master key. + Verified, //! User was verified and has crosssigned this device or device is verified. +}; +Q_ENUM_NS(Trust) +} + struct DeviceAndMasterKeys { // map from device id or master key id to message_index @@ -87,9 +103,11 @@ from_json(const nlohmann::json &obj, StoredOlmSession &msg); struct VerificationStatus { //! True, if the users master key is verified - bool user_verified = false; + crypto::Trust user_verified = crypto::Trust::Unverified; //! List of all devices marked as verified std::vector verified_devices; + //! Map from sender key/curve25519 to trust status + std::map verified_device_keys; }; //! In memory cache of verification status -- cgit 1.5.1