From a2b155b10197a4fca4db2af59c2171f82a0eac2b Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sat, 24 Sep 2022 12:15:54 +0200 Subject: 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 --- lib/connection.cpp | 4 ++++ lib/keyverificationsession.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') 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; -- cgit v1.2.3