-
Notifications
You must be signed in to change notification settings - Fork 132
feature(e2ee): add data channel encryption #708
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
Conversation
| }; | ||
|
|
||
| #[tokio::main] | ||
| async fn main() -> Result<(), Box<dyn Error>> { |
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.
Nice example!
livekit/src/room/mod.rs
Outdated
| pub auto_subscribe: bool, | ||
| pub adaptive_stream: bool, | ||
| pub dynacast: bool, | ||
| #[deprecated(note = "Use `encryption` field instead, see x for a detailed explanation")] |
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 have something ready to link for "x"?
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.
currently wip, will wait for the actual link to update and merge
cloudwebrtc
left a comment
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.
lgtm!
| identity: String, | ||
| encryption_type: livekit_protocol::encryption::Type, | ||
| ) { | ||
| let Ok(info) = AnyStreamInfo::try_from_with_encryption(header, encryption_type.into()) |
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.
@ladvoc sorry, ended up messing with this anyways as I feel having the encryption type on the stream info does in fact make sense?
Let me know if you think that's unnecessary and I'll remove this again
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.
Yes, I think it makes sense to enforce the encryption type specified in the header.
| Internal, | ||
|
|
||
| #[error("encryption type mismatch")] | ||
| EncryptionTypeMismatch, |
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.
@ladvoc is it ok to introduce this as a new error type? I think we also forgot non_exhaustive here?
| type Error = StreamError; | ||
|
|
||
| fn try_from(mut header: proto::Header) -> Result<Self, Self::Error> { | ||
| Self::try_from_with_encryption(header, EncryptionType::None) |
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.
if we keep the new try_from_with_encryption, we could probably remove this one here
| identity: String, | ||
| encryption_type: livekit_protocol::encryption::Type, | ||
| ) { | ||
| let Ok(info) = AnyStreamInfo::try_from_with_encryption(header, encryption_type.into()) |
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.
Yes, I think it makes sense to enforce the encryption type specified in the header.
this PR adds data channel encryption capabilities.
For backwards compatibility this is not enabled on existing implementations.
Instead
RoomOptions.e2eeis being deprecated (no dc encryption) and a newRoomOptions.encryptionfield is introduced which enables data channel encryption