-
Couldn't load subscription status.
- Fork 10
Add backup encryption function #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
src/backup.rs
Outdated
| } | ||
|
|
||
| #[napi(strict)] | ||
| pub async fn encrypt(&self, exported_session_json: String) -> napi::Result<KeyBackupData> { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
| 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(), | ||
| }) |
There was a problem hiding this comment.
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.
|
This is held up on me writing a sufficient test case on the other side, fwiw. |
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/