crypto: Move the Done state into the common verification module

This commit is contained in:
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;
/// 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,

View file

@ -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,
};

View file

@ -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<S: Clone> SasState<S> {
/// Get our own user id.
#[cfg(test)]