Repository navigation
Connect DTLS without a negotiated SRTP profile - #3699
Open
HashimTheArab wants to merge 1 commit into
Open
HashimTheArab wants to merge 1 commit into
HashimTheArab wants to merge 1 commit into
Conversation
A peer may decline the use_srtp extension (RFC 5764 Section 4.1.1), as data-channel-only endpoints such as some NetherNet servers do. The transport failed with ErrNoSRTPProtectionProfile even though data channels never use SRTP. libwebrtc logs the missing crypto suite and keeps the transport connected. Keep the transport connected when no profile was negotiated and media is not wanted; starting SRTP later returns ErrNoSRTPProtectionProfile, and a transport that already wants media still fails as before.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3699 +/- ##
==========================================
+ Coverage 90.59% 90.62% +0.02%
==========================================
Files 83 83
Lines 9170 9174 +4
==========================================
+ Hits 8308 8314 +6
+ Misses 862 860 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
DTLSTransportfails withErrNoSRTPProtectionProfilewhenever the handshake completes without a negotiated SRTP profile, even if the connection only carries data channels.A peer is allowed to leave out
use_srtp(RFC 5764 Section 4.1.1), and some data-channel-only endpoints do. Minecraft Bedrock's WebRTC transport is one example: some of its servers take the DTLS client role and send nouse_srtp. libwebrtc connects to these peers, because a failed SRTP key setup does not fail its DTLS transport, so data channels keep working. Pion fails the transport, so SCTP never starts.SettingEnginecan't work around this. The profile comes from the peer'sClientHello, and the DTLS message hooks only change messages Pion sends.This change keeps the transport connected when no profile was negotiated and SRTP is not wanted. The missing profile is remembered, so starting SRTP later returns
ErrNoSRTPProtectionProfile. A transport that already wants SRTP fails as before.Pion is the DTLS server in this case. If Pion is the DTLS client and the server leaves out
use_srtp, pion/dtls still aborts the handshake witherrRequestedButNoSRTPExtension. This PR does not change that.Testing
TestDTLSTransport_Start_ConnectsWithoutSRTPProfilefails without the change and passes with it.