From 6491c55011d8c677b776a7ba66c21031f689c2d2 Mon Sep 17 00:00:00 2001 From: Melvin Keskin Date: Sat, 15 Jan 2022 13:55:18 +0100 Subject: Split up ATM parts of trust storage and refactor (#388) QXmppTrustStorage is now the base class for all trust storages used by end-to-end encryption managers. QXmppAtmTrustStorage is used by QXmppAtmManager. QXmppTrustMemoryStorage is now the base class for all trust storages that use the memory for storing data. QXmppAtmTrustMemoryStorage can be used by QXmppAtmManager. Methods needed by the upcoming OMEMO implementation are added. Some existing methods are refactored. --- src/client/QXmppAtmManager.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'src/client/QXmppAtmManager.cpp') diff --git a/src/client/QXmppAtmManager.cpp b/src/client/QXmppAtmManager.cpp index 4155e993..c4fe2cad 100644 --- a/src/client/QXmppAtmManager.cpp +++ b/src/client/QXmppAtmManager.cpp @@ -8,13 +8,11 @@ #include "QXmppClient.h" #include "QXmppConstants_p.h" #include "QXmppFutureUtils_p.h" +#include "QXmppMessage.h" #include "QXmppTrustMessageElement.h" +#include "QXmppTrustMessageKeyOwner.h" #include "QXmppUtils.h" -#include -#include -#include - using namespace QXmpp::Private; /// @@ -27,21 +25,10 @@ using namespace QXmpp::Private; /// storage interface must be added. /// That implementation has to be adapted to your storage such as a database. /// In case you only need memory and no peristent storage, you can use the -/// existing implementation: +/// existing implementation and add the storage with it: /// ///\code -/// QXmppTrustStorage *trustStorage = new QXmppTrustMemoryStorage; -/// \endcode -/// -/// You can set a security policy used by ATM via the trust manager. -/// Is is recommended to apply TOAKAFA for good security and usability when -/// using \xep{0384, OMEMO Encryption}: -/// \code -/// trustStorage->setSecurityPolicy("urn:xmpp:omemo:2", QXmppTrustStorage::Toakafa); -/// \endcode -/// -/// Afterwards, this manager must be added with the storage: -/// \code +/// QXmppAtmTrustStorage *trustStorage = new QXmppAtmTrustMemoryStorage; /// QXmppAtmManager *manager = new QXmppAtmManager(trustStorage); /// client->addExtension(manager); /// \endcode @@ -73,7 +60,7 @@ using namespace QXmpp::Private; /// /// \param trustStorage trust storage implementation /// -QXmppAtmManager::QXmppAtmManager(QXmppTrustStorage *trustStorage) +QXmppAtmManager::QXmppAtmManager(QXmppAtmTrustStorage *trustStorage) { m_trustStorage = trustStorage; } -- cgit v1.2.3