aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-06-24 09:18:09 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-06-24 09:18:09 +0200
commit9f7a65b04c246de4c27b205ece778ede1ad7df7e (patch)
tree2725a63e56456aab071325518a71bff1ed5d5326 /lib
parent143ac38aabab90b40fbe73b489b91fb159e66b6b (diff)
downloadlibquotient-9f7a65b04c246de4c27b205ece778ede1ad7df7e.tar.gz
libquotient-9f7a65b04c246de4c27b205ece778ede1ad7df7e.zip
Fix copy-pasta in signed one-time key JSON dumper
Diffstat (limited to 'lib')
-rw-r--r--lib/connection.cpp5
-rw-r--r--lib/e2ee/e2ee.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 2319a38a..13a35684 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -2306,10 +2306,11 @@ bool Connection::Private::createOlmSession(const QString& targetUserId,
signedOneTimeKey
->signatures[targetUserId]["ed25519:"_ls % targetDeviceId]
.toLatin1();
+ const auto payloadObject =
+ toJson(SignedOneTimeKey { signedOneTimeKey->key, {} });
if (!verifier.ed25519Verify(
edKeyForUserDevice(targetUserId, targetDeviceId).toLatin1(),
- QJsonDocument(toJson(SignedOneTimeKey { signedOneTimeKey->key, {} }))
- .toJson(QJsonDocument::Compact),
+ QJsonDocument(payloadObject).toJson(QJsonDocument::Compact),
signature)) {
qWarning(E2EE) << "Failed to verify one-time-key signature for" << targetUserId
<< targetDeviceId << ". Skipping this device.";
diff --git a/lib/e2ee/e2ee.h b/lib/e2ee/e2ee.h
index aba795a4..17c87f53 100644
--- a/lib/e2ee/e2ee.h
+++ b/lib/e2ee/e2ee.h
@@ -106,7 +106,7 @@ struct JsonObjectConverter<SignedOneTimeKey> {
{
addParam<>(jo, "key"_ls, result.key);
addParam<IfNotEmpty>(jo, "signatures"_ls, result.signatures);
- addParam<IfNotEmpty>(jo, "key"_ls, result.fallback);
+ addParam<IfNotEmpty>(jo, "fallback"_ls, result.fallback);
}
};