crypto: Move the Done state into the common verification module

master
Damir Jelić 2021-06-01 09:59:34 +02:00
parent 327445c6a0
commit d877c1cf8c
3 changed files with 14 additions and 14 deletions

View File

@ -41,6 +41,17 @@ use crate::{
use self::sas::CancelContent; 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)] #[derive(Clone, Debug)]
pub struct Cancelled { pub struct Cancelled {
cancel_code: CancelCode, cancel_code: CancelCode,

View File

@ -27,14 +27,13 @@ use matrix_sdk_common::{
use super::{ use super::{
event_enums::{AcceptContent, CancelContent, MacContent, OutgoingContent}, event_enums::{AcceptContent, CancelContent, MacContent, OutgoingContent},
sas_state::{ sas_state::{
Accepted, Confirmed, Created, Done, KeyReceived, MacReceived, SasState, Started, Accepted, Confirmed, Created, KeyReceived, MacReceived, SasState, Started, WaitingForDone,
WaitingForDone,
}, },
FlowId, StartContent, FlowId, StartContent,
}; };
use crate::{ use crate::{
identities::{ReadOnlyDevice, UserIdentities}, identities::{ReadOnlyDevice, UserIdentities},
verification::Cancelled, verification::{Cancelled, Done},
ReadOnlyAccount, ReadOnlyAccount,
}; };

View File

@ -52,7 +52,7 @@ use super::{
}; };
use crate::{ use crate::{
identities::{ReadOnlyDevice, UserIdentities}, identities::{ReadOnlyDevice, UserIdentities},
verification::{Cancelled, FlowId}, verification::{Cancelled, Done, FlowId},
ReadOnlyAccount, ReadOnlyAccount,
}; };
@ -271,16 +271,6 @@ pub struct WaitingForDone {
verified_master_keys: Arc<[UserIdentities]>, 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<S: Clone> SasState<S> { impl<S: Clone> SasState<S> {
/// Get our own user id. /// Get our own user id.
#[cfg(test)] #[cfg(test)]