From b5d4b4f47675fd0e1adc8d54b9613309b1a4211d Mon Sep 17 00:00:00 2001 From: Stephan Rotolante Date: Sun, 7 Apr 2024 02:28:38 -0400 Subject: [PATCH] Skip some validation checks when BUNDLE group value is found Resolves #2621 --- sdp.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sdp.go b/sdp.go index 980f9850779..0b034d294ab 100644 --- a/sdp.go +++ b/sdp.go @@ -709,8 +709,13 @@ func extractFingerprint(desc *sdp.SessionDescription) (string, string, error) { return "", "", ErrSessionDescriptionNoFingerprint } + // https://github.com/pion/webrtc/issues/2621 + groupAttribue, _ := desc.Attribute(sdp.AttrKeyGroup) + + isBundled := strings.Contains(groupAttribue, "BUNDLE") + for _, m := range fingerprints { - if m != fingerprints[0] { + if m != fingerprints[0] && !isBundled { return "", "", ErrSessionDescriptionConflictingFingerprints } } @@ -769,14 +774,19 @@ func extractICEDetails(desc *sdp.SessionDescription, log logging.LeveledLogger) return "", "", nil, ErrSessionDescriptionMissingIcePwd } + // https://github.com/pion/webrtc/issues/2621 + groupAttribue, _ := desc.Attribute(sdp.AttrKeyGroup) + + isBundled := strings.Contains(groupAttribue, "BUNDLE") + for _, m := range remoteUfrags { - if m != remoteUfrags[0] { + if m != remoteUfrags[0] && !isBundled { return "", "", nil, ErrSessionDescriptionConflictingIceUfrag } } for _, m := range remotePwds { - if m != remotePwds[0] { + if m != remotePwds[0] && !isBundled { return "", "", nil, ErrSessionDescriptionConflictingIcePwd } }