diff --git a/matrix_sdk_crypto/src/identities/device.rs b/matrix_sdk_crypto/src/identities/device.rs index 377a7d45..f732cc19 100644 --- a/matrix_sdk_crypto/src/identities/device.rs +++ b/matrix_sdk_crypto/src/identities/device.rs @@ -42,7 +42,7 @@ use tracing::warn; use crate::{ olm::{InboundGroupSession, PrivateCrossSigningIdentity, Session}, store::{Changes, DeviceChanges}, - OutgoingRequest, OutgoingRequests, OutgoingVerificationRequest, + OutgoingVerificationRequest, }; #[cfg(test)] use crate::{OlmMachine, ReadOnlyAccount}; diff --git a/matrix_sdk_crypto/src/verification/machine.rs b/matrix_sdk_crypto/src/verification/machine.rs index b0ebffe2..2a845bfd 100644 --- a/matrix_sdk_crypto/src/verification/machine.rs +++ b/matrix_sdk_crypto/src/verification/machine.rs @@ -21,7 +21,7 @@ use tracing::{info, trace, warn}; use matrix_sdk_common::{ events::{ room::message::MessageEventContent, AnyMessageEvent, AnySyncMessageEvent, AnySyncRoomEvent, - AnyToDeviceEvent, AnyToDeviceEventContent, + AnyToDeviceEvent, }, identifiers::{DeviceId, EventId, RoomId, UserId}, locks::Mutex, @@ -35,10 +35,9 @@ use super::{ use crate::{ olm::PrivateCrossSigningIdentity, - requests::{OutgoingRequest, ToDeviceRequest}, + requests::OutgoingRequest, store::{CryptoStore, CryptoStoreError}, - OutgoingRequests, OutgoingVerificationRequest, ReadOnlyAccount, ReadOnlyDevice, - RoomMessageRequest, + OutgoingVerificationRequest, ReadOnlyAccount, ReadOnlyDevice, RoomMessageRequest, }; #[derive(Clone, Debug)] diff --git a/matrix_sdk_crypto/src/verification/requests.rs b/matrix_sdk_crypto/src/verification/requests.rs index c7f9d950..393c9fbc 100644 --- a/matrix_sdk_crypto/src/verification/requests.rs +++ b/matrix_sdk_crypto/src/verification/requests.rs @@ -31,10 +31,10 @@ use matrix_sdk_common::{ use crate::{ olm::{PrivateCrossSigningIdentity, ReadOnlyAccount}, store::CryptoStore, - ReadOnlyDevice, Sas, UserIdentities, UserIdentity, + ReadOnlyDevice, Sas, UserIdentities, }; -use super::sas::{OutgoingContent, StartContent}; +use super::sas::OutgoingContent; const SUPPORTED_METHODS: &[VerificationMethod] = &[VerificationMethod::MSasV1]; @@ -321,11 +321,11 @@ impl RequestState { fn start_sas( self, - store: Arc>, - account: ReadOnlyAccount, - private_identity: PrivateCrossSigningIdentity, - other_device: ReadOnlyDevice, - other_identity: Option, + _store: Arc>, + _account: ReadOnlyAccount, + _private_identity: PrivateCrossSigningIdentity, + _other_device: ReadOnlyDevice, + _other_identity: Option, ) -> (Sas, OutgoingContent) { todo!() // Sas::start_in_room( diff --git a/matrix_sdk_crypto/src/verification/sas/helpers.rs b/matrix_sdk_crypto/src/verification/sas/helpers.rs index fd6f4bca..db6eec84 100644 --- a/matrix_sdk_crypto/src/verification/sas/helpers.rs +++ b/matrix_sdk_crypto/src/verification/sas/helpers.rs @@ -25,14 +25,12 @@ use matrix_sdk_common::{ key::verification::{ cancel::CancelCode, mac::{MacEventContent, MacToDeviceEventContent}, - start::StartToDeviceEventContent, Relation, }, - AnyToDeviceEventContent, EventType, ToDeviceEvent, + AnyToDeviceEventContent, EventType, }, identifiers::{DeviceId, DeviceKeyAlgorithm, DeviceKeyId, UserId}, uuid::Uuid, - CanonicalJsonValue, }; use crate::{ diff --git a/matrix_sdk_crypto/src/verification/sas/inner_sas.rs b/matrix_sdk_crypto/src/verification/sas/inner_sas.rs index f10388b0..3b4dbfdf 100644 --- a/matrix_sdk_crypto/src/verification/sas/inner_sas.rs +++ b/matrix_sdk_crypto/src/verification/sas/inner_sas.rs @@ -18,19 +18,9 @@ use std::time::Instant; use std::sync::Arc; use matrix_sdk_common::{ - events::{ - key::verification::{ - accept::AcceptToDeviceEventContent, - cancel::CancelCode, - mac::MacToDeviceEventContent, - start::{StartEventContent, StartToDeviceEventContent}, - }, - AnyMessageEvent, AnyMessageEventContent, AnySyncMessageEvent, AnyToDeviceEvent, - AnyToDeviceEventContent, MessageEvent, ToDeviceEvent, - }, + events::{key::verification::cancel::CancelCode, AnyMessageEvent, AnyToDeviceEvent}, identifiers::{EventId, RoomId, UserId}, }; -use tracing::trace; use crate::{ identities::{ReadOnlyDevice, UserIdentities}, @@ -96,13 +86,8 @@ impl InnerSas { content: impl Into, other_identity: Option, ) -> Result { - match SasState::::from_start_event( - account, - other_device, - other_identity, - &sender, - content, - ) { + match SasState::::from_start_event(account, other_device, other_identity, content) + { Ok(s) => Ok(InnerSas::Started(s)), Err(s) => Err(s.as_content()), } diff --git a/matrix_sdk_crypto/src/verification/sas/mod.rs b/matrix_sdk_crypto/src/verification/sas/mod.rs index 8ee330d4..68bf810b 100644 --- a/matrix_sdk_crypto/src/verification/sas/mod.rs +++ b/matrix_sdk_crypto/src/verification/sas/mod.rs @@ -27,12 +27,8 @@ use tracing::{error, info, trace, warn}; use matrix_sdk_common::{ api::r0::keys::upload_signatures::Request as SignatureUploadRequest, events::{ - key::verification::{ - cancel::CancelCode, - start::{StartEventContent, StartToDeviceEventContent}, - }, - AnyMessageEvent, AnyMessageEventContent, AnySyncMessageEvent, AnyToDeviceEvent, - AnyToDeviceEventContent, MessageEvent, ToDeviceEvent, + key::verification::cancel::CancelCode, AnyMessageEvent, AnyMessageEventContent, + AnyToDeviceEvent, AnyToDeviceEventContent, }, identifiers::{DeviceId, EventId, RoomId, UserId}, uuid::Uuid, diff --git a/matrix_sdk_crypto/src/verification/sas/sas_state.rs b/matrix_sdk_crypto/src/verification/sas/sas_state.rs index ed4876cb..d4cb9c8a 100644 --- a/matrix_sdk_crypto/src/verification/sas/sas_state.rs +++ b/matrix_sdk_crypto/src/verification/sas/sas_state.rs @@ -31,7 +31,6 @@ use matrix_sdk_common::{ cancel::{CancelCode, CancelEventContent, CancelToDeviceEventContent}, done::DoneEventContent, key::{KeyEventContent, KeyToDeviceEventContent}, - mac::MacToDeviceEventContent, start::{ MSasV1Content, MSasV1ContentInit, StartEventContent, StartMethod, StartToDeviceEventContent, @@ -39,7 +38,7 @@ use matrix_sdk_common::{ HashAlgorithm, KeyAgreementProtocol, MessageAuthenticationCode, Relation, ShortAuthenticationString, VerificationMethod, }, - AnyMessageEventContent, AnyToDeviceEventContent, MessageEvent, ToDeviceEvent, + ToDeviceEvent, }, identifiers::{DeviceId, EventId, RoomId, UserId}, uuid::Uuid, @@ -495,23 +494,15 @@ impl SasState { account: ReadOnlyAccount, other_device: ReadOnlyDevice, other_identity: Option, - sender: &UserId, content: impl Into, ) -> Result, SasState> { - Self::from_start_helper( - account, - other_device, - other_identity, - sender, - &content.into(), - ) + Self::from_start_helper(account, other_device, other_identity, &content.into()) } fn from_start_helper( account: ReadOnlyAccount, other_device: ReadOnlyDevice, other_identity: Option, - sender: &UserId, content: &StartContent, ) -> Result, SasState> { if let StartMethod::MSasV1(method_content) = content.method() {