diff --git a/crates/matrix-sdk-crypto/CHANGELOG.md b/crates/matrix-sdk-crypto/CHANGELOG.md index 314d000b3..2016f4b6d 100644 --- a/crates/matrix-sdk-crypto/CHANGELOG.md +++ b/crates/matrix-sdk-crypto/CHANGELOG.md @@ -1,5 +1,8 @@ # unreleased +- Use the `Signatures` type as the return value for the + `MegolmV1BackupKey::signatures()` method. + - Add two new methods to import room keys, `OlmMachine::store()::import_exported_room_keys()` for file exports and `OlmMachine::backup_machine()::import_backed_up_room_keys()` for backups. The diff --git a/crates/matrix-sdk-crypto/src/backups/keys/backup.rs b/crates/matrix-sdk-crypto/src/backups/keys/backup.rs index c550b2184..2dd8b0ba7 100644 --- a/crates/matrix-sdk-crypto/src/backups/keys/backup.rs +++ b/crates/matrix-sdk-crypto/src/backups/keys/backup.rs @@ -12,26 +12,25 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::{ - collections::BTreeMap, - sync::{Arc, Mutex}, -}; +use std::sync::{Arc, Mutex}; use ruma::{ api::client::backup::{EncryptedSessionDataInit, KeyBackupData, KeyBackupDataInit}, serde::Base64, - OwnedDeviceKeyId, OwnedUserId, }; use vodozemac::Curve25519PublicKey; use zeroize::Zeroizing; use super::{compat::PkEncryption, decryption::DecodeError}; -use crate::olm::InboundGroupSession; +use crate::{ + olm::InboundGroupSession, + types::{MegolmV1AuthData, RoomKeyBackupInfo, Signatures}, +}; #[derive(Debug)] struct InnerBackupKey { key: Curve25519PublicKey, - signatures: BTreeMap>, + signatures: Signatures, version: Mutex>, } @@ -70,7 +69,7 @@ impl MegolmV1BackupKey { } /// Get all the signatures of this `MegolmV1BackupKey`. - pub fn signatures(&self) -> BTreeMap> { + pub fn signatures(&self) -> Signatures { self.inner.signatures.to_owned() }