Commit Graph

22 Commits

Author SHA1 Message Date
Aaro Altonen 2a4e45032a Implement Secure RTCP for Sender Reports 2020-09-03 12:03:50 +03:00
Aaro Altonen de3e72e97f Implement RCE_SRTP_INPLACE_ENCRYPTION
By default uvgRTP assumes that the memory it gets from user is not
writable and if user doesn't explictly specify that the memory
is writable (RCE_SRTP_INPLACE_ENCRYPTION) or that encryption is
not necessary (RCE_SRTP_NULL_CIPHER), a copy of the memory block is
made before it is pushed into the frame queue.
2020-09-02 12:30:30 +03:00
Aaro Altonen 7992224325 Move SET_NEXT_FIELD_32 to include/util.hh 2020-08-26 15:33:57 +03:00
Aaro Altonen 9a59dd0cc8 Create RTCP for the media stream unconditionally
RTCP is used to gather session statistics and detect SSRC collisions
so all packets should be relayd to the RTCP layer for monitoring
even if RTCP packets are not being sent.

If RTCP Sender/Receiver reports are needed, RCE_RTCP should be given
when creating a media stream.
2020-08-06 07:39:55 +03:00
Aaro Altonen 494765a2fa Implement memdup() utility function 2020-08-04 10:16:38 +03:00
Aaro Altonen 91a12af92d Add ability to return an RTP frame from packet handler
When a complete RTP frame has been received, the packet handler
must return the frame to RTP packet dispatcher which then returns
the frame to user either through frame queue or receive hook
2020-08-04 08:39:12 +03:00
Aaro Altonen a5c8adde48 Create ZRTP packet handler 2020-08-01 15:15:53 +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 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 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 574592cb10 Make System Call Clustering optional 2020-05-28 12:41:08 +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 c2e7eb1bc1 Rename kvzRTP to uvgRTP 2020-04-28 11:18:07 +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