Repository navigation
fix(e2ee): track the local encryption state separately from remote participants #2245
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
Changes from all commits
82effff
4813765
c29d674
786025d
22187c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'livekit-client': patch | ||
| --- | ||
|
|
||
| fix(e2ee): track the local encryption state separately from remote participants |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,13 @@ const MAX_PPS_ID_ENCRYPT_ATTEMPTS = 16; | |
|
|
||
| export const encryptionEnabledMap: Map<string, boolean> = new Map(); | ||
|
|
||
| let localEncryptionEnabled: boolean | undefined; | ||
|
|
||
| /** Sets whether local media is encrypted. */ | ||
| export function setLocalEncryptionEnabled(enabled: boolean | undefined) { | ||
| localEncryptionEnabled = enabled; | ||
| } | ||
|
|
||
| export interface FrameCryptorConstructor { | ||
| new (opts?: unknown): BaseFrameCryptor; | ||
| } | ||
|
|
@@ -472,7 +479,17 @@ export class FrameCryptor extends BaseFrameCryptor { | |
| return controller.enqueue(encodedFrame); | ||
| } | ||
|
|
||
| if (!this.isEnabled()) { | ||
| if (localEncryptionEnabled === undefined) { | ||
| this.emitThrottledError( | ||
| new CryptorError( | ||
| `encryption state unknown for track ${this.trackId}, dropping frame`, | ||
| CryptorErrorReason.InternalError, | ||
| this.participantIdentity, | ||
| ), | ||
| ); | ||
| return; | ||
| } | ||
| if (!localEncryptionEnabled) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should mitigate the risk now. |
||
| this.appendFrameMetadata(encodedFrame); | ||
| return controller.enqueue(encodedFrame); | ||
|
Comment on lines
+492
to
494
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One worker serves one room. Sharing a worker between rooms is not supported, and that was the case before this change. The |
||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.