From 2112c3c6b849d2c5e5d2fd3160a89d1bb12c269a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Tue, 12 Oct 2021 11:29:21 -0400 Subject: [PATCH] webrtcsdp: Remove comparison between media and session fingerprint 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: --- subprojects/gst-plugins-bad/ext/webrtc/webrtcsdp.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/subprojects/gst-plugins-bad/ext/webrtc/webrtcsdp.c b/subprojects/gst-plugins-bad/ext/webrtc/webrtcsdp.c index 1abd4b1..769fdaa 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/webrtcsdp.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/webrtcsdp.c @@ -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; -- 2.7.4