From 3f08ef0d57183a782a16a7bd4df0c291b3e6e7f3 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Thu, 17 Oct 2024 14:10:26 -0600 Subject: [PATCH] verificationhelper/request: check txn ID is different before sending cancellations This will allow it to fallthrought to the correct error which is that we received a new verification request for the same transaction ID. Signed-off-by: Sumner Evans --- crypto/verificationhelper/verificationhelper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/verificationhelper/verificationhelper.go b/crypto/verificationhelper/verificationhelper.go index f4e5e2f5..cbcff887 100644 --- a/crypto/verificationhelper/verificationhelper.go +++ b/crypto/verificationhelper/verificationhelper.go @@ -690,7 +690,7 @@ func (vh *VerificationHelper) onVerificationRequest(ctx context.Context, evt *ev TheirSupportedMethods: verificationRequest.Methods, } for existingTxnID, existingTxn := range vh.activeTransactions { - if existingTxn.TheirUser == evt.Sender && existingTxn.TheirDevice == verificationRequest.FromDevice { + if existingTxn.TheirUser == evt.Sender && existingTxn.TheirDevice == verificationRequest.FromDevice && existingTxnID != verificationRequest.TransactionID { vh.cancelVerificationTxn(ctx, existingTxn, event.VerificationCancelCodeUnexpectedMessage, "received multiple verification requests from the same device") vh.cancelVerificationTxn(ctx, newTxn, event.VerificationCancelCodeUnexpectedMessage, "received multiple verification requests from the same device") delete(vh.activeTransactions, existingTxnID)