client-sdk-swift icon indicating copy to clipboard operation
client-sdk-swift copied to clipboard

Integrate E2EE Manager

Open hiroshihorie opened this issue 1 year ago • 7 comments

  • Current E2EE manager holds strong reference to RemoteParticipants, try to solve this since it causes issues.
  • Add frame cryptors to simulcast senders also.

New design:

  • Internal E2EEManager class is removed and Track holds FrameCryptors instead.
  • RtpSender/Receivers are in pair with FrameCryptors.
  • Doesn't break current release.
  • [x] isEnabled property
  • [x] Delegate

hiroshihorie avatar Feb 12 '24 08:02 hiroshihorie

I like the idea behind this! How would the new design allow for encryption to be enabled/disabled ?

lukasIO avatar Feb 12 '24 15:02 lukasIO

I haven't ported that from E2EE manager yet, also the delegate.

hiroshihorie avatar Feb 12 '24 18:02 hiroshihorie

Build with this changes have been uploaded to tesflight.

hiroshihorie avatar Feb 12 '24 20:02 hiroshihorie

more of a general question, would it make sense to un-set the cryptors also when tracks have ended ? Basically just thinking about how this would get cleaned up properly

lukasIO avatar Feb 13 '24 08:02 lukasIO

A good point regarding cleaning up the cryptors and other properties of the track. Currently sender/receivers and cryptors will be reset if track is re-published.

I'll check how FrameCryptor retains reference to keyprovider etc. But looks like there are no memory leaks when the Room is closed.

While publishing video / mic: Screenshot 2024-02-15 17 48 00

After room is closed: Screenshot 2024-02-15 17 50 23

hiroshihorie avatar Feb 15 '24 09:02 hiroshihorie

Nice, thanks for checking! Is the same true for unpublishing a single track instead of disconnecting the room? Thinking about cases where users publish/unpublish tracks often.

lukasIO avatar Feb 16 '24 08:02 lukasIO

Thanks, might need to re-structure/design this.

hiroshihorie avatar Feb 16 '24 18:02 hiroshihorie