From e4970a79535dd5cfff2d010049cf39b644a87850 Mon Sep 17 00:00:00 2001 From: Melvin Keskin Date: Thu, 7 Oct 2021 16:35:50 +0200 Subject: Update to OMEMO 0.8, TM 0.6 and ATM 0.4 * OMEMO has namespace 'urn:xmpp:omemo:2' and uses SCE 0.4 now * TM has namespace 'urn:xmpp:tm:1' and uses Base64 for key identifiers * ATM uses Base64 for key identifiers --- src/client/QXmppAtmManager.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/client/QXmppAtmManager.cpp') diff --git a/src/client/QXmppAtmManager.cpp b/src/client/QXmppAtmManager.cpp index 04e9ff2a..e0255a9e 100644 --- a/src/client/QXmppAtmManager.cpp +++ b/src/client/QXmppAtmManager.cpp @@ -56,7 +56,7 @@ using namespace QXmpp::Private; /// Is is recommended to apply TOAKAFA for good security and usability when /// using \xep{0384, OMEMO Encryption}: /// \code -/// trustStorage->setSecurityPolicy("urn:xmpp:omemo:1", QXmppTrustStorage::Toakafa); +/// trustStorage->setSecurityPolicy("urn:xmpp:omemo:2", QXmppTrustStorage::Toakafa); /// \endcode /// /// Afterwards, this manager must be added with the storage: @@ -107,12 +107,12 @@ QXmppAtmManager::QXmppAtmManager(QXmppTrustStorage *trustStorage) /// \param keyIdsForAuthentication IDs of the keys being authenticated /// \param keyIdsForDistrusting IDs of the keys being distrusted /// -QFuture QXmppAtmManager::makeTrustDecisions(const QString &encryption, const QString &keyOwnerJid, const QList &keyIdsForAuthentication, const QList &keyIdsForDistrusting) +QFuture QXmppAtmManager::makeTrustDecisions(const QString &encryption, const QString &keyOwnerJid, const QList &keyIdsForAuthentication, const QList &keyIdsForDistrusting) { auto interface = std::make_shared>(QFutureInterfaceBase::Started); auto future = m_trustStorage->keys(encryption, QXmppTrustStorage::Authenticated | QXmppTrustStorage::ManuallyDistrusted); - await(future, this, [=](const QHash> &&keys) { + await(future, this, [=](const QHash> &&keys) { const auto authenticatedKeys = keys.value(QXmppTrustStorage::Authenticated); const auto manuallyDistrustedKeys = keys.value(QXmppTrustStorage::ManuallyDistrusted); const auto ownJid = client()->configuration().jidBare(); @@ -123,8 +123,8 @@ QFuture QXmppAtmManager::makeTrustDecisions(const QString &encryption, con QXmppTrustMessageKeyOwner keyOwner; keyOwner.setJid(keyOwnerJid); - QList modifiedAuthenticatedKeys; - QList modifiedManuallyDistrustedKeys; + QList modifiedAuthenticatedKeys; + QList modifiedManuallyDistrustedKeys; for (const auto &keyId : keyIdsForAuthentication) { if (!authenticatedKeys.contains(keyOwnerJid, keyId)) { @@ -145,8 +145,8 @@ QFuture QXmppAtmManager::makeTrustDecisions(const QString &encryption, con keyOwner.setTrustedKeys(modifiedAuthenticatedKeys); keyOwner.setDistrustedKeys(modifiedManuallyDistrustedKeys); - QMultiHash keysBeingAuthenticated; - QMultiHash keysBeingDistrusted; + QMultiHash keysBeingAuthenticated; + QMultiHash keysBeingDistrusted; for (const auto &key : std::as_const(modifiedAuthenticatedKeys)) { keysBeingAuthenticated.insert(keyOwnerJid, key); @@ -299,7 +299,7 @@ void QXmppAtmManager::handleMessageReceived(const QXmppMessage &message) /// \param keyIdsForDistrusting key owners' bare JIDs mapped to the IDs of their /// keys being distrusted /// -QFuture QXmppAtmManager::makeTrustDecisions(const QString &encryption, const QMultiHash &keyIdsForAuthentication, const QMultiHash &keyIdsForDistrusting) +QFuture QXmppAtmManager::makeTrustDecisions(const QString &encryption, const QMultiHash &keyIdsForAuthentication, const QMultiHash &keyIdsForDistrusting) { auto interface = std::make_shared>(QFutureInterfaceBase::Started); @@ -334,8 +334,8 @@ QFuture QXmppAtmManager::handleMessage(const QXmppMessage &message) const auto isSenderKeyAuthenticated = senderKeyTrustLevel == QXmppTrustStorage::Authenticated; // key owner JIDs mapped to key IDs - QMultiHash keysBeingAuthenticated; - QMultiHash keysBeingDistrusted; + QMultiHash keysBeingAuthenticated; + QMultiHash keysBeingDistrusted; QList keyOwnersForPostponedTrustDecisions; @@ -400,7 +400,7 @@ QFuture QXmppAtmManager::handleMessage(const QXmppMessage &message) /// \param encryption encryption protocol namespace /// \param keyIds key owners' bare JIDs mapped to the IDs of their keys /// -QFuture QXmppAtmManager::authenticate(const QString &encryption, const QMultiHash &keyIds) +QFuture QXmppAtmManager::authenticate(const QString &encryption, const QMultiHash &keyIds) { auto interface = std::make_shared>(QFutureInterfaceBase::Started); @@ -435,7 +435,7 @@ QFuture QXmppAtmManager::authenticate(const QString &encryption, const QMu /// \param encryption encryption protocol namespace /// \param keyIds key owners' bare JIDs mapped to the IDs of their keys /// -QFuture QXmppAtmManager::distrust(const QString &encryption, const QMultiHash &keyIds) +QFuture QXmppAtmManager::distrust(const QString &encryption, const QMultiHash &keyIds) { auto interface = std::make_shared>(QFutureInterfaceBase::Started); @@ -476,12 +476,12 @@ QFuture QXmppAtmManager::distrustAutomaticallyTrustedKeys(const QString &e /// \param encryption encryption protocol namespace /// \param senderKeyIds IDs of the keys that were used by the senders /// -QFuture QXmppAtmManager::makePostponedTrustDecisions(const QString &encryption, const QList &senderKeyIds) +QFuture QXmppAtmManager::makePostponedTrustDecisions(const QString &encryption, const QList &senderKeyIds) { auto interface = std::make_shared>(QFutureInterfaceBase::Started); auto future = m_trustStorage->keysForPostponedTrustDecisions(encryption, senderKeyIds); - await(future, this, [=](const QHash> &&keysForPostponedTrustDecisions) { + await(future, this, [=](const QHash> &&keysForPostponedTrustDecisions) { // JIDs of key owners mapped to the IDs of their keys const auto keysBeingAuthenticated = keysForPostponedTrustDecisions.value(true); const auto keysBeingDistrusted = keysForPostponedTrustDecisions.value(false); -- cgit v1.2.3