From d877c1cf8c315d23cc712088901220dfce23de25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 1 Jun 2021 09:59:34 +0200 Subject: [PATCH] crypto: Move the Done state into the common verification module --- matrix_sdk_crypto/src/verification/mod.rs | 11 +++++++++++ matrix_sdk_crypto/src/verification/sas/inner_sas.rs | 5 ++--- matrix_sdk_crypto/src/verification/sas/sas_state.rs | 12 +----------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/matrix_sdk_crypto/src/verification/mod.rs b/matrix_sdk_crypto/src/verification/mod.rs index 63875e14..a443363c 100644 --- a/matrix_sdk_crypto/src/verification/mod.rs +++ b/matrix_sdk_crypto/src/verification/mod.rs @@ -41,6 +41,17 @@ use crate::{ use self::sas::CancelContent; +/// The verification state indicating that the verification finished +/// successfully. +/// +/// We can now mark the device in our verified devices lits as verified and sign +/// the master keys in the verified devices list. +#[derive(Clone, Debug)] +pub struct Done { + verified_devices: Arc<[ReadOnlyDevice]>, + verified_master_keys: Arc<[UserIdentities]>, +} + #[derive(Clone, Debug)] pub struct Cancelled { cancel_code: CancelCode, diff --git a/matrix_sdk_crypto/src/verification/sas/inner_sas.rs b/matrix_sdk_crypto/src/verification/sas/inner_sas.rs index 9f2b1ff7..ca767fa7 100644 --- a/matrix_sdk_crypto/src/verification/sas/inner_sas.rs +++ b/matrix_sdk_crypto/src/verification/sas/inner_sas.rs @@ -27,14 +27,13 @@ use matrix_sdk_common::{ use super::{ event_enums::{AcceptContent, CancelContent, MacContent, OutgoingContent}, sas_state::{ - Accepted, Confirmed, Created, Done, KeyReceived, MacReceived, SasState, Started, - WaitingForDone, + Accepted, Confirmed, Created, KeyReceived, MacReceived, SasState, Started, WaitingForDone, }, FlowId, StartContent, }; use crate::{ identities::{ReadOnlyDevice, UserIdentities}, - verification::Cancelled, + verification::{Cancelled, Done}, ReadOnlyAccount, }; diff --git a/matrix_sdk_crypto/src/verification/sas/sas_state.rs b/matrix_sdk_crypto/src/verification/sas/sas_state.rs index 80d7f6b3..364a35f3 100644 --- a/matrix_sdk_crypto/src/verification/sas/sas_state.rs +++ b/matrix_sdk_crypto/src/verification/sas/sas_state.rs @@ -52,7 +52,7 @@ use super::{ }; use crate::{ identities::{ReadOnlyDevice, UserIdentities}, - verification::{Cancelled, FlowId}, + verification::{Cancelled, Done, FlowId}, ReadOnlyAccount, }; @@ -271,16 +271,6 @@ pub struct WaitingForDone { verified_master_keys: Arc<[UserIdentities]>, } -/// The SAS state indicating that the verification finished successfully. -/// -/// We can now mark the device in our verified devices lits as verified and sign -/// the master keys in the verified devices list. -#[derive(Clone, Debug)] -pub struct Done { - verified_devices: Arc<[ReadOnlyDevice]>, - verified_master_keys: Arc<[UserIdentities]>, -} - impl SasState { /// Get our own user id. #[cfg(test)]