Skip to content

Commit a96b44a

Browse files
committed
fix: do not mark recipients as verified if there is no Chat-Verified header
1 parent 4286d24 commit a96b44a

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

deltachat-rpc-client/tests/test_securejoin.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,51 @@ def test_aeap_flow_verified(acfactory):
429429
assert ac1new.get_config("addr") in [
430430
contact.get_snapshot().address for contact in msg_in_2_snapshot.chat.get_contacts()
431431
]
432+
433+
434+
def test_gossip_verification(acfactory) -> None:
435+
alice, bob, carol = acfactory.get_online_accounts(3)
436+
437+
# Bob verifies Alice.
438+
qr_code, _svg = alice.get_qr_code()
439+
bob.secure_join(qr_code)
440+
bob.wait_for_securejoin_joiner_success()
441+
442+
# Bob verifies Carol.
443+
qr_code, _svg = carol.get_qr_code()
444+
bob.secure_join(qr_code)
445+
bob.wait_for_securejoin_joiner_success()
446+
447+
bob_contact_alice = bob.create_contact(alice.get_config("addr"), "Alice")
448+
bob_contact_carol = bob.create_contact(carol.get_config("addr"), "Carol")
449+
carol_contact_alice = carol.create_contact(alice.get_config("addr"), "Alice")
450+
451+
logging.info("Bob creates an Autocrypt group")
452+
bob_group_chat = bob.create_group("Autocrypt Group")
453+
assert not bob_group_chat.get_basic_snapshot().is_protected
454+
bob_group_chat.add_contact(bob_contact_alice)
455+
bob_group_chat.add_contact(bob_contact_carol)
456+
bob_group_chat.send_message(text="Hello Autocrypt group")
457+
458+
snapshot = carol.get_message_by_id(carol.wait_for_incoming_msg_event().msg_id).get_snapshot()
459+
assert snapshot.text == "Hello Autocrypt group"
460+
assert snapshot.show_padlock
461+
462+
# Autocrypt group does not propagate verification.
463+
carol_contact_alice_snapshot = carol_contact_alice.get_snapshot()
464+
assert not carol_contact_alice_snapshot.is_verified
465+
466+
logging.info("Bob creates a Securejoin group")
467+
bob_group_chat = bob.create_group("Securejoin Group", protect=True)
468+
assert bob_group_chat.get_basic_snapshot().is_protected
469+
bob_group_chat.add_contact(bob_contact_alice)
470+
bob_group_chat.add_contact(bob_contact_carol)
471+
bob_group_chat.send_message(text="Hello Securejoin group")
472+
473+
snapshot = carol.get_message_by_id(carol.wait_for_incoming_msg_event().msg_id).get_snapshot()
474+
assert snapshot.text == "Hello Securejoin group"
475+
assert snapshot.show_padlock
476+
477+
# Securejoin propagates verification.
478+
carol_contact_alice_snapshot = carol_contact_alice.get_snapshot()
479+
assert carol_contact_alice_snapshot.is_verified

src/receive_imf.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,6 +2454,10 @@ async fn mark_recipients_as_verified(
24542454
return Ok(());
24552455
}
24562456

2457+
if mimeparser.get_header(HeaderDef::ChatVerified).is_none() {
2458+
return Ok(());
2459+
}
2460+
24572461
let rows = context
24582462
.sql
24592463
.query_map(

0 commit comments

Comments
 (0)