Skip to content

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

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

Merged
merged 7 commits into from
Apr 15, 2025

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 4 times, most recently from 211b9ad to 7cb525f Compare April 8, 2025 17:02
@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 2 times, most recently from 632e1b6 to e963311 Compare April 9, 2025 18:45
Copy link

codecov bot commented Apr 9, 2025

Codecov Report

Attention: Patch coverage is 91.91919% with 8 lines in your changes missing coverage. Please review.

Project coverage is 85.95%. Comparing base (dc6fe93) to head (1a4f6ef).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...k-crypto/src/session_manager/group_sessions/mod.rs 90.90% 6 Missing ⚠️
crates/matrix-sdk/src/room/shared_room_history.rs 92.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4864      +/-   ##
==========================================
+ Coverage   85.84%   85.95%   +0.11%     
==========================================
  Files         323      324       +1     
  Lines       35515    35611      +96     
==========================================
+ Hits        30487    30610     +123     
+ Misses       5028     5001      -27     

☔ 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.

@richvdh richvdh force-pushed the rav/history_sharing/upload_bundle branch 3 times, most recently from 6963c22 to 548cd49 Compare April 11, 2025 14:55
@poljar
Copy link
Contributor

poljar commented Apr 11, 2025

I wish github would show when someone presses the "Start Review" button, I guess I could have also told you.

Is there more coming, should I wait for things to calm down?

@richvdh
Copy link
Member Author

richvdh commented Apr 11, 2025

oh, sorry. Occasionally we use an 👀 reaction on the PR to denote "I'm looking at this".

I'm not planning any more work on this, though that was also the case this morning, and then things changed. Let me see what's wrong with the CI, then I'll leave it alone.

@richvdh richvdh force-pushed the rav/history_sharing/upload_bundle branch from 5b6962b to 000b630 Compare April 11, 2025 15:10
Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

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

Left some comments and questions. I think most of it makes sense.

@richvdh richvdh requested review from poljar and removed request for poljar April 14, 2025 15:30
@richvdh richvdh force-pushed the rav/history_sharing/upload_bundle branch from 7ba8967 to 2420934 Compare April 14, 2025 15:35
@richvdh richvdh requested review from poljar and removed request for poljar April 14, 2025 17:30
@richvdh richvdh requested a review from poljar April 14, 2025 17:55
Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

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

Thanks, looks good now.

richvdh added 5 commits April 15, 2025 12:55
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.
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 a600c49 to 80db096 Compare April 15, 2025 11:56
@richvdh richvdh enabled auto-merge April 15, 2025 16:43
@richvdh richvdh merged commit ed232df into main Apr 15, 2025
42 checks passed
@richvdh richvdh deleted the rav/history_sharing/upload_bundle branch April 15, 2025 17:00
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
2 participants