Skip to content

Commit 534e50d

Browse files
committed
fix(crypto): Rename the enable_backup method so we can add a v2 one
1 parent 1ffa068 commit 534e50d

File tree

1 file changed

+8
-2
lines changed
  • crates/matrix-sdk-crypto/src/backups

1 file changed

+8
-2
lines changed

crates/matrix-sdk-crypto/src/backups/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,13 @@ impl BackupMachine {
179179

180180
/// Activate the given backup key to be used to encrypt and backup room
181181
/// keys.
182-
pub async fn enable_backup(&self, key: MegolmV1BackupKey) -> Result<(), CryptoStoreError> {
182+
///
183+
/// This will use the [`m.megolm_backup.v1.curve25519-aes-sha2`] algorithm
184+
/// to encrypt the room keys.
185+
///
186+
/// [`m.megolm_backup.v1.curve25519-aes-sha2`]:
187+
/// https://spec.matrix.org/unstable/client-server-api/#backup-algorithm-mmegolm_backupv1curve25519-aes-sha2
188+
pub async fn enable_backup_v1(&self, key: MegolmV1BackupKey) -> Result<(), CryptoStoreError> {
183189
if key.backup_version().is_some() {
184190
*self.backup_key.write().await = Some(key.clone());
185191
info!(backup_key =? key, "Activated a backup");
@@ -414,7 +420,7 @@ mod test {
414420
let backup_key = recovery_key.public_key();
415421
backup_key.set_version("1".to_owned());
416422

417-
backup_machine.enable_backup(backup_key).await?;
423+
backup_machine.enable_backup_v1(backup_key).await?;
418424

419425
let request =
420426
backup_machine.backup().await?.expect("Created a backup request successfully");

0 commit comments

Comments
 (0)