Skip to content

Conversation

@Half-Shot
Copy link
Contributor

We still use olm in one place in Pipe to support encrypting room backups across different clients. This exposes the ability for us to run the encryption function via the Rust SDK instead which means we can stop using Olm entirely \o/

src/backup.rs Outdated
}

#[napi(strict)]
pub async fn encrypt(&self, exported_session_json: String) -> napi::Result<KeyBackupData> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this json get retrieved?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, comes from export_room_keys_for_session. I should document that really!

Comment on lines 66 to 73
Ok(KeyBackupData {
first_message_index: res.first_message_index.into(),
forwarded_count: res.forwarded_count.into(),
is_verified: res.is_verified,
session_data_ephemeral: res.session_data.ephemeral.to_string(),
session_data_ciphertext: res.session_data.ciphertext.to_string(),
session_data_mac: res.session_data.mac.to_string(),
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this response be used anywhere? If the job of this method is to encrypt the data, it seems odd to also return that data. Then again, it's returned by InnerMegolmV1BackupKey.encrypt, so it's a pattern we could repeat here.

@Half-Shot Half-Shot requested a review from AndrewFerr July 26, 2024 11:24
@Half-Shot
Copy link
Contributor Author

This is held up on me writing a sufficient test case on the other side, fwiw.

@Half-Shot Half-Shot self-assigned this Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants