Skip to content

feat(E2EE): Async E2EE keys exchange#32197

Merged
ggazzo merged 75 commits intodevelopfrom
e2e-async-key-exchange
Jun 22, 2024
Merged

feat(E2EE): Async E2EE keys exchange#32197
ggazzo merged 75 commits intodevelopfrom
e2e-async-key-exchange

Conversation

@yash-rajpal
Copy link
Copy Markdown
Member

@yash-rajpal yash-rajpal commented Apr 12, 2024

Proposed changes (including videos or screenshots)

Async key distribution process for E2EE rooms. Earlier users needed to be online to receive and share and verify the group keys which caused a bottleneck in the process. Made this process async so that users now no longer need to be online at the same time.

Keys will be generated even when the users are offline and they can receive it when they come online.

Issue(s)

Steps to test or reproduce

  • Add a few users in an E2EE room
  • reset the E2EE for few users
  • Log back in with those users (just to create their public keys)
  • When the main users comes online in the E2EE room, it will generate the keys for all the users waiting in queue.
  • When users come online they receive keys and E2EE rooms messages are decrypted.

Further comments

E2EE-13

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 12, 2024

🦋 Changeset detected

Latest commit: dcd8fe9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@rocket.chat/model-typings Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/meteor Minor
@rocket.chat/apps Patch
@rocket.chat/models Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/omnichannel-services Patch
rocketchat-services Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/ui-contexts Major
@rocket.chat/api-client Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
@rocket.chat/ddp-client Patch
@rocket.chat/instance-status Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/web-ui-registration Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Apr 12, 2024

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 12, 2024

Codecov Report

Attention: Patch coverage is 59.55882% with 55 lines in your changes missing coverage. Please review.

Project coverage is 56.71%. Comparing base (1240c87) to head (dcd8fe9).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #32197      +/-   ##
===========================================
- Coverage    56.74%   56.71%   -0.03%     
===========================================
  Files         2495     2496       +1     
  Lines        55237    55360     +123     
  Branches     11434    11455      +21     
===========================================
+ Hits         31345    31400      +55     
- Misses       21196    21255      +59     
- Partials      2696     2705       +9     
Flag Coverage Δ
e2e 56.45% <59.55%> (-0.06%) ⬇️
unit 71.86% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@yash-rajpal yash-rajpal marked this pull request as ready for review April 15, 2024 19:39
@yash-rajpal yash-rajpal requested review from a team as code owners April 15, 2024 19:39
Copy link
Copy Markdown
Contributor

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

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

I still have some general comments:

  • Let's improve the PR description.
  • We need to add a changeset.
  • We can have some API tests to test at least half of the workflow, we can call the provideUsersGroupKeys endpoint with arbitrary values for keys, and see if the keys were set to the subscriptions. Of course, the test will not be fully complete, and test it using an UI test could potentially create a slow test, since the process is completely async.

@MarcosSpessatto MarcosSpessatto changed the title feat: Async E2E keys exchange feat(E2EE): Async E2EE keys exchange Apr 23, 2024
@yash-rajpal yash-rajpal dismissed stale reviews from MarcosSpessatto and KevLehman via e3cd670 June 20, 2024 19:45
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Jun 20, 2024
@rodrigok rodrigok removed their request for review June 20, 2024 20:42
@rodrigok rodrigok dismissed their stale review June 20, 2024 20:42

Dismissed

KevLehman
KevLehman previously approved these changes Jun 20, 2024
hugocostadev
hugocostadev previously approved these changes Jun 21, 2024
@yash-rajpal yash-rajpal added the stat: ready to merge PR tested and approved waiting for merge label Jun 21, 2024
@ggazzo ggazzo dismissed stale reviews from hugocostadev, MarcosSpessatto, and KevLehman via 2b0062a June 22, 2024 03:07
@ggazzo ggazzo force-pushed the e2e-async-key-exchange branch from 8142a8d to 6048635 Compare June 22, 2024 14:07
@ggazzo ggazzo merged commit f75a2cb into develop Jun 22, 2024
@ggazzo ggazzo deleted the e2e-async-key-exchange branch June 22, 2024 18:08
This was referenced Jun 22, 2024
Copy link
Copy Markdown
Member

@cardoso cardoso left a comment

Choose a reason for hiding this comment

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

This PR deprecated the e2e.updateGroupKey endpoint and removed its usage, however the usage was reintroduced in 7.0.0: #33328

validateParams: ise2eUpdateGroupKeyParamsPOST,
deprecation: {
version: '8.0.0',
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Deprecated here

Comment on lines -339 to +356
// Key has been encrypted. Publish to that user's subscription model for this room.
await sdk.call('e2e.updateGroupKey', this.roomId, user._id, this.keyID + Base64.encode(new Uint8Array(encryptedUserKey)));
const encryptedUserKeyToString = this.keyID + Base64.encode(new Uint8Array(encryptedUserKey));
return encryptedUserKeyToString;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Usage removed here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants