Skip to content
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

crypto: encrypt, upload and share keys for room history #4864

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Mar 29, 2025

The next step of our plan to share room history (element-hq/element-meta#39). This PR adds the functionality to:

  • Build a blob of room keys
  • Upload it as an encrypted media file
  • Send the keys to the encrypted media file to a user's devices

Fixes: #4505

@richvdh richvdh force-pushed the rav/history_sharing/upload_bundle branch 3 times, most recently from 41d75d1 to ea0b176 Compare March 29, 2025 18:23
@richvdh richvdh force-pushed the rav/history_sharing/upload_bundle branch 2 times, most recently from f93d4a6 to 3149616 Compare April 8, 2025 11:25
@richvdh richvdh force-pushed the rav/history_sharing/upload_bundle branch from 3149616 to b2a6840 Compare April 8, 2025 12:18
The next step in our work on sharing encrypted room history. Add a method to
`matrix_sdk::room::Room` which will upload an encrypted key bundle.
@richvdh richvdh force-pushed the rav/history_sharing/upload_bundle branch 2 times, most recently from dbba10f to 211b9ad Compare April 8, 2025 14:10
richvdh added 4 commits April 8, 2025 18:02
For each device belonging to the user, encrypt and send to-device messages
containing the bundle data
This is only a partial test, since we haven't yet implemented the receiver side
of the history-sharing messages.
@richvdh richvdh force-pushed the rav/history_sharing/upload_bundle branch from 211b9ad to 7cb525f Compare April 8, 2025 17:02
@@ -178,9 +179,17 @@ impl<'a> IntoFuture for ShareRoomHistory<'a> {
"Uploaded encrypted key blob"
);

// 3. Send to-device messages to the recipient to share the keys.
// TODO
// 3. Establish Olm seeions with all of the recipient's devices
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
// 3. Establish Olm seeions with all of the recipient's devices
// 3. Establish Olm sessions with all of the recipient's devices.

@richvdh richvdh marked this pull request as ready for review April 9, 2025 09:45
@richvdh richvdh requested review from a team as code owners April 9, 2025 09:45
@richvdh richvdh requested review from poljar and removed request for a team April 9, 2025 09:45
@richvdh richvdh force-pushed the rav/history_sharing/upload_bundle branch from e5150ec to 632e1b6 Compare April 9, 2025 17:46
@richvdh richvdh force-pushed the rav/history_sharing/upload_bundle branch from 632e1b6 to e963311 Compare April 9, 2025 18:45
Copy link

codecov bot commented Apr 9, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 16 lines in your changes missing coverage. Please review.

Project coverage is 85.79%. Comparing base (35e13b8) to head (e963311).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/encryption/futures.rs 71.87% 9 Missing ⚠️
...k-crypto/src/session_manager/group_sessions/mod.rs 90.90% 6 Missing ⚠️
crates/matrix-sdk/src/room/mod.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4864      +/-   ##
==========================================
- Coverage   85.80%   85.79%   -0.01%     
==========================================
  Files         314      314              
  Lines       35739    35572     -167     
==========================================
- Hits        30666    30520     -146     
+ Misses       5073     5052      -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Encrypted history sharing: encrypt, upload and share keys to encrypted media blob
1 participant