From fc2ffecd22d6008426c2305dbeb31fc2caab6163 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sun, 27 Feb 2022 17:43:17 +0100 Subject: Return false instead of error for failed signature checks --- lib/e2ee/qolmutility.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/e2ee/qolmutility.cpp b/lib/e2ee/qolmutility.cpp index 303f6d75..5d1bc18d 100644 --- a/lib/e2ee/qolmutility.cpp +++ b/lib/e2ee/qolmutility.cpp @@ -49,8 +49,11 @@ std::variant QOlmUtility::ed25519Verify(const QByteArray &key, const auto ret = olm_ed25519_verify(m_utility, key.data(), key.size(), message.data(), message.size(), (void *)signatureBuf.data(), signatureBuf.size()); - const auto error = ret; - if (error == olm_error()) { + if (ret == olm_error()) { + auto error = lastError(m_utility); + if (error == QOlmError::BadMessageMac) { + return false; + } return lastError(m_utility); } -- cgit v1.2.3