Skip to content

MatrixRTC: Refactor | Introduce a new Encryption manager (used with experimental to device transport) #4799

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 32 commits into from
Jul 8, 2025

Conversation

BillCarsonFr
Copy link
Member

@BillCarsonFr BillCarsonFr commented Apr 11, 2025

Add a new simplified EncryptionManager that will rotate the key for any membership change (join or leave or same)

There is no specific experimental flag to use it, it will use it for to device transport

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

@BillCarsonFr BillCarsonFr added the T-Task Tasks for the team like planning label Apr 11, 2025
Comment on lines 84 to 87
public getEncryptionKeys(): Map<string, Array<{ key: Uint8Array; timestamp: number }>> {
// This is deprecated should be ignored. Only use by tests?
return new Map();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The deprecation could already be added to IEncryptionManager (@deprecated)

@dbkr dbkr marked this pull request as draft June 30, 2025 12:07
import { type CallMembership } from "./CallMembership.ts";
import { decodeBase64, encodeBase64 } from "../base64.ts";
import { type IKeyTransport, type KeyTransportEventListener, KeyTransportEvents } from "./IKeyTransport.ts";
import { logger as rootLogger, type Logger } from "../logger.ts";
Copy link
Member

Choose a reason for hiding this comment

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

please don't use logger.logger in new code: we should be threading the correct logger through from the parent MatrixClient.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@toger5 toger5 left a comment

Choose a reason for hiding this comment

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

Did a sync (call) review session.

Open todos:

  • solve reemission (possible missing keys) situation
    • either by adding a stop gap key buffer to the new encryption manager
    • or by forcing to allocate + subscribe on joinRoomSession (passing the matrixKeyProvider (as a keySink interface) to joinRoomSession

@BillCarsonFr BillCarsonFr marked this pull request as ready for review July 8, 2025 11:21
@BillCarsonFr BillCarsonFr added this pull request to the merge queue Jul 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 8, 2025
@BillCarsonFr BillCarsonFr added this pull request to the merge queue Jul 8, 2025
Merged via the queue into develop with commit e5c8c20 Jul 8, 2025
32 checks passed
@BillCarsonFr BillCarsonFr deleted the valere/rtc/simple_encryption_manager branch July 8, 2025 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants