aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2022-09-24 12:15:54 +0200
committerTobias Fella <fella@posteo.de>2022-09-24 12:15:54 +0200
commita2b155b10197a4fca4db2af59c2171f82a0eac2b (patch)
tree405e5ae45b53112690eb8b980369329cd7bbfaea /lib
parent4cf39fa778e2d850586d37bfc3357a6bc5042227 (diff)
downloadlibquotient-a2b155b10197a4fca4db2af59c2171f82a0eac2b.tar.gz
libquotient-a2b155b10197a4fca4db2af59c2171f82a0eac2b.zip
Fix verification
Contains two fixes: - When receiving the mac, we can also be in WAITINGFORVERIFICATION state - Ignore all KeyVerificationDone events; we don't do anything with them anyway and sometimes receive them after the session is destructed
Diffstat (limited to 'lib')
-rw-r--r--lib/connection.cpp4
-rw-r--r--lib/keyverificationsession.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 8ca76ceb..307c3840 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -1006,6 +1006,10 @@ bool Connection::Private::processIfVerificationEvent(const Event& evt,
emit q->newKeyVerificationSession(*sessionIter);
return true;
},
+ [](const KeyVerificationDoneEvent& doneEvt) {
+ Q_UNUSED(doneEvt)
+ return true;
+ },
[this](const KeyVerificationEvent& kvEvt) {
if (auto* const session =
verificationSessions.value(kvEvt.transactionId())) {
diff --git a/lib/keyverificationsession.cpp b/lib/keyverificationsession.cpp
index 3f76eac1..f5d49561 100644
--- a/lib/keyverificationsession.cpp
+++ b/lib/keyverificationsession.cpp
@@ -120,7 +120,7 @@ void KeyVerificationSession::handleEvent(const KeyVerificationEvent& baseEvent)
return true;
},
[this](const KeyVerificationMacEvent& event) {
- if (state() != WAITINGFORMAC)
+ if (state() != WAITINGFORMAC && state() != WAITINGFORVERIFICATION)
return false;
handleMac(event);
return true;