@@ -515,12 +515,8 @@ pub(crate) async fn handle_securejoin_handshake(
515
515
}
516
516
517
517
"vg-member-added-received" | "vc-contact-confirm-received" => {
518
- /*==========================================================
519
- ==== Alice - the inviter side ====
520
- ==== Step 8 in "Out-of-band verified groups" protocol ====
521
- ==========================================================*/
522
-
523
- Ok ( HandshakeMessage :: Done ) // "Done" deletes the message
518
+ // Deprecated steps, delete them immediately.
519
+ Ok ( HandshakeMessage :: Done )
524
520
}
525
521
_ => {
526
522
warn ! ( context, "invalid step: {}" , step) ;
@@ -541,10 +537,10 @@ pub(crate) async fn handle_securejoin_handshake(
541
537
/// before sending vg-member-added/vc-contact-confirm - so, if we observe vg-member-added/vc-contact-confirm,
542
538
/// we can mark the peer as verified as well.
543
539
///
544
- /// - if we see the self-sent-message vg-member-added-received
540
+ /// - if we see the self-sent-message vg-request-with-auth/vc-request-with-auth
545
541
/// we know that we're an joiner-observer.
546
- /// the joining device has marked the peer as verified on vg-member-added/vc-contact-confirm
547
- /// before sending vg-member-added-received - so, if we observe vg-member-added-received,
542
+ /// the joining device has marked the peer as verified
543
+ /// before sending vg-request-with-auth/vc-request-with-auth - so, if we observe vg-member-added-received,
548
544
/// we can mark the peer as verified as well.
549
545
pub ( crate ) async fn observe_securejoin_on_other_device (
550
546
context : & Context ,
@@ -563,9 +559,7 @@ pub(crate) async fn observe_securejoin_on_other_device(
563
559
"vg-request-with-auth"
564
560
| "vc-request-with-auth"
565
561
| "vg-member-added"
566
- | "vc-contact-confirm"
567
- | "vg-member-added-received"
568
- | "vc-contact-confirm-received" => {
562
+ | "vc-contact-confirm" => {
569
563
if !encrypted_and_signed (
570
564
context,
571
565
mime_message,
@@ -941,27 +935,16 @@ mod tests {
941
935
. unwrap ( ) ;
942
936
assert_eq ! ( contact_bob. is_verified( & bob. ctx) . await . unwrap( ) , false ) ;
943
937
944
- // Step 7: Bob receives vc-contact-confirm, sends vc-contact-confirm-received
938
+ // Step 7: Bob receives vc-contact-confirm
945
939
bob. recv_msg ( & sent) . await ;
946
940
assert_eq ! ( contact_alice. is_verified( & bob. ctx) . await . unwrap( ) , true ) ;
947
941
948
942
// Check Bob got the verified message in his 1:1 chat.
949
- {
950
- let chat = bob. create_chat ( & alice) . await ;
951
- let msg = get_chat_msg ( & bob, chat. get_id ( ) , 0 , 1 ) . await ;
952
- assert ! ( msg. is_info( ) ) ;
953
- let expected_text = chat_protection_enabled ( & bob) . await ;
954
- assert_eq ! ( msg. get_text( ) , expected_text) ;
955
- }
956
-
957
- // Check Bob sent the final message
958
- let sent = bob. pop_sent_msg ( ) . await ;
959
- let msg = alice. parse_msg ( & sent) . await ;
960
- assert ! ( msg. was_encrypted( ) ) ;
961
- assert_eq ! (
962
- msg. get_header( HeaderDef :: SecureJoin ) . unwrap( ) ,
963
- "vc-contact-confirm-received"
964
- ) ;
943
+ let chat = bob. create_chat ( & alice) . await ;
944
+ let msg = get_chat_msg ( & bob, chat. get_id ( ) , 0 , 1 ) . await ;
945
+ assert ! ( msg. is_info( ) ) ;
946
+ let expected_text = chat_protection_enabled ( & bob) . await ;
947
+ assert_eq ! ( msg. get_text( ) , expected_text) ;
965
948
}
966
949
967
950
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
@@ -1073,17 +1056,10 @@ mod tests {
1073
1056
let contact_alice = Contact :: get_by_id ( & bob. ctx , contact_alice_id) . await ?;
1074
1057
assert_eq ! ( contact_bob. is_verified( & bob. ctx) . await ?, false ) ;
1075
1058
1076
- // Step 7: Bob receives vc-contact-confirm, sends vc-contact-confirm-received
1059
+ // Step 7: Bob receives vc-contact-confirm
1077
1060
bob. recv_msg ( & sent) . await ;
1078
1061
assert_eq ! ( contact_alice. is_verified( & bob. ctx) . await ?, true ) ;
1079
1062
1080
- let sent = bob. pop_sent_msg ( ) . await ;
1081
- let msg = alice. parse_msg ( & sent) . await ;
1082
- assert ! ( msg. was_encrypted( ) ) ;
1083
- assert_eq ! (
1084
- msg. get_header( HeaderDef :: SecureJoin ) . unwrap( ) ,
1085
- "vc-contact-confirm-received"
1086
- ) ;
1087
1063
Ok ( ( ) )
1088
1064
}
1089
1065
@@ -1248,7 +1224,7 @@ mod tests {
1248
1224
let contact_alice = Contact :: get_by_id ( & bob. ctx , contact_alice_id) . await ?;
1249
1225
assert_eq ! ( contact_bob. is_verified( & bob. ctx) . await ?, false ) ;
1250
1226
1251
- // Step 7: Bob receives vg-member-added, sends vg-member-added-received
1227
+ // Step 7: Bob receives vg-member-added
1252
1228
bob. recv_msg ( & sent) . await ;
1253
1229
{
1254
1230
// Bob has Alice verified, message shows up in the group chat.
@@ -1268,14 +1244,6 @@ mod tests {
1268
1244
}
1269
1245
}
1270
1246
1271
- let sent = bob. pop_sent_msg ( ) . await ;
1272
- let msg = alice. parse_msg ( & sent) . await ;
1273
- assert ! ( msg. was_encrypted( ) ) ;
1274
- assert_eq ! (
1275
- msg. get_header( HeaderDef :: SecureJoin ) . unwrap( ) ,
1276
- "vg-member-added-received"
1277
- ) ;
1278
-
1279
1247
let bob_chat = Chat :: load_from_db ( & bob. ctx , bob_chatid) . await ?;
1280
1248
assert ! ( bob_chat. is_protected( ) ) ;
1281
1249
assert ! ( bob_chat. typ == Chattype :: Group ) ;
0 commit comments