Skip to content

Commit 39d5c5c

Browse files
committed
fix: Don't verify contacts by others having an unknown verifier
If this happens, mark the contact as verified by an unknown contact instead. This avoids introducing incorrect reverse chains: if the verifier itself has an unknown verifier, it may be `contact_id` actually (directly or indirectly) on the other device.
1 parent 2993858 commit 39d5c5c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/contact.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,6 +1992,12 @@ pub(crate) async fn mark_contact_id_as_verified(
19921992
verifier_id == contact_id || verifier_verifier_id != ContactId::UNDEFINED,
19931993
"Contact {contact_id} cannot be verified by unverified contact {verifier_id}",
19941994
);
1995+
if verifier_verifier_id == verifier_id {
1996+
// Avoid introducing incorrect reverse chains: if the verifier itself has an
1997+
// unknown verifier, it may be `contact_id` actually (directly or indirectly) on
1998+
// the other device.
1999+
verifier_id = contact_id;
2000+
}
19952001
}
19962002
transaction.execute(
19972003
"UPDATE contacts SET verifier=?1

0 commit comments

Comments
 (0)