Conversation
session_srtp.go
Outdated
| if pw, ok := s.session.nextConn.(interface { | ||
| WriteToPair(uint64, []byte) (int, error) | ||
| }); ok { |
There was a problem hiding this comment.
This assertion is unfortunate but since the underlying connection here is a net.Conn there's no strict requirement to actually support the same API.
There was a problem hiding this comment.
On the other hand, this change also makes this API unintentionally backwards-compatible so we don't actually need to bump pion/ice and it will get picked up when the parent updates the dep version...
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (44.44%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #360 +/- ##
==========================================
- Coverage 82.63% 82.55% -0.08%
==========================================
Files 19 19
Lines 1457 1462 +5
==========================================
+ Hits 1204 1207 +3
- Misses 140 141 +1
- Partials 113 114 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bff53d0 to
8ef47c8
Compare
Exposes `EncryptRTP()` which returns encrypted bytes, allowing callers to write to any destination. This avoids leaking ICE semantics into the SRTP layer. See pion/ice#863.
8ef47c8 to
62a3afc
Compare
|
@kevmo314 maybe we have to think about also datachannels, and adding batching in the future, maybe it should be some sort of conn that works with srtp, sctp without any change, Maybe I'm missing something, but I just don't want us to maintain multiple write paths, especially if we're going to add batch writer soon. |
If we do not want ICE semantics to leak into SRTP, then SRTP cannot know about the existence of multiple paths since the Exposing a separate encrypt API therefore seems reasonable, as it's signalling that "I want this packet processed but I will manage the sending myself". That fits in with the batching and datachannels context you raised as well, since it is up to the caller to get the packet to the destination and the caller is choosing to opt out of those features, which seems reasonable. The crux of the issue is the necessary statefulness of SRTP though: Line 146 in 030374f |
Description
Exposes
EncryptRTP()to allow users to manually encrypt packets.See pion/ice#863.
Reference issue
Fixes #...