diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-02-27 18:14:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-27 18:14:21 +0100 |
commit | 66918a4c7d393a8b22de7bf23009651dbd919366 (patch) | |
tree | 697a64c2955eee4bb5125b78d0f165223d871bfe /lib/e2ee/qolmutility.cpp | |
parent | 7b1320be28024280d930617858f26dd4db34e68c (diff) | |
parent | 0928bd405f4958d3a12277614d2715cfac1f7ac0 (diff) | |
download | libquotient-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.cpp | 9 |
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) { |