srtp2_sys

Function srtp_protect_rtcp_mki

Source
pub unsafe extern "C" fn srtp_protect_rtcp_mki(
    ctx: srtp_t,
    rtcp_hdr: *mut c_void,
    pkt_octet_len: *mut c_int,
    use_mki: c_uint,
    mki_index: c_uint,
) -> srtp_err_status_t
Expand description

@brief srtp_protect_rtcp_mki() is the Secure RTCP sender-side packet processing function that can utilize mki.

The function call srtp_protect_rtcp(ctx, rtp_hdr, len_ptr) applies SRTCP protection to the RTCP packet rtcp_hdr (which has length *len_ptr) using the SRTP session context ctx. If srtp_err_status_ok is returned, then rtp_hdr points to the resulting SRTCP packet and *len_ptr is the number of octets in that packet; otherwise, no assumptions should be made about the value of either data elements.

@warning This function assumes that it can write the authentication tag into the location in memory immediately following the RTCP packet, and assumes that the RTCP packet is aligned on a 32-bit boundary.

@warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4 into the location in memory immediately following the RTCP packet. Callers MUST ensure that this much writable memory is available in the buffer that holds the RTCP packet.

@param ctx is the SRTP context to use in processing the packet.

@param rtcp_hdr is a pointer to the RTCP packet (before the call); after the function returns, it points to the srtp packet.

@param pkt_octet_len is a pointer to the length in octets of the complete RTCP packet (header and body) before the function call, and of the complete SRTCP packet after the call, if srtp_err_status_ok was returned. Otherwise, the value of the data to which it points is undefined.

@param use_mki is a boolean to tell the system if mki is being used. If set to false then will use the first set of session keys. If set to true will use the session keys identified by the mki_index

@param mki_index integer value specifying which set of session kesy should be used if use_mki is set to true.

@return

  • srtp_err_status_ok if there were no problems.
  • [other] if there was a failure in the cryptographic mechanisms.