-
-
Notifications
You must be signed in to change notification settings - Fork 106
fix: Don't reverify contacts by SELF on receipt of a message from another device #7138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
39d5c5c
to
19b5126
Compare
I've checked that logically this doesn't conflict with #7116, so can be merged independently. Not adding tests for the two last fixes yet because there may be other ideas on how to solve the problems described. |
It needs to be based on top of main for this. I also commented in #7116 (comment) |
src/contact.rs
Outdated
if verifier_verifier_id == verifier_id { | ||
// Avoid 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't even need the other device for this except for getting "verified by unknown contact" in the first place. If you have Alice and Bob verified by unknown contact, then they start chatting in some group and claim that each other is verified (via Chat-Verified
currently, later with _verified
attribute of Autocrypt-Gossip
), you will get a loop with Alice and Bob having each other as verifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't even need the other device for this except for getting "verified by unknown contact" in the first place.
This is what i meant exactly. Added this to the comment to make it more clear.
As for "verifier loops", they're already not possible before this commit. Only "reverse chains" are possible on different devices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ther device Also verify not yet verified contacts w/o setting a verifier for them (in the db it's stored as `verifier_id=id` though) because we don't know who verified them for another device.
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 (which is needed for getting "verified by unknown contact" in the first place).
d52fd61
to
6ea63c7
Compare
…verifier Now that the previous commit avoids creating incorrect reverse verification chains, we can do this. Sure, existing users' dbs aready have verification chains ending with "unknown" roots, but at least for new users updating `verifier_id` to a known verifier makes sense.
6ea63c7
to
c10965c
Compare
Going to do this in a follow-up PR. |
No description provided.