diff --git a/sdp.go b/sdp.go index 0b034d294ab..18139e64f7b 100644 --- a/sdp.go +++ b/sdp.go @@ -714,8 +714,8 @@ func extractFingerprint(desc *sdp.SessionDescription) (string, string, error) { isBundled := strings.Contains(groupAttribue, "BUNDLE") - for _, m := range fingerprints { - if m != fingerprints[0] && !isBundled { + if !isBundled { + if len(fingerprints) != 1 { return "", "", ErrSessionDescriptionConflictingFingerprints } } @@ -779,14 +779,11 @@ func extractICEDetails(desc *sdp.SessionDescription, log logging.LeveledLogger) isBundled := strings.Contains(groupAttribue, "BUNDLE") - for _, m := range remoteUfrags { - if m != remoteUfrags[0] && !isBundled { - return "", "", nil, ErrSessionDescriptionConflictingIceUfrag - } - } + if !isBundled { - for _, m := range remotePwds { - if m != remotePwds[0] && !isBundled { + if len(remoteUfrags) != 1 { + return "", "", nil, ErrSessionDescriptionConflictingIceUfrag + } else if len(remotePwds) != 1 { return "", "", nil, ErrSessionDescriptionConflictingIcePwd } }