Commit graph

55 commits

Author SHA1 Message Date
Miguel Paris 075ff1e8b0 srtpdec: fix reseting RTP sequence number on ROC changes
Each srtp_stream_t is tied to an specific SSRC, so a
roc_changed flag should be kept per each SSRC in order to
properly reset RTP sequence number on ROC changes.
2020-04-01 16:49:44 +02:00
Olivier Crête 411bde315c srtp: Remove %z as it doesn't work on Windows 2019-12-09 15:41:13 -05:00
Aaron Boxer 6d3429af34 documentation: fixed a heap o' typos 2019-11-05 09:11:25 -05:00
Ulf Olsson b2d0795185 srtp: Add support for GCM (RFC 7714)
The GCM support in libsrtp have been there for a while and
it can be useful for some applications.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/913
2019-03-27 10:55:27 +00:00
Jan Alexander Steffens (heftig) deb2f11fe2
srtpdec: Lower severity of srtp_err_status_replay_fail
AFAIU this happens when encountering retransmissions. Don't print a
warning for these packets.
2019-03-19 16:04:07 +01:00
Jan Alexander Steffens (heftig) 8ef4d01f60
srtpdec: Simplify code flow handling status_key_expired
Ensures a balanced UNLOCK -> LOCK.
2019-03-19 15:50:45 +01:00
Jan Alexander Steffens (heftig) 24b0e3e55f
srtpdec: Simplify checking the unprotect error
Introduce an err label to jump to. Avoid logging two warnings per
failure.
2019-03-19 13:47:41 +01:00
Jan Alexander Steffens (heftig) 34eaeb17f2
srtpdec: Simplify locking in gst_srtp_dec_decode_buffer
Don't drop the lock on filter just to unmap the buffer (or log a
message).
2019-03-19 13:47:41 +01:00
Andreas Frisch 2f907b7e2d
srtp: Spell 'mechanisms' right 2019-03-15 10:57:17 +01:00
Olivier Crête 46b5756d30 srtpdec: Add support for MKI
Add support for MKIs which allow multiple keys to be used with a single SRTP stream.

https://bugzilla.gnome.org/show_bug.cgi?id=797305
2018-11-09 15:06:27 -05:00
Olivier Crête a10c46a93a Revert "srtpdec: also check for "roc" in caps"
This reverts commit 73ebdb888e.

This isn't needed and it breaks srtpenc ! srtpdec, specifying the
roll-over counter manually is an advanced feature.

Also revert "srtp: Add "roc" caps field to the gst-launch example"
This reverts commit 67ae35813b.

https://bugzilla.gnome.org/show_bug.cgi?id=765079
2018-10-17 18:34:31 -04:00
Olivier Crête 67ae35813b srtp: Add "roc" caps field to the gst-launch example
The currrent example was broken since 1.8.3 it seems.

https://bugzilla.gnome.org/show_bug.cgi?id=786304
2018-05-11 20:55:10 +02:00
Jan Alexander Steffens (heftig) e9aa117200 srtp: Support libsrtp2
For libsrtp 1, add defines that translate the new namespaced identifiers
to the old unnamespaced ones. Also move the code for setting and getting
a stream's ROC into two compat functions that match libsrtp2's API.

It seems that libsrtp2 properly supports changing the ROC without having
to touch the sequence numbers afterwards, given that srtp_set_stream_roc
sets a pending_roc field, so the entire roc_changed dance should not be
needed anymore. The compat functions for libsrtp 1 just contain our
preexisting hacks, however, so it's still needed there.

libsrtp2 has no means of discovering the streams in the session, so to
create the stats structure we need to iterate over our own set of SSRCs.
For this we also need to re-add the previously removed ssrcs_set to the
encoder.

https://bugzilla.gnome.org/show_bug.cgi?id=776901
2018-01-29 09:58:11 +02:00
Matthew Waters 029e01743f srtp: zero out session member on dealloc
Fixes a user-after-free retrieving stats from _get_property()
2017-08-24 18:02:01 +10:00
Thibault Saunier 78022a6e0c docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
Vincent Penquerc'h d125d6b18c srtpdec: add stats readonly property, similar to srtpenc
https://bugzilla.gnome.org/show_bug.cgi?id=772357
2016-11-01 19:37:50 +02:00
Aleix Conchillo Flaqué 73ebdb888e srtpdec: also check for "roc" in caps
Currently, gst_srtp_dec_sink_setcaps is happy if the "roc" field is not
provided in the caps. If it is not provided the stream will be properly
inserted in the hash table with a default "roc". Then, when the first
buffer arrives validate_buffer will find an existing stream in the hash
table and will not signal request-key, not allowing the user to provide
a "roc".

This patch expects "roc" in gst_srtp_dec_sink_setcaps, if not found a
request-key will be signaled and the user will be able to provide all
the srtp fields, including "roc".

https://bugzilla.gnome.org/show_bug.cgi?id=765079
2016-04-15 15:37:32 +02:00
Vineeth TM 8cdfb13658 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2016-03-24 14:56:51 +02:00
Miguel París Díaz f19a789b68 srtpdec: skip padding when mapping RTP packets
https://bugzilla.gnome.org/show_bug.cgi?id=756653
2015-10-16 09:17:18 +03:00
Sebastian Dröge 88f85f6595 Revert "srtpdec: Add support for buffer list"
This reverts commit ff11a1a8a0.

It can't be assumed that all buffers in a buffer list have the same SSRC or
are RTP or RTCP only. It has to be checked for every single buffer, and one
basically has to do the processing that is done by the default chain_list
implementation.
2015-08-13 12:40:14 +02:00
Miguel París Díaz 3a3c01e7c7 srtpdec: Add config for the replay window size
https://bugzilla.gnome.org/show_bug.cgi?id=751729
2015-06-30 16:14:25 +02:00
Sebastian Dröge 3d6a79b08b srtpdec: Actually set the caps on the srcpad instead of just calling the default event handler for the sinkpad
Fixes up dafa11b9d2
2015-05-06 12:59:33 +02:00
Sebastian Dröge dafa11b9d2 srtpdec: Make sure to send caps events downstream before any segment events
Upstream might not give us a caps event (dtlssrtpdec) because it might be an
RTP/RTCP mixed stream, but we split the two streams anyway and should report
proper caps downstream if possible.

Fixes "sticky event misordering" warnings with dtlssrtpdec.
2015-04-30 21:34:54 +02:00
Sebastian Dröge 87243e9c6e srtpdec: Add some more debug output 2015-04-13 19:41:15 +02:00
Jose Antonio Santos Cadenas ff11a1a8a0 srtpdec: Add support for buffer list
https://bugzilla.gnome.org/show_bug.cgi?id=746387
2015-03-19 16:31:47 +01:00
Jose Antonio Santos Cadenas 8d2e98bc3f srtpdec: Separate buffer encoding functionality into a different function
https://bugzilla.gnome.org/show_bug.cgi?id=746387
2015-03-18 16:26:48 +01:00
Aleix Conchillo Flaqué 086cc58952 srtpdec: fix rtp/rtcp sink event memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=740451
2014-11-20 13:32:39 -05:00
Arun Raghavan 193eeb1243 srtpdec: Trivial documentation fix 2014-10-30 18:45:04 +05:30
Youness Alaoui 3c80396424 srtpdec: Add support for RTP/RTCP mixing if data arrives on RTCP pad
https://bugzilla.gnome.org/show_bug.cgi?id=734321
2014-08-21 18:45:19 -04:00
Aleix Conchillo Flaqué da30669589 srtp: add support for rollover counters and replay protection window size
We add a new signal, get-rollover-counter, to the SRTP encoder. Given a
ssrc the signal will return the currently internal SRTP rollover counter
for the given stream.

For the SRTP decoder we have a new SRTP caps parameter "roc" that needs
to be set when a new SRTP stream is created for a given SSRC.

https://bugzilla.gnome.org/show_bug.cgi?id=726861
2014-06-03 16:18:25 -04:00
Olivier Crête 0566be384d srtpdec: Don't reset stream if the key hasn't changed 2014-05-06 00:49:59 -04:00
Olivier Crête b2a6490626 srtpdec: Add "remove-key" action signal to remove a single key
Removing all the keys can be a problem as it also resets the various
counters, so instead add an option to remove a single key.
2014-05-06 00:49:59 -04:00
Olivier Crête 8c9b1ade36 srtpdec: Remove unused field 2014-05-06 00:49:15 -04:00
Olivier Crête 775e998dab srtpdec: Only clear streams if they have been created 2014-05-01 19:16:35 -04:00
Olivier Crête 494b8e110d srtpdec: Use object debug 2014-05-01 19:10:43 -04:00
Vincent Penquerc'h 54704b6f5d srtp: remove dead assignment
Coverity 1197707
2014-04-09 16:55:30 +01:00
Sebastian Dröge 15e0db90e8 srtpdec: Fix comparison compiler warning
error: comparison of constant -1 with expression of type
'GstSrtpCipherType' is always false
2014-02-08 19:59:43 +01:00
Miguel París Díaz e944195b64 srtpdec: Fix GstCaps memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=721382
2014-01-03 10:46:29 +01:00
Aleix Conchillo Flaqué fefd021ee2 srtp: add 256-bit key support
* ext/srtp/gstsrtp.[ch]: added GST_SRTP_CIPHER_AES_256_ICM to
  GstSrtpCipherType and new function cipher_key_size.

* ext/srtp/gstsrtpenc.c: maximum key size is now 46 characters (14 for
  the salt plus the key). If different ciphers are chosen for RTP and
  RTCP the maximum needed key size is expected.

* ext/srtp/gstsrtpdec.c: minor documentation updates.

https://bugzilla.gnome.org/show_bug.cgi?id=720434
2013-12-13 17:51:18 -05:00
Olivier Crête 2b75eb85c4 srtpdec: Make sure that stream-id/caps/segment are sent before buffers
It may be possible that only one of the two sink pads is linked in that case,
the events need to be created from the other pad.
2013-11-19 20:12:54 -05:00
Olivier Crête de1fb842e6 srtpdec: Pass is_rtcp to setcaps function 2013-11-19 19:10:06 -05:00
Olivier Crête 8c76d7c77e srtp: Implement SRTCP demultiplexing
Separate multiplexed RTP and RTCP if they arrive
on the rtp_sink pad.
2013-11-19 18:34:08 -05:00
Tim-Philipp Müller b8f9d674be srtpdec: fix buffers being dropped due to shadowed variable
Spotted by gstblub@gmail.com.

https://bugzilla.gnome.org/show_bug.cgi?id=706091
2013-08-16 19:48:03 +01:00
Olivier Crête d346e75606 srtp: Let packets through without touching them if no crypto or auth is set 2013-08-12 12:27:33 -04:00
Olivier Crête a10e800dfd srtpdec: Refactor code a bit
Simplify the error handling case and get the packet push out of the if()
2013-08-12 12:27:16 -04:00
Olivier Crête 04bd37dd67 srtpdec: Don't error on invalid packet, just drop it 2013-08-12 11:57:04 -04:00
Olivier Crête ad7ffe64a6 srtp: Don't require a key if both auth and cipher are null 2013-06-28 20:35:16 -04:00
Olivier Crête 47a6118fbc srtp: Move the enums to the common header
The types are used in both the encoder and decoder
2013-06-28 20:35:15 -04:00
Olivier Crête 4a9c3d4f16 srtpdec: Don't stop on invalid buffer 2013-04-09 21:37:25 -04:00
Olivier Crête 3bf994eb3b srtpdec: Cleaner stream cleanup 2013-04-09 21:37:25 -04:00