Commit Graph

432 Commits

Author SHA1 Message Date
Aaro Altonen 5a53f8d563 Create log_platform_error() utility function 2020-07-31 12:42:18 +03:00
Aaro Altonen 7c2142dddf Merge branch 'secure-rtp' into develop 2020-07-31 11:29:24 +03:00
Aaro Altonen b1a48f6b2c Add support for RTP packet authentication
By default authentication is disabled for RTP but in can be enabled
by giving RCE_SRTP_AUTHENTICATE_RTP when creating a media stream.

When security layer gets a packet, outgoing or incoming, it will add
an authentication tag to the packet or verify the tag, respectively.

This implementation is not perfect. The largest issue is
that there is no proper packet dispatcher so late ZRTP packets
can cause some real trouble.

This and a few other issues will be addresses later on when the
architecture of packet reception and the whole socket layer is improved.
2020-07-31 09:56:06 +03:00
Aaro Altonen 74cf102df2 Pass context flags directly to SRTP 2020-07-30 19:19:20 +03:00
Aaro Altonen dc494747a4 Store maximum payload size to RTP context
Store the size to context because different streams may have different
maximum payload sizes. For example, an SRTP stream with RTP authentication
enabled has a smaller payload size than a normal RTP stream.
2020-07-30 14:03:28 +03:00
Aaro Altonen 7d31f0ba08 Add support for SRTP NULL cipher 2020-07-30 11:47:11 +03:00
Aaro Altonen 3207713c24 Update SRTP code 2020-07-30 09:41:01 +03:00
Aaro Altonen 568b40a70b Create TIME_DIFF macro 2020-07-28 10:35:21 +03:00
Aaro Altonen e12a329fbc Add Multistream mode key generation 2020-07-23 13:21:27 +03:00
Aaro Altonen ef0c074d80 Protect access to ZRTP state by a mutex 2020-07-23 13:05:55 +03:00
Aaro Altonen ec30260763 Fix Preshared and Multistream names 2020-06-26 08:19:38 +03:00
Aaro Altonen 8d786d1217 Give key agreement type for init_session() as a parameter 2020-06-26 08:18:55 +03:00
Aaro Altonen 5217d42814 Add RTCP support to RTP receiver
Receiver calls RTCP after every received frame to update
session statistics
2020-06-18 09:33:41 +03:00
Aaro Altonen 73f5c4a35a Add ability to create unidirectional senders/receivers
This may be useful in situations where a user wishes to join a
conference call but does not wish to send any data only receiver or
vice versa.

This unidirectionality will also dictate the role for the media_stream's
RTCP object
2020-06-17 08:23:50 +03:00
Aaro Altonen 06f2891b86 Create RTCP gettter 2020-06-17 07:55:47 +03:00
Aaro Altonen b243d7d47e Remove RTCP forwards from media_stream
RTCP state should be modified only through the RTCP object allocated
for each media_stream
2020-06-17 07:55:02 +03:00
Aaro Altonen a522c81324 Add RTCP support for media_stream 2020-06-16 06:41:16 +03:00
Aaro Altonen 2af23d653e Add get_clock_rate() to rtp.cc 2020-06-16 06:41:14 +03:00
Aaro Altonen c997a94c2a Add ability to use custom timestamps for media
Instead of using uvgRTP's internal RTP timestamps, let user specify
timestamp for the media when push_frame() is called.

Instead of propagating the timestamp through the send stack, store
the timestamp value temporarily to the RTP context of the media
stream and reset it after push_frame() is done.

User should not mix and match uvgRTP's internal RTP timestamps with
custom timestamps so either all of the calls or none of the calls should
given a timestamp to push_frame().

Custom timestamps should be increased in accordance with the media clock
rate, otherwise problems may occur with media reception.
2020-06-02 08:25:34 +03:00
Aaro Altonen 574592cb10 Make System Call Clustering optional 2020-05-28 12:41:08 +03:00
Aaro Altonen 7b73aede33 Add pull_frame(timeout)
Instead of blocking until the library is destroyed, add ability
to block at most N milliseconds before returning.

The code returns early if a frame is received within the specified
timeframe but will block at most "timeout "milliseconds
2020-05-11 17:36:13 +03:00
Aaro Altonen 867aa02dbd Rename debug() to uvgrtp_debug()
Prevent name clahes with other software, debug is after all
quite a common symbol name
2020-05-06 06:46:13 +03:00
Aaro Altonen c2438e3017 Add support for user-managed SRTP session
Because the architecture has changed a bit, the context is initialized
only after add_srtp_ctx() has been called to prevent the user from
sending unencrypted messages.
2020-04-30 01:45:28 +03:00
Aaro Altonen 649be450e5 Enable runtime configuration functionality
Remove old context configuration flags that are no longer used,
convert configure_ctx() to work as a handler for all RCC_* flags
and use default values in sender/receiver/queue during initialization
2020-04-28 11:18:13 +03:00
Aaro Altonen c62194aea2 Add ability to specify custom payload type 2020-04-28 11:18:13 +03:00
Aaro Altonen c2e7eb1bc1 Rename kvzRTP to uvgRTP 2020-04-28 11:18:07 +03:00
Aaro Altonen df4c96c072 Removed unused Opus function 2020-04-27 12:57:00 +03:00
Aaro Altonen 29749c3623 Create RCE_INPLACE_ENCRYPTION flag
This flag indicates to kvzRTP that the input data given to push_frame()
is writable and the encryption can be done in-place.

By default kvzRTP assumes that the input cannot be modified and creates
a copy of the input data.
2020-04-27 12:22:28 +03:00
Aaro Altonen 98404d9316 Increase the MAX_PAYLOAD to 1443
There's 2 bytes left in the budget after all media headers
2020-04-26 21:04:28 +03:00
Aaro Altonen 5cedd36641 Add ability to fragment/reconstruct generic frames 2020-04-24 21:51:12 +03:00
Aaro Altonen 082372fba1 Merge RTP context configuration flags into one enum
Having separate enums for general configuration and media configuration
might be too confusing given that they are passed to kvzRTP using same
variable and the configuration values must not clash with each other
so the second enum's values would have to start from RCE_LAST which
might look weird
2020-04-24 21:51:12 +03:00
Aaro Altonen 8409706749 Create separate include directory
Create separate include directory which follows the kvzRTP include
style to make it easy for external applications to use kvzRTP
2020-04-22 04:58:41 +03:00