-
Notifications
You must be signed in to change notification settings - Fork 238
Add e2ee for data channel messages #1595
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 13 commits
a215807
9fde033
c8c13a4
5cc484c
98debe6
70aa399
76041ab
8401f3a
b84eaa1
0674e81
1f162cd
393e8a4
fe7fd7a
c06e074
1f08b63
09c8f21
fa5cd09
239448f
57037da
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 | ||
| --- | ||
|
|
||
| Add preliminary support for data message decryption |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| import { type DataPacket, EncryptedPacketPayload } from '@livekit/protocol'; | ||
| import { ENCRYPTION_ALGORITHM } from './constants'; | ||
|
|
||
| export function isE2EESupported() { | ||
|
|
@@ -176,3 +177,18 @@ export function writeRbsp(data_in: Uint8Array): Uint8Array { | |
| } | ||
| return new Uint8Array(dataOut); | ||
| } | ||
|
|
||
| export function asEncryptablePacket(packet: DataPacket): EncryptedPacketPayload | undefined { | ||
| if ( | ||
| packet.value?.case !== 'sipDtmf' && | ||
| packet.value?.case !== 'metrics' && | ||
|
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. Looks like metrics is encryptable? livekit/protocol@72e862b#diff-65ff73125c901a7593f1b81ac2dfa070f5d617c4fa3aebb570d36618526c3d89R313
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. In theory yes, the question is how that would handled for the dashboard were you'd want to see the metrics |
||
| packet.value?.case !== 'speaker' && | ||
| packet.value?.case !== 'transcription' && | ||
| packet.value?.case !== 'encryptedPacket' | ||
| ) { | ||
| return new EncryptedPacketPayload({ | ||
| value: packet.value, | ||
| }); | ||
| } | ||
| return undefined; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to expose
dcEncryptionEnabledhere, or just assign based on the type ofoptions(old vs new)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in JS
E2EEManageris an internal class, so this is not really a big concern to me.We can of course also make it part of the E2EEManagerOptions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I see why I didn't do this in the first place, as the
E2EEManagerOptionsare actually exposed to users under an alias right now.