-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
libsrtp: Update to v3.0.0-beta version in our fork #1544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
TODO 1 (solved)Wow, it looks like if the public std::memcpy(encryptBuffer, *data, *len);
const srtp_err_status_t err = srtp_protect(this->session, encryptBuffer, len);But now it requires 6 args instead: Signature of /**
* @brief srtp_protect() is the Secure RTP sender-side packet processing
* function.
*
* The function call srtp_protect(ctx, rtp, rtp_len, srtp, srtp_len, mki_index)
* applies SRTP protection to the RTP packet rtp (which has length rtp_len)
* using the SRTP context ctx. If srtp_err_status_ok is returned, then srtp
* points to the resulting SRTP packet and *srtp_len is the number of
* octets in that packet; otherwise, no assumptions should be made
* about the value of either data elements.
*
* The sequence numbers of the RTP packets presented to this function
* need not be consecutive, but they @b must be out of order by less
* than 2^15 = 32,768 packets.
*
* @warning This function assumes that the RTP packet is aligned on a 32-bit
* boundary.
*
* @param ctx is the SRTP context to use in processing the packet.
*
* @param rtp is a pointer to the RTP packet.
*
* @param rtp_len is the length in octets of the complete RTP
* packet (header and body).
*
* @param srtp is a pointer to a buffer that after the function returns will
* contain the complete SRTP packet. The value of srtp can be the same as rtp to
* support in-place io.
*
* @param srtp_len is a pointer to the length in octets of the srtp buffer
* before the function call, and of the complete SRTP packet after the call, if
* srtp_err_status_ok was returned. Otherwise, the value of the data to which it
* points is undefined.
*
* @param mki_index integer value specifying which set of session keys should be
* used if use_mki in the policy was set to true. Otherwise ignored.
*
* @return
* - srtp_err_status_ok no problems
* - srtp_err_status_replay_fail rtp sequence number was non-increasing
* - srtp_err_status_buffer_small the srtp buffer is too small for the SRTP
* packet
* - @e other failure in cryptographic mechanisms
*/
srtp_err_status_t srtp_protect(srtp_t ctx,
const uint8_t *rtp,
size_t rtp_len,
uint8_t *srtp,
size_t *srtp_len,
size_t mki_index); |
|
This enhancement of us is present in libsrtp The problem is that I don't think it is well known when v3 is coming out. So we could keep using Check this thread for more details cisco/libsrtp#674 (comment) |
|
So you mean that we should merge changes from mainstream 2_x_dev branch instead of main branch? The problem I see is that in our fork we applied changed directly in main branch is its hard to manage commits from mainstream. |
|
I just mean that we could merge specifically this PR and few other changes made on top of it afterwards, to 2_x_dev so the changes will be present in the next v2 release. This way once next v2 is released we won't have to have any custom branch and will use the official libsrtp. The changes will be present in v3 anyway but the problem is that I don't think there is a timeline for v3 release. |
That makes sense but we already diverged (literally your PR went to libsrtp main branch rather than 2_x_dev branch) and I don't think that moving back to libsrtp v2 (and adopt the needed changes) is easier than staying in main branch. Anyway, as per our call today I've pushed to this PR with the required API changes to make libsrtp v3 work, meaning that yes, we are using libsrtp main branch here (AKA v3). |
Details
subprojects/libsrtp2.wraptosubprojects/libsrtp3.wrap(since in recent commits in mainstream libsrtp,libsrtp2_dephas been renamed tolibsrtp3_dep.