Skip to content
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

Skip some validation checks when BUNDLE group value is found #2735

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions peerconnection_go_test.go
Expand Up @@ -1399,6 +1399,7 @@ func TestTransceiverCreatedByRemoteSdpHasSameCodecOrderAsRemote(t *testing.T) {
o=- 4596489990601351948 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE video-0 video-1
m=video 60323 UDP/TLS/RTP/SAVPF 98 94 106
a=ice-ufrag:1/MvHwjAyVf27aLu
a=ice-pwd:3dBU7cFOBl120v33cynDvN1E
Expand Down Expand Up @@ -1459,6 +1460,7 @@ a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01
o=- 4596489990601351948 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE video-0 video-1
m=video 60323 UDP/TLS/RTP/SAVPF 98 106
a=ice-ufrag:1/MvHwjAyVf27aLu
a=ice-pwd:3dBU7cFOBl120v33cynDvN1E
Expand Down
24 changes: 15 additions & 9 deletions sdp.go
Expand Up @@ -709,8 +709,13 @@ func extractFingerprint(desc *sdp.SessionDescription) (string, string, error) {
return "", "", ErrSessionDescriptionNoFingerprint
}

for _, m := range fingerprints {
if m != fingerprints[0] {
// https://github.com/pion/webrtc/issues/2621
groupAttribue, _ := desc.Attribute(sdp.AttrKeyGroup)

isBundled := strings.Contains(groupAttribue, "BUNDLE")

if !isBundled {
if len(fingerprints) != 1 {
return "", "", ErrSessionDescriptionConflictingFingerprints
}
}
Expand Down Expand Up @@ -769,14 +774,15 @@ func extractICEDetails(desc *sdp.SessionDescription, log logging.LeveledLogger)
return "", "", nil, ErrSessionDescriptionMissingIcePwd
}

for _, m := range remoteUfrags {
if m != remoteUfrags[0] {
return "", "", nil, ErrSessionDescriptionConflictingIceUfrag
}
}
// https://github.com/pion/webrtc/issues/2621
groupAttribue, _ := desc.Attribute(sdp.AttrKeyGroup)

isBundled := strings.Contains(groupAttribue, "BUNDLE")

for _, m := range remotePwds {
if m != remotePwds[0] {
if !isBundled {
if len(remoteUfrags) != 1 {
return "", "", nil, ErrSessionDescriptionConflictingIceUfrag
} else if len(remotePwds) != 1 {
return "", "", nil, ErrSessionDescriptionConflictingIcePwd
}
}
Expand Down