From ceff219b2b7fec21a5feac0b9606a2ebad8c4822 Mon Sep 17 00:00:00 2001 From: Melvin Keskin Date: Fri, 17 Sep 2021 01:26:05 +0200 Subject: TrustStorage: Add security policies --- src/client/QXmppTrustStorage.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/client/QXmppTrustStorage.h') diff --git a/src/client/QXmppTrustStorage.h b/src/client/QXmppTrustStorage.h index 1252c06b..f1b426b5 100644 --- a/src/client/QXmppTrustStorage.h +++ b/src/client/QXmppTrustStorage.h @@ -34,7 +34,16 @@ class QXMPP_EXPORT QXmppTrustStorage { public: /// - /// trust level of public long-term keys used by end-to-end encryption + /// Security policy to decide which public long-term keys are used for + /// encryption because they are trusted + /// + enum SecurityPolicy { + NoSecurityPolicy, ///< New keys must be trusted manually. + Toakafa, ///< New keys are trusted automatically until the first authentication but automatically distrusted afterwards. + }; + + /// + /// Trust level of public long-term keys used by end-to-end encryption /// protocols /// enum TrustLevel { @@ -46,6 +55,9 @@ public: }; Q_DECLARE_FLAGS(TrustLevels, TrustLevel) + virtual QFuture setSecurityPolicies(const QString &encryption = {}, SecurityPolicy securityPolicy = SecurityPolicy::NoSecurityPolicy) = 0; + virtual QFuture securityPolicy(const QString &encryption) = 0; + virtual QFuture addOwnKey(const QString &encryption, const QString &keyId) = 0; virtual QFuture removeOwnKey(const QString &encryption) = 0; virtual QFuture ownKey(const QString &encryption) const = 0; @@ -64,6 +76,7 @@ public: virtual QFuture>> keysForPostponedTrustDecisions(const QString &encryption, const QList &senderKeyIds = {}) = 0; }; +Q_DECLARE_METATYPE(QXmppTrustStorage::SecurityPolicy) Q_DECLARE_OPERATORS_FOR_FLAGS(QXmppTrustStorage::TrustLevels) #endif // QXMPPTRUSTSTORAGE_H -- cgit v1.2.3