aboutsummaryrefslogtreecommitdiff
path: root/lib/e2ee/qolmutility.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/e2ee/qolmutility.cpp')
-rw-r--r--lib/e2ee/qolmutility.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/lib/e2ee/qolmutility.cpp b/lib/e2ee/qolmutility.cpp
index 08c2b699..46f7f4f3 100644
--- a/lib/e2ee/qolmutility.cpp
+++ b/lib/e2ee/qolmutility.cpp
@@ -44,21 +44,10 @@ QString QOlmUtility::sha256Utf8Msg(const QString &message) const
return sha256Bytes(message.toUtf8());
}
-QOlmExpected<bool> QOlmUtility::ed25519Verify(const QByteArray& key,
- const QByteArray& message,
- const QByteArray& signature)
+bool QOlmUtility::ed25519Verify(const QByteArray& key, const QByteArray& message,
+ QByteArray signature)
{
- QByteArray signatureBuf(signature.length(), '\0');
- std::copy(signature.begin(), signature.end(), signatureBuf.begin());
-
- if (olm_ed25519_verify(m_utility, key.data(), key.size(), message.data(),
- message.size(), signatureBuf.data(),
- signatureBuf.size())
- == 0)
- return true;
-
- auto error = lastErrorCode();
- if (error == OLM_BAD_MESSAGE_MAC)
- return false;
- return error;
+ return olm_ed25519_verify(m_utility, key.data(), key.size(), message.data(),
+ message.size(), signature.data(), signature.size())
+ == 0;
}