diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2015-07-24 19:52:11 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2015-07-24 19:52:11 -0400 |
commit | c4bca15b08a34874fefc06529df98b4609abbf3d (patch) | |
tree | 3b7c903e0b94f7448276a9a426410addd2d9ceb8 | |
parent | 28f0e7985cab9e305a32f830f974db0f049a8f51 (diff) | |
download | farstream-c4bca15b08a34874fefc06529df98b4609abbf3d.tar.gz |
rtpstream: Accept all uncrypted packets if no crypto set
-rw-r--r-- | gst/fsrtpconference/fs-rtp-session.c | 26 | ||||
-rw-r--r-- | gst/fsrtpconference/fs-rtp-stream.c | 8 | ||||
-rw-r--r-- | gst/fsrtpconference/fs-rtp-stream.h | 3 |
3 files changed, 36 insertions, 1 deletions
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c index b040a5cb..ee0225f2 100644 --- a/gst/fsrtpconference/fs-rtp-session.c +++ b/gst/fsrtpconference/fs-rtp-session.c @@ -5518,6 +5518,32 @@ _srtpdec_request_key (GstElement *srtpdec, guint ssrc, gpointer user_data) caps = fs_rtp_stream_get_srtp_caps_locked (stream); g_object_unref (stream); } + else + { + GList *item; + gboolean no_crypto = TRUE; + for (item = self->priv->streams; item; item = item->next) + if (fs_rtp_stream_requires_crypto_locked (item->data)) + { + no_crypto = FALSE; + break; + } + if (no_crypto) + { + GST_DEBUG ("No stream found for SSRC %x, none of the streams require" + " crypto, so letting through", ssrc); + caps = gst_caps_new_simple ("application/x-srtp", + "srtp-cipher", G_TYPE_STRING, "null", + "srtcp-cipher", G_TYPE_STRING, "null", + "srtp-auth", G_TYPE_STRING, "null", + "srtcp-auth", G_TYPE_STRING, "null", + NULL); + } + else + { + GST_DEBUG ("Some streams require crypto, dropping packets"); + } + } FS_RTP_SESSION_UNLOCK (self); diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c index 294a0c8f..b2d59f2c 100644 --- a/gst/fsrtpconference/fs-rtp-stream.c +++ b/gst/fsrtpconference/fs-rtp-stream.c @@ -482,7 +482,7 @@ fs_rtp_stream_get_property (GObject *object, break; case PROP_REQUIRE_ENCRYPTION: FS_RTP_SESSION_LOCK (session); - g_value_set_boolean (value, self->priv->encrypted); + g_value_set_boolean (value, fs_rtp_stream_requires_crypto_locked (self)); FS_RTP_SESSION_UNLOCK (session); break; default: @@ -1580,3 +1580,9 @@ fs_rtp_stream_get_srtp_caps_locked (FsRtpStream *self) "srtcp-auth", G_TYPE_STRING, srtcp_auth, NULL); } + +gboolean +fs_rtp_stream_requires_crypto_locked (FsRtpStream *self) +{ + return self->priv->encrypted; +} diff --git a/gst/fsrtpconference/fs-rtp-stream.h b/gst/fsrtpconference/fs-rtp-stream.h index a2e7d18f..a4b3fb23 100644 --- a/gst/fsrtpconference/fs-rtp-stream.h +++ b/gst/fsrtpconference/fs-rtp-stream.h @@ -131,6 +131,9 @@ validate_srtp_parameters (GstStructure *parameters, GstCaps * fs_rtp_stream_get_srtp_caps_locked (FsRtpStream *self); +gboolean +fs_rtp_stream_requires_crypto_locked (FsRtpStream *self); + G_END_DECLS #endif /* __FS_RTP_STREAM_H__ */ |