aboutsummaryrefslogtreecommitdiff
path: root/lib/e2ee/qolmutility.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-02-27 18:14:21 +0100
committerGitHub <noreply@github.com>2022-02-27 18:14:21 +0100
commit66918a4c7d393a8b22de7bf23009651dbd919366 (patch)
tree697a64c2955eee4bb5125b78d0f165223d871bfe /lib/e2ee/qolmutility.cpp
parent7b1320be28024280d930617858f26dd4db34e68c (diff)
parent0928bd405f4958d3a12277614d2715cfac1f7ac0 (diff)
downloadlibquotient-66918a4c7d393a8b22de7bf23009651dbd919366.tar.gz
libquotient-66918a4c7d393a8b22de7bf23009651dbd919366.zip
Merge #538: Verification should return false instead of error for failed signature checks
Diffstat (limited to 'lib/e2ee/qolmutility.cpp')
-rw-r--r--lib/e2ee/qolmutility.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/e2ee/qolmutility.cpp b/lib/e2ee/qolmutility.cpp
index 303f6d75..9f09a37f 100644
--- a/lib/e2ee/qolmutility.cpp
+++ b/lib/e2ee/qolmutility.cpp
@@ -49,9 +49,12 @@ 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()) {
- return lastError(m_utility);
+ if (ret == olm_error()) {
+ auto error = lastError(m_utility);
+ if (error == QOlmError::BadMessageMac) {
+ return false;
+ }
+ return error;
}
if (ret != 0) {