fix: AEAP: Remove old peerstate verified_key instead of removing the whole peerstate (#5535)

When doing an AEAP transition, we mustn't just delete the old peerstate as this would break
encryption to it. This is critical for non-verified groups -- if we can't encrypt to the old
address, we can't securely remove it from the group (to add the new one instead).
This commit is contained in:
iequidoo
2024-05-27 17:34:20 -03:00
committed by iequidoo
parent 27bf4c37a7
commit 70ad323c9a
2 changed files with 18 additions and 4 deletions

View File

@@ -327,6 +327,12 @@ async fn check_no_transition_done(groups: &[ChatId], old_alice_addr: &str, bob:
last_info_msg.is_none(),
"{last_info_msg:?} shouldn't be there (or it's an unrelated info msg)"
);
let sent = bob.send_text(*group, "hi").await;
let msg = Message::load_from_db(bob, sent.sender_msg_id)
.await
.unwrap();
assert_eq!(msg.get_showpadlock(), true);
}
}