Introduce a state machine for Bob's secure-join

This introduces a state machine which takes care of managing the
handshake transitions in the secure-join protocol.  This separates
user interactions from the protocol state handling.

This means that while handling the protocol state there are a bunch of
failures no longer possible due to all state information being
guaranteed to be present.  As part of this the QR-code state has been
extracted from the generic Lot structure to something suitable just
for the SecureJoin protocol.

A LogSink has been added to the testing tools allowing log messages to
be correctly displayed on test failures.
This commit is contained in:
Floris Bruynooghe
2021-01-10 19:07:24 +01:00
parent 4508eced37
commit 11e3380f65
7 changed files with 833 additions and 440 deletions

View File

@@ -2125,7 +2125,7 @@ mod tests {
.await
.unwrap();
let chat = d.chat_with_contact("", "dest@example.com").await;
let chat = d.create_chat_with_contact("", "dest@example.com").await;
let mut msg = Message::new(Viewtype::Text);
@@ -2141,7 +2141,7 @@ mod tests {
let d = test::TestContext::new().await;
let ctx = &d.ctx;
let chat = d.chat_with_contact("", "dest@example.com").await;
let chat = d.create_chat_with_contact("", "dest@example.com").await;
let mut msg = Message::new(Viewtype::Text);
@@ -2331,7 +2331,7 @@ mod tests {
.await
.unwrap();
let chat = d.chat_with_contact("", "dest@example.com").await;
let chat = d.create_chat_with_contact("", "dest@example.com").await;
let mut msg = Message::new(Viewtype::Text);
msg.set_text(Some("Quoted message".to_string()));