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: mark 1:1 chat as verified for Bob early #5116

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Dec 19, 2023

Based on PR #5089

Mark 1:1 chat as verified as soon as Alice is forward-verified
so Bob can already start sending Chat-Verified headers.
This way Alice and Bob can scan each other's QR codes
and even if all Secure-Join headers are dropped from the network,
still get forward verifications via QR-code scans
and backward verifications via Chat-Verified messages in 1:1 chat.

@link2xt link2xt self-assigned this Dec 19, 2023
@iequidoo iequidoo self-requested a review December 19, 2023 23:49
@link2xt
Copy link
Collaborator Author

link2xt commented Dec 20, 2023

Surprisingly all the tests pass. But this actually needs a new test that checks we can get two-way verification without exchanging any securejoin messages.

@@ -100,6 +100,9 @@ pub(super) async fn handle_auth_required(
let chat_id = bobstate.joining_chat_id(context).await?;
chat::add_info_msg(context, chat_id, &msg, time()).await?;
}
bobstate
.notify_peer_verified(context, message.timestamp_sent)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notify_peer_verified() doesn't look like a good function name. It not only notifies the user, but also sets the chat protection. Maybe just set_peer_verified()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed it and going to merge this PR into #5089 now.

@link2xt link2xt mentioned this pull request Dec 22, 2023
@link2xt link2xt force-pushed the link2xt/peerstate-second-dir-verification branch 3 times, most recently from 9289de6 to c2df003 Compare January 9, 2024 02:21
Mark 1:1 chat as verified as soon as Alice is forward-verified
so Bob can already start sending Chat-Verified headers.
This way Alice and Bob can scan each other's QR codes
and even if all Secure-Join headers are dropped from the network,
still get forward verifications via QR-code scans
and backward verifications via Chat-Verified messages in 1:1 chat.
@link2xt link2xt force-pushed the link2xt/mark-1-1-chat-verified-early branch from e0ee897 to 8361541 Compare January 9, 2024 02:24
The chat is not modified at least since
c6ea4e3
(PR #4998),
even the info message is not posted there.
It was named notify_peer_verified()
because it added info message,
but this is no longer true since
#4998
(commit c6ea4e3)
is merged.
@link2xt link2xt merged commit c352a44 into link2xt/peerstate-second-dir-verification Jan 9, 2024
@link2xt link2xt deleted the link2xt/mark-1-1-chat-verified-early branch January 9, 2024 03:10
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.

2 participants