crypto: Remove some unused imports.

master
Damir Jelić 2020-12-17 16:28:12 +01:00
parent 4ad4ad1e94
commit 48f43a4af1
7 changed files with 19 additions and 50 deletions

View File

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

View File

@ -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)]

View File

@ -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<Ready> {
fn start_sas(
self,
store: Arc<Box<dyn CryptoStore>>,
account: ReadOnlyAccount,
private_identity: PrivateCrossSigningIdentity,
other_device: ReadOnlyDevice,
other_identity: Option<UserIdentities>,
_store: Arc<Box<dyn CryptoStore>>,
_account: ReadOnlyAccount,
_private_identity: PrivateCrossSigningIdentity,
_other_device: ReadOnlyDevice,
_other_identity: Option<UserIdentities>,
) -> (Sas, OutgoingContent) {
todo!()
// Sas::start_in_room(

View File

@ -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::{

View File

@ -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<StartContent>,
other_identity: Option<UserIdentities>,
) -> Result<InnerSas, CancelContent> {
match SasState::<Started>::from_start_event(
account,
other_device,
other_identity,
&sender,
content,
) {
match SasState::<Started>::from_start_event(account, other_device, other_identity, content)
{
Ok(s) => Ok(InnerSas::Started(s)),
Err(s) => Err(s.as_content()),
}

View File

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

View File

@ -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<Started> {
account: ReadOnlyAccount,
other_device: ReadOnlyDevice,
other_identity: Option<UserIdentities>,
sender: &UserId,
content: impl Into<StartContent>,
) -> Result<SasState<Started>, SasState<Canceled>> {
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<UserIdentities>,
sender: &UserId,
content: &StartContent,
) -> Result<SasState<Started>, SasState<Canceled>> {
if let StartMethod::MSasV1(method_content) = content.method() {