Skip to content

Commit

Permalink
crypto: Calculate sender data for incoming sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
andybalaam committed Jun 26, 2024
1 parent f4ad80b commit f1ad14a
Show file tree
Hide file tree
Showing 5 changed files with 882 additions and 3 deletions.
5 changes: 3 additions & 2 deletions crates/matrix-sdk-crypto/src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ use crate::{
identities::{user::UserIdentities, Device, IdentityManager, UserDevices},
olm::{
Account, CrossSigningStatus, EncryptionSettings, IdentityKeys, InboundGroupSession,
OlmDecryptionInfo, PrivateCrossSigningIdentity, SenderData, SessionType, StaticAccountData,
OlmDecryptionInfo, PrivateCrossSigningIdentity, SenderDataFinder, SessionType,
StaticAccountData,
},
requests::{IncomingResponse, OutgoingRequest, UploadSigningKeysRequest},
session_manager::{GroupSessionManager, SessionManager},
Expand Down Expand Up @@ -806,7 +807,7 @@ impl OlmMachine {
event: &DecryptedRoomKeyEvent,
content: &MegolmV1AesSha2Content,
) -> OlmResult<Option<InboundGroupSession>> {
let sender_data = SenderData::unknown();
let sender_data = SenderDataFinder::find(self, sender_key, event, content).await?;

let session = InboundGroupSession::new(
sender_key,
Expand Down
2 changes: 2 additions & 0 deletions crates/matrix-sdk-crypto/src/olm/group_sessions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ use serde::{Deserialize, Serialize};
mod inbound;
mod outbound;
mod sender_data;
mod sender_data_finder;

pub use inbound::{InboundGroupSession, PickledInboundGroupSession};
pub(crate) use outbound::ShareState;
pub use outbound::{
EncryptionSettings, OutboundGroupSession, PickledOutboundGroupSession, ShareInfo,
};
pub use sender_data::{SenderData, SenderDataRetryDetails};
pub(crate) use sender_data_finder::SenderDataFinder;
use thiserror::Error;
pub use vodozemac::megolm::{ExportedSessionKey, SessionKey};
use vodozemac::{megolm::SessionKeyDecodeError, Curve25519PublicKey};
Expand Down
Loading

0 comments on commit f1ad14a

Please sign in to comment.