mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
do the actual fix (thanks alex for some help)
This commit is contained in:
@@ -1706,7 +1706,7 @@ def test_qr_join_chat_with_pending_bobstate_issue4894(acfactory, lp):
|
|||||||
ac3.qr_setup_contact(ac2.get_setup_contact_qr())
|
ac3.qr_setup_contact(ac2.get_setup_contact_qr())
|
||||||
ac2._evtracker.wait_securejoin_inviter_progress(1000)
|
ac2._evtracker.wait_securejoin_inviter_progress(1000)
|
||||||
|
|
||||||
# in order for ac2 to have pending botstate with a verified group
|
# in order for ac2 to have pending bobstate with a verified group
|
||||||
# we first create a fully joined verified group, and then start
|
# we first create a fully joined verified group, and then start
|
||||||
# joining a second time but interrupt it, to create pending bob state
|
# joining a second time but interrupt it, to create pending bob state
|
||||||
|
|
||||||
@@ -1724,7 +1724,7 @@ def test_qr_join_chat_with_pending_bobstate_issue4894(acfactory, lp):
|
|||||||
break
|
break
|
||||||
|
|
||||||
lp.sec("ac1: let ac2 join again but shutoff ac1 in the middle of securejoin")
|
lp.sec("ac1: let ac2 join again but shutoff ac1 in the middle of securejoin")
|
||||||
ch1b = ac2.qr_join_chat(ch1.get_join_qr())
|
ac2.qr_join_chat(ch1.get_join_qr())
|
||||||
while 1:
|
while 1:
|
||||||
ev = ac2._evtracker.get_matching("DC_EVENT_SECUREJOIN_JOINER_PROGRESS")
|
ev = ac2._evtracker.get_matching("DC_EVENT_SECUREJOIN_JOINER_PROGRESS")
|
||||||
if ev.data2 == 400: # prevent ac1 from answering request_with_auth
|
if ev.data2 == 400: # prevent ac1 from answering request_with_auth
|
||||||
@@ -1753,12 +1753,8 @@ def test_qr_join_chat_with_pending_bobstate_issue4894(acfactory, lp):
|
|||||||
ac3._evtracker.wait_securejoin_inviter_progress(1000)
|
ac3._evtracker.wait_securejoin_inviter_progress(1000)
|
||||||
while 1:
|
while 1:
|
||||||
ev = ac2._evtracker.get()
|
ev = ac2._evtracker.get()
|
||||||
if "Message does not match expected" in str(ev):
|
if "added by unrelated SecureJoin" in str(ev):
|
||||||
pytest.fail("ac2 wrongly used a pending bobstate when seeing a member-added message")
|
return
|
||||||
break
|
|
||||||
|
|
||||||
import pdb
|
|
||||||
pdb.set_trace()
|
|
||||||
|
|
||||||
|
|
||||||
def test_qr_new_group_unblocked(acfactory, lp):
|
def test_qr_new_group_unblocked(acfactory, lp):
|
||||||
|
|||||||
@@ -483,6 +483,19 @@ pub(crate) async fn handle_securejoin_handshake(
|
|||||||
==== Bob - the joiner's side ====
|
==== Bob - the joiner's side ====
|
||||||
==== Step 7 in "Setup verified contact" protocol ====
|
==== Step 7 in "Setup verified contact" protocol ====
|
||||||
=======================================================*/
|
=======================================================*/
|
||||||
|
|
||||||
|
if let Some(member_added) = mime_message
|
||||||
|
.get_header(HeaderDef::ChatGroupMemberAdded)
|
||||||
|
.map(|s| s.as_str())
|
||||||
|
{
|
||||||
|
if !context.is_self_addr(member_added).await? {
|
||||||
|
info!(
|
||||||
|
context,
|
||||||
|
"Member {member_added} added by unrelated SecureJoin process"
|
||||||
|
);
|
||||||
|
return Ok(HandshakeMessage::Propagate);
|
||||||
|
}
|
||||||
|
}
|
||||||
match BobState::from_db(&context.sql).await? {
|
match BobState::from_db(&context.sql).await? {
|
||||||
Some(bobstate) => {
|
Some(bobstate) => {
|
||||||
bob::handle_contact_confirm(context, bobstate, mime_message).await
|
bob::handle_contact_confirm(context, bobstate, mime_message).await
|
||||||
|
|||||||
Reference in New Issue
Block a user