feat: Rename vb-request-v2 -> vb-request-with-auth

Turns out that Alice reacts to a request-v2 message in exactly the same
way as to a request-with-auth message. So, no need to distinguish here.
This commit is contained in:
Hocuri
2025-08-11 15:32:01 +02:00
parent 956519cd98
commit 9dc590cb35
5 changed files with 13 additions and 13 deletions

View File

@@ -2948,7 +2948,7 @@ async fn prepare_send_msg(
.get_bool(Param::ForcePlaintext)
.unwrap_or_default()
// V2 securejoin messages are symmetrically encrypted, no need for the public key:
|| msg.securejoin_step() == Some("vb-request-v2")
|| msg.securejoin_step() == Some("vb-request-with-auth")
}
_ => false,
};

View File

@@ -579,7 +579,7 @@ impl MimeFactory {
// messages are auto-sent unlike usual unencrypted messages.
step == "vg-request-with-auth"
|| step == "vc-request-with-auth"
|| step == "vb-request-v2"
|| step == "vb-request-with-auth"
|| step == "vg-member-added"
|| step == "vb-member-added"
|| step == "vc-contact-confirm"
@@ -826,7 +826,7 @@ impl MimeFactory {
} else if let Loaded::Message { msg, .. } = &self.loaded {
if msg.param.get_cmd() == SystemMessage::SecurejoinMessage {
let step = msg.param.get(Param::Arg).unwrap_or_default();
if step != "vg-request" && step != "vc-request" && step != "vb-request-v2" {
if step != "vg-request" && step != "vc-request" && step != "vb-request-with-auth" {
headers.push((
"Auto-Submitted",
mail_builder::headers::raw::Raw::new("auto-replied".to_string()).into(),
@@ -1563,7 +1563,7 @@ impl MimeFactory {
headers.push((
if step == "vg-request-with-auth"
|| step == "vc-request-with-auth"
|| step == "vb-request-v2"
|| step == "vb-request-with-auth"
{
"Secure-Join-Auth"
} else {
@@ -1916,7 +1916,7 @@ fn hidden_recipients() -> Address<'static> {
fn should_encrypt_with_auth_token(msg: &Message) -> bool {
msg.param.get_cmd() == SystemMessage::SecurejoinMessage
&& msg.param.get(Param::Arg).unwrap_or_default() == "vb-request-v2"
&& msg.param.get(Param::Arg).unwrap_or_default() == "vb-request-with-auth"
}
fn should_encrypt_with_broadcast_secret(msg: &Message, chat: &Chat) -> bool {

View File

@@ -114,7 +114,7 @@ pub enum Param {
///
/// For `BobHandshakeMsg::RequestWithAuth`, this is the `Secure-Join-Auth` header.
///
/// For version two of the securejoin protocol (`vb-request-v2`),
/// For version two of the securejoin protocol (`vb-request-with-auth`),
/// this is the Auth token used to encrypt the message.
///
/// For [`SystemMessage::MultiDeviceSync`], this contains the ids that are synced.

View File

@@ -289,7 +289,7 @@ pub(crate) async fn handle_securejoin_handshake(
// -> or just ignore the problem for now - we will need to solve it for all messages anyways: https://github.com/chatmail/core/issues/7057
if !matches!(
step,
"vg-request" | "vc-request" | "vb-request-v2" | "vb-member-added"
"vg-request" | "vc-request" | "vb-request-with-auth" | "vb-member-added"
) {
let mut self_found = false;
let self_fingerprint = load_self_public_key(context).await?.dc_fingerprint();
@@ -360,7 +360,7 @@ pub(crate) async fn handle_securejoin_handshake(
========================================================*/
bob::handle_auth_required(context, mime_message).await
}
"vg-request-with-auth" | "vc-request-with-auth" | "vb-request-v2" => {
"vg-request-with-auth" | "vc-request-with-auth" | "vb-request-with-auth" => {
/*==========================================================
==== Alice - the inviter side ====
==== Steps 5+6 in "Setup verified contact" protocol ====
@@ -441,7 +441,7 @@ pub(crate) async fn handle_securejoin_handshake(
.await?;
inviter_progress(context, contact_id, 800);
inviter_progress(context, contact_id, 1000);
if step == "vb-request-v2" {
if step == "vb-request-with-auth" {
// For broadcasts, we don't want to delete the message,
// because the other device should also internally add the member
// and see the key (because it won't see the member via autocrypt-gossip).
@@ -595,7 +595,7 @@ pub(crate) async fn observe_securejoin_on_other_device(
inviter_progress(context, contact_id, 1000);
}
// TODO not sure if I should add vb-request-v2 here
// TODO not sure if I should add vb-request-with-auth here
// Actually, I'm not even sure why vg-request-with-auth is here - why do we create a 1:1 chat??
if step == "vg-request-with-auth" || step == "vc-request-with-auth" {
// This actually reflects what happens on the first device (which does the secure

View File

@@ -72,13 +72,13 @@ pub(super) async fn start_protocol(context: &Context, invite: QrInvite) -> Resul
let mut msg = Message {
viewtype: Viewtype::Text,
// TODO I may want to make this generic also for group/contacts
text: "Secure-Join: vb-request-v2".to_string(),
text: "Secure-Join: vb-request-with-auth".to_string(),
hidden: true,
..Default::default()
};
msg.param.set_cmd(SystemMessage::SecurejoinMessage);
msg.param.set(Param::Arg, "vb-request-v2");
msg.param.set(Param::Arg, "vb-request-with-auth");
msg.param.set(Param::Arg2, invite.authcode());
msg.param.set_int(Param::GuaranteeE2ee, 1);
let bob_fp = self_fingerprint(context).await?;
@@ -357,7 +357,7 @@ pub(crate) async fn send_handshake_message(
pub(crate) enum BobHandshakeMsg {
/// vc-request or vg-request
Request,
/// vc-request-with-auth, vg-request-with-auth, or vb-request-v2
/// vc-request-with-auth, vg-request-with-auth, or vb-request-with-auth
RequestWithAuth,
}