diff options
| author | Melvin Keskin <melvo@olomono.de> | 2021-10-07 16:35:50 +0200 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2021-10-10 20:12:46 +0200 |
| commit | e4970a79535dd5cfff2d010049cf39b644a87850 (patch) | |
| tree | f274962b1063012ce0482e9e7328070bec69fba0 /tests/qxmpptrustmemorystorage/tst_qxmpptrustmemorystorage.cpp | |
| parent | e1836d08b2f659d2ac5c98280e08d96c8df60d88 (diff) | |
| download | qxmpp-e4970a79535dd5cfff2d010049cf39b644a87850.tar.gz | |
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
Diffstat (limited to 'tests/qxmpptrustmemorystorage/tst_qxmpptrustmemorystorage.cpp')
| -rw-r--r-- | tests/qxmpptrustmemorystorage/tst_qxmpptrustmemorystorage.cpp | 194 |
1 files changed, 97 insertions, 97 deletions
diff --git a/tests/qxmpptrustmemorystorage/tst_qxmpptrustmemorystorage.cpp b/tests/qxmpptrustmemorystorage/tst_qxmpptrustmemorystorage.cpp index 9d803752..7eeafbe0 100644 --- a/tests/qxmpptrustmemorystorage/tst_qxmpptrustmemorystorage.cpp +++ b/tests/qxmpptrustmemorystorage/tst_qxmpptrustmemorystorage.cpp @@ -80,20 +80,20 @@ void tst_QXmppTrustMemoryStorage::testSecurityPolicies() void tst_QXmppTrustMemoryStorage::testOwnKeys() { - m_trustStorage.addOwnKey(ns_ox, QStringLiteral("6850019d7ed0feb6d3823072498ceb4f616c6025586f8f666dc6b9c81ef7e0a4")); - m_trustStorage.addOwnKey(ns_omemo, QStringLiteral("221a4f8e228b72182b006e5ca527d3bddccf8d9e6feaf4ce96e1c451e8648020")); + m_trustStorage.addOwnKey(ns_ox, QByteArray::fromBase64(QByteArrayLiteral("aFABnX7Q/rbTgjBySYzrT2FsYCVYb49mbca5yB734KQ="))); + m_trustStorage.addOwnKey(ns_omemo, QByteArray::fromBase64(QByteArrayLiteral("IhpPjiKLchgrAG5cpSfTvdzPjZ5v6vTOluHEUehkgCA="))); // own OX key auto future = m_trustStorage.ownKey(ns_ox); QVERIFY(future.isFinished()); auto result = future.result(); - QCOMPARE(result, QStringLiteral("6850019d7ed0feb6d3823072498ceb4f616c6025586f8f666dc6b9c81ef7e0a4")); + QCOMPARE(result, QByteArray::fromBase64(QByteArrayLiteral("aFABnX7Q/rbTgjBySYzrT2FsYCVYb49mbca5yB734KQ="))); // own OMEMO key future = m_trustStorage.ownKey(ns_omemo); QVERIFY(future.isFinished()); result = future.result(); - QCOMPARE(result, QStringLiteral("221a4f8e228b72182b006e5ca527d3bddccf8d9e6feaf4ce96e1c451e8648020")); + QCOMPARE(result, QByteArray::fromBase64(QByteArrayLiteral("IhpPjiKLchgrAG5cpSfTvdzPjZ5v6vTOluHEUehkgCA="))); m_trustStorage.removeOwnKey(ns_omemo); @@ -110,63 +110,63 @@ void tst_QXmppTrustMemoryStorage::testKeys() m_trustStorage.addKeys( ns_omemo, QStringLiteral("alice@example.org"), - { QStringLiteral("59a027a56c96d619c5a281f7a09a3d05ae5762892c9cb3de2514c08f13dbbf7f"), - QStringLiteral("ff578add1d8bb633c14f77a5f1fd2ae03bf3a942527c5cb97e42a428f345358c") }); + { QByteArray::fromBase64(QByteArrayLiteral("WaAnpWyW1hnFooH3oJo9Ba5XYoksnLPeJRTAjxPbv38=")), + QByteArray::fromBase64(QByteArrayLiteral("/1eK3R2LtjPBT3el8f0q4DvzqUJSfFy5fkKkKPNFNYw=")) }); m_trustStorage.addKeys( ns_omemo, QStringLiteral("alice@example.org"), - { QStringLiteral("6850019d7ed0feb6d3823072498ceb4f616c6025586f8f666dc6b9c81ef7e0a4") }, + { QByteArray::fromBase64(QByteArrayLiteral("aFABnX7Q/rbTgjBySYzrT2FsYCVYb49mbca5yB734KQ=")) }, QXmppTrustStorage::ManuallyDistrusted); m_trustStorage.addKeys( ns_omemo, QStringLiteral("alice@example.org"), - { QStringLiteral("0a27a6a7864dcd12719d10fe936f2f0227b491726bc25e08adb7c3cbb9fa3b11") }, + { QByteArray::fromBase64(QByteArrayLiteral("Ciemp4ZNzRJxnRD+k28vAie0kXJrwl4IrbfDy7n6OxE=")) }, QXmppTrustStorage::AutomaticallyTrusted); m_trustStorage.addKeys( ns_omemo, QStringLiteral("bob@example.com"), - { QStringLiteral("aef49705177e10808c850bd581c444409c713fe4f810199a8b89981c17c94068") }, + { QByteArray::fromBase64(QByteArrayLiteral("rvSXBRd+EICMhQvVgcREQJxxP+T4EBmai4mYHBfJQGg=")) }, QXmppTrustStorage::AutomaticallyTrusted); m_trustStorage.addKeys( ns_omemo, QStringLiteral("bob@example.com"), - { QStringLiteral("b423f5088de9a924d51b31581723d850c7cc67d0a4fe6b267c3d301ff56d2413"), - QStringLiteral("d9f849b6b828309c5f2c8df4f38fd891887da5aaa24a22c50d52f69b4a80817e") }, + { QByteArray::fromBase64(QByteArrayLiteral("tCP1CI3pqSTVGzFYFyPYUMfMZ9Ck/msmfD0wH/VtJBM=")), + QByteArray::fromBase64(QByteArrayLiteral("2fhJtrgoMJxfLI3084/YkYh9paqiSiLFDVL2m0qAgX4=")) }, QXmppTrustStorage::ManuallyTrusted); m_trustStorage.addKeys( ns_omemo, QStringLiteral("bob@example.com"), - { QStringLiteral("623548d3835c6d33ef5cb680f7944ef381cf712bf23a0119dabe5c4f252cd02f") }, + { QByteArray::fromBase64(QByteArrayLiteral("YjVI04NcbTPvXLaA95RO84HPcSvyOgEZ2r5cTyUs0C8=")) }, QXmppTrustStorage::Authenticated); m_trustStorage.addKeys( ns_ox, QStringLiteral("alice@example.org"), - { QStringLiteral("6850019d7ed0feb6d3823072498ceb4f616c6025586f8f666dc6b9c81ef7e0a4"), - QStringLiteral("221a4f8e228b72182b006e5ca527d3bddccf8d9e6feaf4ce96e1c451e8648020") }, + { QByteArray::fromBase64(QByteArrayLiteral("aFABnX7Q/rbTgjBySYzrT2FsYCVYb49mbca5yB734KQ=")), + QByteArray::fromBase64(QByteArrayLiteral("IhpPjiKLchgrAG5cpSfTvdzPjZ5v6vTOluHEUehkgCA=")) }, QXmppTrustStorage::Authenticated); - QMultiHash<QString, QString> automaticallyDistrustedKeys = { { QStringLiteral("alice@example.org"), - QStringLiteral("59a027a56c96d619c5a281f7a09a3d05ae5762892c9cb3de2514c08f13dbbf7f") }, - { QStringLiteral("alice@example.org"), - QStringLiteral("ff578add1d8bb633c14f77a5f1fd2ae03bf3a942527c5cb97e42a428f345358c") } }; - QMultiHash<QString, QString> manuallyDistrustedKeys = { { QStringLiteral("alice@example.org"), - QStringLiteral("6850019d7ed0feb6d3823072498ceb4f616c6025586f8f666dc6b9c81ef7e0a4") } }; - QMultiHash<QString, QString> automaticallyTrustedKeys = { { QStringLiteral("alice@example.org"), - QStringLiteral("0a27a6a7864dcd12719d10fe936f2f0227b491726bc25e08adb7c3cbb9fa3b11") }, - { QStringLiteral("bob@example.com"), - QStringLiteral("aef49705177e10808c850bd581c444409c713fe4f810199a8b89981c17c94068") } }; - QMultiHash<QString, QString> manuallyTrustedKeys = { { QStringLiteral("bob@example.com"), - QStringLiteral("b423f5088de9a924d51b31581723d850c7cc67d0a4fe6b267c3d301ff56d2413") }, - { QStringLiteral("bob@example.com"), - QStringLiteral("d9f849b6b828309c5f2c8df4f38fd891887da5aaa24a22c50d52f69b4a80817e") } }; - QMultiHash<QString, QString> authenticatedKeys = { { QStringLiteral("bob@example.com"), - QStringLiteral("623548d3835c6d33ef5cb680f7944ef381cf712bf23a0119dabe5c4f252cd02f") } }; + QMultiHash<QString, QByteArray> automaticallyDistrustedKeys = { { QStringLiteral("alice@example.org"), + QByteArray::fromBase64(QByteArrayLiteral("WaAnpWyW1hnFooH3oJo9Ba5XYoksnLPeJRTAjxPbv38=")) }, + { QStringLiteral("alice@example.org"), + QByteArray::fromBase64(QByteArrayLiteral("/1eK3R2LtjPBT3el8f0q4DvzqUJSfFy5fkKkKPNFNYw=")) } }; + QMultiHash<QString, QByteArray> manuallyDistrustedKeys = { { QStringLiteral("alice@example.org"), + QByteArray::fromBase64(QByteArrayLiteral("aFABnX7Q/rbTgjBySYzrT2FsYCVYb49mbca5yB734KQ=")) } }; + QMultiHash<QString, QByteArray> automaticallyTrustedKeys = { { QStringLiteral("alice@example.org"), + QByteArray::fromBase64(QByteArrayLiteral("Ciemp4ZNzRJxnRD+k28vAie0kXJrwl4IrbfDy7n6OxE=")) }, + { QStringLiteral("bob@example.com"), + QByteArray::fromBase64(QByteArrayLiteral("rvSXBRd+EICMhQvVgcREQJxxP+T4EBmai4mYHBfJQGg=")) } }; + QMultiHash<QString, QByteArray> manuallyTrustedKeys = { { QStringLiteral("bob@example.com"), + QByteArray::fromBase64(QByteArrayLiteral("tCP1CI3pqSTVGzFYFyPYUMfMZ9Ck/msmfD0wH/VtJBM=")) }, + { QStringLiteral("bob@example.com"), + QByteArray::fromBase64(QByteArrayLiteral("2fhJtrgoMJxfLI3084/YkYh9paqiSiLFDVL2m0qAgX4=")) } }; + QMultiHash<QString, QByteArray> authenticatedKeys = { { QStringLiteral("bob@example.com"), + QByteArray::fromBase64(QByteArrayLiteral("YjVI04NcbTPvXLaA95RO84HPcSvyOgEZ2r5cTyUs0C8=")) } }; // all OMEMO keys auto future = m_trustStorage.keys(ns_omemo); @@ -204,13 +204,13 @@ void tst_QXmppTrustMemoryStorage::testKeys() authenticatedKeys) })); m_trustStorage.removeKeys(ns_omemo, - { QStringLiteral("59a027a56c96d619c5a281f7a09a3d05ae5762892c9cb3de2514c08f13dbbf7f"), - QStringLiteral("0a27a6a7864dcd12719d10fe936f2f0227b491726bc25e08adb7c3cbb9fa3b11") }); + { QByteArray::fromBase64(QByteArrayLiteral("WaAnpWyW1hnFooH3oJo9Ba5XYoksnLPeJRTAjxPbv38=")), + QByteArray::fromBase64(QByteArrayLiteral("Ciemp4ZNzRJxnRD+k28vAie0kXJrwl4IrbfDy7n6OxE=")) }); automaticallyDistrustedKeys = { { QStringLiteral("alice@example.org"), - QStringLiteral("ff578add1d8bb633c14f77a5f1fd2ae03bf3a942527c5cb97e42a428f345358c") } }; + QByteArray::fromBase64(QByteArrayLiteral("/1eK3R2LtjPBT3el8f0q4DvzqUJSfFy5fkKkKPNFNYw=")) } }; automaticallyTrustedKeys = { { QStringLiteral("bob@example.com"), - QStringLiteral("aef49705177e10808c850bd581c444409c713fe4f810199a8b89981c17c94068") } }; + QByteArray::fromBase64(QByteArrayLiteral("rvSXBRd+EICMhQvVgcREQJxxP+T4EBmai4mYHBfJQGg=")) } }; // all OMEMO keys after removal future = m_trustStorage.keys(ns_omemo); @@ -243,9 +243,9 @@ void tst_QXmppTrustMemoryStorage::testKeys() QVERIFY(result.isEmpty()); authenticatedKeys = { { QStringLiteral("alice@example.org"), - QStringLiteral("6850019d7ed0feb6d3823072498ceb4f616c6025586f8f666dc6b9c81ef7e0a4") }, + QByteArray::fromBase64(QByteArrayLiteral("aFABnX7Q/rbTgjBySYzrT2FsYCVYb49mbca5yB734KQ=")) }, { QStringLiteral("alice@example.org"), - QStringLiteral("221a4f8e228b72182b006e5ca527d3bddccf8d9e6feaf4ce96e1c451e8648020") } }; + QByteArray::fromBase64(QByteArrayLiteral("IhpPjiKLchgrAG5cpSfTvdzPjZ5v6vTOluHEUehkgCA=")) } }; // remaining OX keys future = m_trustStorage.keys(ns_ox); @@ -271,31 +271,31 @@ void tst_QXmppTrustMemoryStorage::testTrustLevels() m_trustStorage.addKeys( ns_ox, QStringLiteral("alice@example.org"), - { QStringLiteral("019fdc1783ab50e20b28ed604017fada941ebce8412763721e75cbc0ce050d95") }, + { QByteArray::fromBase64(QByteArrayLiteral("AZ/cF4OrUOILKO1gQBf62pQevOhBJ2NyHnXLwM4FDZU=")) }, QXmppTrustStorage::AutomaticallyTrusted); m_trustStorage.addKeys( ns_omemo, QStringLiteral("alice@example.org"), - { QStringLiteral("019fdc1783ab50e20b28ed604017fada941ebce8412763721e75cbc0ce050d95"), - QStringLiteral("254e294fb22fa6282d97eed013cec192ae2bfc2fe6848d450a36395a68dbb708") }, + { QByteArray::fromBase64(QByteArrayLiteral("AZ/cF4OrUOILKO1gQBf62pQevOhBJ2NyHnXLwM4FDZU=")), + QByteArray::fromBase64(QByteArrayLiteral("JU4pT7Ivpigtl+7QE87Bkq4r/C/mhI1FCjY5Wmjbtwg=")) }, QXmppTrustStorage::AutomaticallyTrusted); m_trustStorage.addKeys( ns_omemo, QStringLiteral("alice@example.org"), - { QStringLiteral("6850019d7ed0feb6d3823072498ceb4f616c6025586f8f666dc6b9c81ef7e0a4") }, + { QByteArray::fromBase64(QByteArrayLiteral("aFABnX7Q/rbTgjBySYzrT2FsYCVYb49mbca5yB734KQ=")) }, QXmppTrustStorage::ManuallyTrusted); m_trustStorage.addKeys( ns_omemo, QStringLiteral("bob@example.com"), - { QStringLiteral("f44e75946def566527f0233bfc021c98894b3f61cf97a028d3f5527f8553fe80") }, + { QByteArray::fromBase64(QByteArrayLiteral("9E51lG3vVmUn8CM7/AIcmIlLP2HPl6Ao0/VSf4VT/oA=")) }, QXmppTrustStorage::AutomaticallyTrusted); auto future = m_trustStorage.trustLevel( ns_omemo, - QStringLiteral("019fdc1783ab50e20b28ed604017fada941ebce8412763721e75cbc0ce050d95")); + QByteArray::fromBase64(QByteArrayLiteral("AZ/cF4OrUOILKO1gQBf62pQevOhBJ2NyHnXLwM4FDZU="))); QVERIFY(future.isFinished()); auto result = future.result(); QCOMPARE(result, QXmppTrustStorage::AutomaticallyTrusted); @@ -303,21 +303,21 @@ void tst_QXmppTrustMemoryStorage::testTrustLevels() m_trustStorage.setTrustLevel( ns_omemo, { { QStringLiteral("alice@example.org"), - QStringLiteral("019fdc1783ab50e20b28ed604017fada941ebce8412763721e75cbc0ce050d95") }, + QByteArray::fromBase64(QByteArrayLiteral("AZ/cF4OrUOILKO1gQBf62pQevOhBJ2NyHnXLwM4FDZU=")) }, { QStringLiteral("bob@example.com"), - QStringLiteral("f44e75946def566527f0233bfc021c98894b3f61cf97a028d3f5527f8553fe80") } }, + QByteArray::fromBase64(QByteArrayLiteral("9E51lG3vVmUn8CM7/AIcmIlLP2HPl6Ao0/VSf4VT/oA=")) } }, QXmppTrustStorage::Authenticated); future = m_trustStorage.trustLevel( ns_omemo, - QStringLiteral("019fdc1783ab50e20b28ed604017fada941ebce8412763721e75cbc0ce050d95")); + QByteArray::fromBase64(QByteArrayLiteral("AZ/cF4OrUOILKO1gQBf62pQevOhBJ2NyHnXLwM4FDZU="))); QVERIFY(future.isFinished()); result = future.result(); QCOMPARE(result, QXmppTrustStorage::Authenticated); future = m_trustStorage.trustLevel( ns_omemo, - QStringLiteral("f44e75946def566527f0233bfc021c98894b3f61cf97a028d3f5527f8553fe80")); + QByteArray::fromBase64(QByteArrayLiteral("9E51lG3vVmUn8CM7/AIcmIlLP2HPl6Ao0/VSf4VT/oA="))); QVERIFY(future.isFinished()); result = future.result(); QCOMPARE(result, QXmppTrustStorage::Authenticated); @@ -327,12 +327,12 @@ void tst_QXmppTrustMemoryStorage::testTrustLevels() m_trustStorage.setTrustLevel( ns_omemo, { { QStringLiteral("alice@example.org"), - QStringLiteral("f70ea83e32b219200b77d807abbb0d39d380903e5b1d454e28008db3cf458e40") } }, + QByteArray::fromBase64(QByteArrayLiteral("9w6oPjKyGSALd9gHq7sNOdOAkD5bHUVOKACNs89FjkA=")) } }, QXmppTrustStorage::ManuallyTrusted); future = m_trustStorage.trustLevel( ns_omemo, - QStringLiteral("f70ea83e32b219200b77d807abbb0d39d380903e5b1d454e28008db3cf458e40")); + QByteArray::fromBase64(QByteArrayLiteral("9w6oPjKyGSALd9gHq7sNOdOAkD5bHUVOKACNs89FjkA="))); QVERIFY(future.isFinished()); result = future.result(); QCOMPARE(result, QXmppTrustStorage::ManuallyTrusted); @@ -341,7 +341,7 @@ void tst_QXmppTrustMemoryStorage::testTrustLevels() // The default value is returned. future = m_trustStorage.trustLevel( ns_omemo, - QStringLiteral("5972f81037f35066d53d05a34fda6605e882a42073619bf795401a8fe51b3f21")); + QByteArray::fromBase64(QByteArrayLiteral("WXL4EDfzUGbVPQWjT9pmBeiCpCBzYZv3lUAaj+UbPyE="))); QVERIFY(future.isFinished()); result = future.result(); QCOMPARE(result, QXmppTrustStorage::AutomaticallyDistrusted); @@ -357,14 +357,14 @@ void tst_QXmppTrustMemoryStorage::testTrustLevels() future = m_trustStorage.trustLevel( ns_omemo, - QStringLiteral("019fdc1783ab50e20b28ed604017fada941ebce8412763721e75cbc0ce050d95")); + QByteArray::fromBase64(QByteArrayLiteral("AZ/cF4OrUOILKO1gQBf62pQevOhBJ2NyHnXLwM4FDZU="))); QVERIFY(future.isFinished()); result = future.result(); QCOMPARE(result, QXmppTrustStorage::ManuallyDistrusted); future = m_trustStorage.trustLevel( ns_omemo, - QStringLiteral("f44e75946def566527f0233bfc021c98894b3f61cf97a028d3f5527f8553fe80")); + QByteArray::fromBase64(QByteArrayLiteral("9E51lG3vVmUn8CM7/AIcmIlLP2HPl6Ao0/VSf4VT/oA="))); QVERIFY(future.isFinished()); result = future.result(); QCOMPARE(result, QXmppTrustStorage::ManuallyDistrusted); @@ -372,7 +372,7 @@ void tst_QXmppTrustMemoryStorage::testTrustLevels() // Verify that the default trust level is returned for an unknown key. future = m_trustStorage.trustLevel( ns_omemo, - QStringLiteral("c04d3a1b07fc7f80ef0cb143a1a0ac1acf226dc5237fce1620e0361408cf237a")); + QByteArray::fromBase64(QByteArrayLiteral("wE06Gwf8f4DvDLFDoaCsGs8ibcUjf84WIOA2FAjPI3o="))); QVERIFY(future.isFinished()); result = future.result(); QCOMPARE(result, QXmppTrustStorage::AutomaticallyDistrusted); @@ -384,56 +384,56 @@ void tst_QXmppTrustMemoryStorage::testKeysForPostponedTrustDecisions() { QXmppTrustMessageKeyOwner keyOwnerAlice; keyOwnerAlice.setJid(QStringLiteral("alice@example.org")); - keyOwnerAlice.setTrustedKeys({ QStringLiteral("5a5e7765c85bb40b4265008744e883db45bb527293420590ae34c7015370d627"), - QStringLiteral("411d398eb69becf16448b86d773c97acf7c2aa190d0980ab9560136813137a71"), - QStringLiteral("ef2d6dd0b9e63417972646b8dd77a314f2eb2ad425485013ad89b2ef11da2985") }); - keyOwnerAlice.setDistrustedKeys({ QStringLiteral("981f7c861755a6cfbeb2452ecb84c6cbf569e914172c93b82467fce850148f27"), - QStringLiteral("ef2d6dd0b9e63417972646b8dd77a314f2eb2ad425485013ad89b2ef11da2985") }); + keyOwnerAlice.setTrustedKeys({ QByteArray::fromBase64(QByteArrayLiteral("Wl53ZchbtAtCZQCHROiD20W7UnKTQgWQrjTHAVNw1ic=")), + QByteArray::fromBase64(QByteArrayLiteral("QR05jrab7PFkSLhtdzyXrPfCqhkNCYCrlWATaBMTenE=")), + QByteArray::fromBase64(QByteArrayLiteral("7y1t0LnmNBeXJka43XejFPLrKtQlSFATrYmy7xHaKYU=")) }); + keyOwnerAlice.setDistrustedKeys({ QByteArray::fromBase64(QByteArrayLiteral("mB98hhdVps++skUuy4TGy/Vp6RQXLJO4JGf86FAUjyc=")), + QByteArray::fromBase64(QByteArrayLiteral("7y1t0LnmNBeXJka43XejFPLrKtQlSFATrYmy7xHaKYU=")) }); QXmppTrustMessageKeyOwner keyOwnerBobTrustedKeys; keyOwnerBobTrustedKeys.setJid(QStringLiteral("bob@example.com")); - keyOwnerBobTrustedKeys.setTrustedKeys({ QStringLiteral("1a04ea7912e9d4cf8c11e9f3150ca6da8a9eafd3df1ee912e1bac90d09790111") }); + keyOwnerBobTrustedKeys.setTrustedKeys({ QByteArray::fromBase64(QByteArrayLiteral("GgTqeRLp1M+MEenzFQym2oqer9PfHukS4brJDQl5ARE=")) }); - // The key ef2d6dd0b9e63417972646b8dd77a314f2eb2ad425485013ad89b2ef11da2985 + // The key 7y1t0LnmNBeXJka43XejFPLrKtQlSFATrYmy7xHaKYU= // is passed for both postponed authentication and distrusting. // Thus, it is only stored for postponed distrusting. m_trustStorage.addKeysForPostponedTrustDecisions(ns_omemo, - QStringLiteral("329e98e30385dda31c977f256ff54d6dd3c5f6e70616a4b1d9ec9a12cab21ca1"), + QByteArray::fromBase64(QByteArrayLiteral("Mp6Y4wOF3aMcl38lb/VNbdPF9ucGFqSx2eyaEsqyHKE=")), { keyOwnerAlice, keyOwnerBobTrustedKeys }); QXmppTrustMessageKeyOwner keyOwnerBobDistrustedKeys; keyOwnerBobDistrustedKeys.setJid(QStringLiteral("bob@example.com")); - keyOwnerBobDistrustedKeys.setDistrustedKeys({ QStringLiteral("b03ea296e80405e2b13ec7431325f8dcb48628729677930511d853fb8469b310"), - QStringLiteral("5f9b49d43e6b11e69e404f1eaa104a023e0a5191987b7c7e88789f693058d643") }); + keyOwnerBobDistrustedKeys.setDistrustedKeys({ QByteArray::fromBase64(QByteArrayLiteral("sD6ilugEBeKxPsdDEyX43LSGKHKWd5MFEdhT+4RpsxA=")), + QByteArray::fromBase64(QByteArrayLiteral("X5tJ1D5rEeaeQE8eqhBKAj4KUZGYe3x+iHifaTBY1kM=")) }); m_trustStorage.addKeysForPostponedTrustDecisions(ns_omemo, - QStringLiteral("20be62c03430aae1fbca36f94408883fe9ef622054b0d097b4a07c22929cf505"), + QByteArray::fromBase64(QByteArrayLiteral("IL5iwDQwquH7yjb5RAiIP+nvYiBUsNCXtKB8IpKc9QU=")), { keyOwnerBobDistrustedKeys }); QXmppTrustMessageKeyOwner keyOwnerCarol; keyOwnerCarol.setJid(QStringLiteral("carol@example.net")); - keyOwnerCarol.setTrustedKeys({ QStringLiteral("59c2fe70432911e2be769aa0dd77776a672dcf03fc87632ac17704cc57fa2e95"), - QStringLiteral("6c7dd1df5cf437decad5f5301b7f9b741ad53ee0df5e0b906a91ee7647dae671") }); - keyOwnerCarol.setDistrustedKeys({ QStringLiteral("3740764ad1ca935fec970835af3c9b4c5ce3760ec50a173eddc5e64d4feb4bc8"), - QStringLiteral("c2c10ddf65070a236362a4c6fc9eb7858e0dbbcb594f8d8d8b5171ae0c914398") }); + keyOwnerCarol.setTrustedKeys({ QByteArray::fromBase64(QByteArrayLiteral("WcL+cEMpEeK+dpqg3Xd3amctzwP8h2MqwXcEzFf6LpU=")), + QByteArray::fromBase64(QByteArrayLiteral("bH3R31z0N97K1fUwG3+bdBrVPuDfXguQapHudkfa5nE=")) }); + keyOwnerCarol.setDistrustedKeys({ QByteArray::fromBase64(QByteArrayLiteral("N0B2StHKk1/slwg1rzybTFzjdg7FChc+3cXmTU/rS8g=")), + QByteArray::fromBase64(QByteArrayLiteral("wsEN32UHCiNjYqTG/J63hY4Nu8tZT42Ni1FxrgyRQ5g=")) }); m_trustStorage.addKeysForPostponedTrustDecisions(ns_ox, - QStringLiteral("20be62c03430aae1fbca36f94408883fe9ef622054b0d097b4a07c22929cf505"), + QByteArray::fromBase64(QByteArrayLiteral("IL5iwDQwquH7yjb5RAiIP+nvYiBUsNCXtKB8IpKc9QU=")), { keyOwnerCarol }); - QMultiHash<QString, QString> trustedKeys = { { QStringLiteral("alice@example.org"), - QStringLiteral("5a5e7765c85bb40b4265008744e883db45bb527293420590ae34c7015370d627") }, - { QStringLiteral("alice@example.org"), - QStringLiteral("411d398eb69becf16448b86d773c97acf7c2aa190d0980ab9560136813137a71") }, - { QStringLiteral("bob@example.com"), - QStringLiteral("1a04ea7912e9d4cf8c11e9f3150ca6da8a9eafd3df1ee912e1bac90d09790111") } }; - QMultiHash<QString, QString> distrustedKeys = { { QStringLiteral("alice@example.org"), - QStringLiteral("981f7c861755a6cfbeb2452ecb84c6cbf569e914172c93b82467fce850148f27") }, + QMultiHash<QString, QByteArray> trustedKeys = { { QStringLiteral("alice@example.org"), + QByteArray::fromBase64(QByteArrayLiteral("Wl53ZchbtAtCZQCHROiD20W7UnKTQgWQrjTHAVNw1ic=")) }, { QStringLiteral("alice@example.org"), - QStringLiteral("ef2d6dd0b9e63417972646b8dd77a314f2eb2ad425485013ad89b2ef11da2985") } }; + QByteArray::fromBase64(QByteArrayLiteral("QR05jrab7PFkSLhtdzyXrPfCqhkNCYCrlWATaBMTenE=")) }, + { QStringLiteral("bob@example.com"), + QByteArray::fromBase64(QByteArrayLiteral("GgTqeRLp1M+MEenzFQym2oqer9PfHukS4brJDQl5ARE=")) } }; + QMultiHash<QString, QByteArray> distrustedKeys = { { QStringLiteral("alice@example.org"), + QByteArray::fromBase64(QByteArrayLiteral("mB98hhdVps++skUuy4TGy/Vp6RQXLJO4JGf86FAUjyc=")) }, + { QStringLiteral("alice@example.org"), + QByteArray::fromBase64(QByteArrayLiteral("7y1t0LnmNBeXJka43XejFPLrKtQlSFATrYmy7xHaKYU=")) } }; auto future = m_trustStorage.keysForPostponedTrustDecisions(ns_omemo, - { QStringLiteral("329e98e30385dda31c977f256ff54d6dd3c5f6e70616a4b1d9ec9a12cab21ca1") }); + { QByteArray::fromBase64(QByteArrayLiteral("Mp6Y4wOF3aMcl38lb/VNbdPF9ucGFqSx2eyaEsqyHKE=")) }); QVERIFY(future.isFinished()); auto result = future.result(); QCOMPARE( @@ -446,17 +446,17 @@ void tst_QXmppTrustMemoryStorage::testKeysForPostponedTrustDecisions() distrustedKeys) })); distrustedKeys = { { QStringLiteral("alice@example.org"), - QStringLiteral("981f7c861755a6cfbeb2452ecb84c6cbf569e914172c93b82467fce850148f27") }, + QByteArray::fromBase64(QByteArrayLiteral("mB98hhdVps++skUuy4TGy/Vp6RQXLJO4JGf86FAUjyc=")) }, { QStringLiteral("alice@example.org"), - QStringLiteral("ef2d6dd0b9e63417972646b8dd77a314f2eb2ad425485013ad89b2ef11da2985") }, + QByteArray::fromBase64(QByteArrayLiteral("7y1t0LnmNBeXJka43XejFPLrKtQlSFATrYmy7xHaKYU=")) }, { QStringLiteral("bob@example.com"), - QStringLiteral("b03ea296e80405e2b13ec7431325f8dcb48628729677930511d853fb8469b310") }, + QByteArray::fromBase64(QByteArrayLiteral("sD6ilugEBeKxPsdDEyX43LSGKHKWd5MFEdhT+4RpsxA=")) }, { QStringLiteral("bob@example.com"), - QStringLiteral("5f9b49d43e6b11e69e404f1eaa104a023e0a5191987b7c7e88789f693058d643") } }; + QByteArray::fromBase64(QByteArrayLiteral("X5tJ1D5rEeaeQE8eqhBKAj4KUZGYe3x+iHifaTBY1kM=")) } }; future = m_trustStorage.keysForPostponedTrustDecisions(ns_omemo, - { QStringLiteral("329e98e30385dda31c977f256ff54d6dd3c5f6e70616a4b1d9ec9a12cab21ca1"), - QStringLiteral("20be62c03430aae1fbca36f94408883fe9ef622054b0d097b4a07c22929cf505") }); + { QByteArray::fromBase64(QByteArrayLiteral("Mp6Y4wOF3aMcl38lb/VNbdPF9ucGFqSx2eyaEsqyHKE=")), + QByteArray::fromBase64(QByteArrayLiteral("IL5iwDQwquH7yjb5RAiIP+nvYiBUsNCXtKB8IpKc9QU=")) }); QVERIFY(future.isFinished()); result = future.result(); QCOMPARE( @@ -481,24 +481,24 @@ void tst_QXmppTrustMemoryStorage::testKeysForPostponedTrustDecisions() false, distrustedKeys) })); - keyOwnerBobTrustedKeys.setTrustedKeys({ QStringLiteral("b03ea296e80405e2b13ec7431325f8dcb48628729677930511d853fb8469b310") }); + keyOwnerBobTrustedKeys.setTrustedKeys({ QByteArray::fromBase64(QByteArrayLiteral("sD6ilugEBeKxPsdDEyX43LSGKHKWd5MFEdhT+4RpsxA=")) }); // Invert the trust in Bob's key - // b03ea296e80405e2b13ec7431325f8dcb48628729677930511d853fb8469b310 for the + // sD6ilugEBeKxPsdDEyX43LSGKHKWd5MFEdhT+4RpsxA= for the // sending endpoint with the key - // 20be62c03430aae1fbca36f94408883fe9ef622054b0d097b4a07c22929cf505. + // IL5iwDQwquH7yjb5RAiIP+nvYiBUsNCXtKB8IpKc9QU=. m_trustStorage.addKeysForPostponedTrustDecisions( ns_omemo, - QStringLiteral("20be62c03430aae1fbca36f94408883fe9ef622054b0d097b4a07c22929cf505"), + QByteArray::fromBase64(QByteArrayLiteral("IL5iwDQwquH7yjb5RAiIP+nvYiBUsNCXtKB8IpKc9QU=")), { keyOwnerBobTrustedKeys }); trustedKeys = { { QStringLiteral("bob@example.com"), - QStringLiteral("b03ea296e80405e2b13ec7431325f8dcb48628729677930511d853fb8469b310") } }; + QByteArray::fromBase64(QByteArrayLiteral("sD6ilugEBeKxPsdDEyX43LSGKHKWd5MFEdhT+4RpsxA=")) } }; distrustedKeys = { { QStringLiteral("bob@example.com"), - QStringLiteral("5f9b49d43e6b11e69e404f1eaa104a023e0a5191987b7c7e88789f693058d643") } }; + QByteArray::fromBase64(QByteArrayLiteral("X5tJ1D5rEeaeQE8eqhBKAj4KUZGYe3x+iHifaTBY1kM=")) } }; future = m_trustStorage.keysForPostponedTrustDecisions(ns_omemo, - { QStringLiteral("20be62c03430aae1fbca36f94408883fe9ef622054b0d097b4a07c22929cf505") }); + { QByteArray::fromBase64(QByteArrayLiteral("IL5iwDQwquH7yjb5RAiIP+nvYiBUsNCXtKB8IpKc9QU=")) }); QVERIFY(future.isFinished()); result = future.result(); QCOMPARE( @@ -511,7 +511,7 @@ void tst_QXmppTrustMemoryStorage::testKeysForPostponedTrustDecisions() distrustedKeys) })); m_trustStorage.removeKeysForPostponedTrustDecisions(ns_omemo, - { QStringLiteral("329e98e30385dda31c977f256ff54d6dd3c5f6e70616a4b1d9ec9a12cab21ca1") }); + { QByteArray::fromBase64(QByteArrayLiteral("Mp6Y4wOF3aMcl38lb/VNbdPF9ucGFqSx2eyaEsqyHKE=")) }); future = m_trustStorage.keysForPostponedTrustDecisions(ns_omemo); QVERIFY(future.isFinished()); @@ -526,7 +526,7 @@ void tst_QXmppTrustMemoryStorage::testKeysForPostponedTrustDecisions() distrustedKeys) })); // Remove all OMEMO keys including those stored for sender key - // 20be62c03430aae1fbca36f94408883fe9ef622054b0d097b4a07c22929cf505. + // IL5iwDQwquH7yjb5RAiIP+nvYiBUsNCXtKB8IpKc9QU=. m_trustStorage.removeKeysForPostponedTrustDecisions(ns_omemo); future = m_trustStorage.keysForPostponedTrustDecisions(ns_omemo); @@ -535,13 +535,13 @@ void tst_QXmppTrustMemoryStorage::testKeysForPostponedTrustDecisions() QVERIFY(result.isEmpty()); trustedKeys = { { QStringLiteral("carol@example.net"), - QStringLiteral("59c2fe70432911e2be769aa0dd77776a672dcf03fc87632ac17704cc57fa2e95") }, + QByteArray::fromBase64(QByteArrayLiteral("WcL+cEMpEeK+dpqg3Xd3amctzwP8h2MqwXcEzFf6LpU=")) }, { QStringLiteral("carol@example.net"), - QStringLiteral("6c7dd1df5cf437decad5f5301b7f9b741ad53ee0df5e0b906a91ee7647dae671") } }; + QByteArray::fromBase64(QByteArrayLiteral("bH3R31z0N97K1fUwG3+bdBrVPuDfXguQapHudkfa5nE=")) } }; distrustedKeys = { { QStringLiteral("carol@example.net"), - QStringLiteral("3740764ad1ca935fec970835af3c9b4c5ce3760ec50a173eddc5e64d4feb4bc8") }, + QByteArray::fromBase64(QByteArrayLiteral("N0B2StHKk1/slwg1rzybTFzjdg7FChc+3cXmTU/rS8g=")) }, { QStringLiteral("carol@example.net"), - QStringLiteral("c2c10ddf65070a236362a4c6fc9eb7858e0dbbcb594f8d8d8b5171ae0c914398") } }; + QByteArray::fromBase64(QByteArrayLiteral("wsEN32UHCiNjYqTG/J63hY4Nu8tZT42Ni1FxrgyRQ5g=")) } }; // remaining OX keys future = m_trustStorage.keysForPostponedTrustDecisions(ns_ox); |
