GNOME Bugzilla – Bug 703264
srtp: Key is required even if cipher and auth are null
Last modified: 2013-08-12 16:30:17 UTC
When using the srtp plugin in gstreamer it is not always known if the remote side will support encryption when the local gstreamer pipeline is connected. This results in that one needs to have advanced logic to bypass the srtp element, or rebuild the pipeline, if the remote side do not support encryption. A nice solution to this would be if the srtp pluging could be configured to not encrypt/decrypt the data going throught it. One option would be to have this check in gst_srtp_dec_chain() and gst_srtp_enc_chain(). It could be based on a new property or if the keys/authetication information is set to NULL.
Can't your set rtp-auth=null rtcp-auth=null rtp-cipher=null rtcp-cipher=null ? But ooops, it still expects a key it seems.
Now you don't have to set a key.. commit ad7ffe64a66ab48d81671651031c449149db4973 Author: Olivier Crête <olivier.crete@collabora.com> Date: Fri Jun 28 20:15:08 2013 -0400 srtp: Don't require a key if both auth and cipher are null
This fix did not solve the whole problem. The request was to be able to disable the SRTP element if the remote side did not support SRTP (without need for modifying the pipeline). The above solution only makes it possible to disable encryption and authentication for RTP and encryption for RTCP without having to provide a key. The authentication is still there for RTCP. Since the SRTP RTCP receiver requires the authentication information the current solution drops all incoming RTCP reports. The logic in the srtp library that correctly drops the RTCP messages can be found here. https://github.com/cisco/libsrtp/blob/master/srtp/srtp.c#L1895 The logic that always set the header can be found here: https://github.com/cisco/libsrtp/blob/master/srtp/srtp.c#L1707 The reason for this behaviour is that the specification requires that RTCP always is authenticated when SRTP is used. One way of solving this would be to enable pass-through if all encryption and authentication is disabled. This would also avoid copying of buffers.
Again, oops, my bad. I had completely forgotten about RTCP Added passthrough support commit d346e7560682a824caf38add63cb3a55164de808 Author: Olivier Crête <olivier.crete@collabora.com> Date: Mon Aug 12 12:27:33 2013 -0400 srtp: Let packets through without touching them if no crypto or auth is set commit a10e800dfdb2d7cc742711fbbb8b2ab6b51da5d1 Author: Olivier Crête <olivier.crete@collabora.com> Date: Mon Aug 12 12:27:16 2013 -0400 srtpdec: Refactor code a bit Simplify the error handling case and get the packet push out of the if()