aboutsummaryrefslogtreecommitdiff
path: root/autotests
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-01-31 21:11:23 +0100
committerTobias Fella <fella@posteo.de>2021-12-01 21:34:52 +0100
commitd9dc94a8fb59c8590c4aa7cdf773c2825e69d823 (patch)
treeaad9158dbc77608150fdee9cdcc28f508edef4e4 /autotests
parenta5e84c51e9c89021edc8aaade8c751fb6d39cb89 (diff)
downloadlibquotient-d9dc94a8fb59c8590c4aa7cdf773c2825e69d823.tar.gz
libquotient-d9dc94a8fb59c8590c4aa7cdf773c2825e69d823.zip
Fix signing keys
Diffstat (limited to 'autotests')
-rw-r--r--autotests/testolmaccount.cpp12
-rw-r--r--autotests/testolmutility.cpp2
2 files changed, 10 insertions, 4 deletions
diff --git a/autotests/testolmaccount.cpp b/autotests/testolmaccount.cpp
index 8d979e0b..4eed1980 100644
--- a/autotests/testolmaccount.cpp
+++ b/autotests/testolmaccount.cpp
@@ -309,7 +309,6 @@ void TestOlmAccount::claimKeys()
deviceKeys[bob->userId()] = QStringList();
auto job = alice->callApi<QueryKeysJob>(deviceKeys);
connect(job, &BaseJob::result, this, [bob, alice, aliceOlm, job, this] {
- qDebug() << job->jsonData();
auto bobDevices = job->deviceKeys()[bob->userId()];
QVERIFY(bobDevices.size() > 0);
@@ -337,7 +336,16 @@ void TestOlmAccount::claimKeys()
// The key is the one bob sent.
auto oneTimeKey = job->oneTimeKeys()[userId][deviceId];
- QVERIFY(oneTimeKey.canConvert<SignedOneTimeKey>());
+ QVERIFY(oneTimeKey.canConvert<QVariantMap>());
+
+ QVariantMap varMap = oneTimeKey.toMap();
+ bool found = false;
+ for (const auto key : varMap.keys()) {
+ if (key.startsWith(QStringLiteral("signed_curve25519"))) {
+ found = true;
+ }
+ }
+ QVERIFY(found);
//auto algo = oneTimeKey.begin().key();
//auto contents = oneTimeKey.begin().value();
diff --git a/autotests/testolmutility.cpp b/autotests/testolmutility.cpp
index cb92a0df..1d9978d3 100644
--- a/autotests/testolmutility.cpp
+++ b/autotests/testolmutility.cpp
@@ -61,7 +61,6 @@ void TestOlmUtility::verifySignedOneTimeKey()
auto utilityBuf = new uint8_t[olm_utility_size()];
auto utility = olm_utility(utilityBuf);
- qDebug() << "1" << aliceOlm->identityKeys().ed25519 << msg << QString::fromUtf8(sig);
QByteArray signatureBuf1(sig.length(), '0');
std::copy(sig.begin(), sig.end(), signatureBuf1.begin());
@@ -73,7 +72,6 @@ void TestOlmUtility::verifySignedOneTimeKey()
msg.size(),
(void *)sig.data(),
sig.size());
- qDebug() << "2" << aliceOlm->identityKeys().ed25519 << msg << QString::fromUtf8(signatureBuf1);
QCOMPARE(std::string(olm_utility_last_error(utility)), "SUCCESS");
QCOMPARE(res, 0);