webrtcsdp: Remove comparison between media and session fingerprint
authorOlivier Crête <olivier.crete@collabora.com>
Tue, 12 Oct 2021 15:29:21 +0000 (11:29 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 14 Nov 2023 19:50:48 +0000 (19:50 +0000)
The code seems to validate that the media-level fingerprint matches
the fingerprint of the previous media or of the whole session. There
is no such requirement in any RFC I found. The session-session one
is just meant to act as a fallback when there is no media-level
fingerprint.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5663>

subprojects/gst-plugins-bad/ext/webrtc/webrtcsdp.c

index 1abd4b1..769fdaa 100644 (file)
@@ -101,7 +101,7 @@ static gboolean
 _check_sdp_crypto (SDPSource source, GstWebRTCSessionDescription * sdp,
     GError ** error)
 {
-  const gchar *message_fingerprint, *fingerprint;
+  const gchar *message_fingerprint;
   const GstSDPKey *key;
   int i;
 
@@ -112,7 +112,7 @@ _check_sdp_crypto (SDPSource source, GstWebRTCSessionDescription * sdp,
     return FALSE;
   }
 
-  message_fingerprint = fingerprint =
+  message_fingerprint =
       gst_sdp_message_get_attribute_val (sdp->sdp, "fingerprint");
   for (i = 0; i < gst_sdp_message_medias_len (sdp->sdp); i++) {
     const GstSDPMedia *media = gst_sdp_message_get_media (sdp->sdp, i);
@@ -126,18 +126,6 @@ _check_sdp_crypto (SDPSource source, GstWebRTCSessionDescription * sdp,
           "No fingerprint lines in sdp for media %u", i);
       return FALSE;
     }
-    if (IS_EMPTY_SDP_ATTRIBUTE (fingerprint)) {
-      fingerprint = media_fingerprint;
-    }
-    if (!IS_EMPTY_SDP_ATTRIBUTE (media_fingerprint)
-        && g_strcmp0 (fingerprint, media_fingerprint) != 0) {
-      g_set_error (error, GST_WEBRTC_ERROR,
-          GST_WEBRTC_ERROR_FINGERPRINT_FAILURE,
-          "Fingerprint in media %u differs from %s fingerprint. "
-          "\'%s\' != \'%s\'", i, message_fingerprint ? "global" : "previous",
-          fingerprint, media_fingerprint);
-      return FALSE;
-    }
   }
 
   return TRUE;