aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2022-02-27 17:43:17 +0100
committerTobias Fella <fella@posteo.de>2022-02-27 17:43:17 +0100
commitfc2ffecd22d6008426c2305dbeb31fc2caab6163 (patch)
treededd7d455686b8545f4c447ad220441c746057eb /lib
parent4768823708fe42140d23fbb828d2d5f438bb3787 (diff)
downloadlibquotient-fc2ffecd22d6008426c2305dbeb31fc2caab6163.tar.gz
libquotient-fc2ffecd22d6008426c2305dbeb31fc2caab6163.zip
Return false instead of error for failed signature checks
Diffstat (limited to 'lib')
-rw-r--r--lib/e2ee/qolmutility.cpp7
1 files 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<bool, QOlmError> 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);
}