Skip to content
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

feat(securejoin): do not create 1:1 chat on Alice's side until vc-request-with-auth #6696

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Mar 22, 2025

vc-request is an unencrypted message
that Bob sends when he does not have Alice's key.
It also does not contain
Bob's avatar and name,
so the contact has only the email address
at this point and it is too early
to show it.

…uest-with-auth

vc-request is an unencrypted message
that Bob sends when he does not have Alice's key.
It also does not contain
Bob's avatar and name,
so the contact has only the email address
at this point and it is too early
to show it.
@link2xt link2xt requested review from Hocuri and iequidoo March 22, 2025 00:15
@link2xt
Copy link
Collaborator Author

link2xt commented Mar 22, 2025

This is another preparation for PGP-contacts (#6683). Incoming vc-request is an unencryped message so it results in a creation of an email-contact rather than PGP-contact. I do not want to show a 1:1 chat with the email contact at this point, so postpone it to vc-request-with-auth which is always an encrypted message.

It is technically possible to special-case vc-request message and create a PGP-contact entirely from the Autocrypt header, but at this point the chat is not going to be verified and there is no cryptographic proof that Bob wanted to get in contact with Alice, while for all other securejoin messages we require an Autocrypt-Gossip key to ensure that Bob wanted to send a message to Alice:

core/src/securejoin.rs

Lines 295 to 310 in 8a5a67d

if !matches!(step, "vg-request" | "vc-request") {
let mut self_found = false;
let self_fingerprint = load_self_public_key(context).await?.dc_fingerprint();
for (addr, key) in &mime_message.gossiped_keys {
if key.dc_fingerprint() == self_fingerprint && context.is_self_addr(addr).await? {
self_found = true;
break;
}
}
if !self_found {
// This message isn't intended for us. Possibly the peer doesn't own the key which the
// message is signed with but forwarded someone's message to us.
warn!(context, "Step {step}: No self addr+pubkey gossip found.");
return Ok(HandshakeMessage::Ignore);
}
}

It is not nice that vc-request message results in automatic reply without anything visible on Alice's side, but this is already the case for vg-request messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant