Skip to content

Commit 7152714

Browse files
committed
crypto: Calculate sender data for incoming sessions
1 parent aea710c commit 7152714

File tree

5 files changed

+888
-3
lines changed

5 files changed

+888
-3
lines changed

crates/matrix-sdk-crypto/src/machine.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ use crate::{
6666
identities::{user::UserIdentities, Device, IdentityManager, UserDevices},
6767
olm::{
6868
Account, CrossSigningStatus, EncryptionSettings, IdentityKeys, InboundGroupSession,
69-
OlmDecryptionInfo, PrivateCrossSigningIdentity, SenderData, SessionType, StaticAccountData,
69+
OlmDecryptionInfo, PrivateCrossSigningIdentity, SenderDataFinder, SessionType,
70+
StaticAccountData,
7071
},
7172
requests::{IncomingResponse, OutgoingRequest, UploadSigningKeysRequest},
7273
session_manager::{GroupSessionManager, SessionManager},
@@ -809,7 +810,7 @@ impl OlmMachine {
809810
event: &DecryptedRoomKeyEvent,
810811
content: &MegolmV1AesSha2Content,
811812
) -> OlmResult<Option<InboundGroupSession>> {
812-
let sender_data = SenderData::unknown();
813+
let sender_data = SenderDataFinder::find(self, sender_key, event, content).await?;
813814

814815
let session = InboundGroupSession::new(
815816
sender_key,

crates/matrix-sdk-crypto/src/olm/group_sessions/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ use serde::{Deserialize, Serialize};
1818
mod inbound;
1919
mod outbound;
2020
mod sender_data;
21+
mod sender_data_finder;
2122

2223
pub use inbound::{InboundGroupSession, PickledInboundGroupSession};
2324
pub(crate) use outbound::ShareState;
2425
pub use outbound::{
2526
EncryptionSettings, OutboundGroupSession, PickledOutboundGroupSession, ShareInfo,
2627
};
2728
pub use sender_data::{SenderData, SenderDataRetryDetails};
29+
pub(crate) use sender_data_finder::SenderDataFinder;
2830
use thiserror::Error;
2931
pub use vodozemac::megolm::{ExportedSessionKey, SessionKey};
3032
use vodozemac::{megolm::SessionKeyDecodeError, Curve25519PublicKey};

0 commit comments

Comments
 (0)