[][src]Function srtp2_sys::srtp_unprotect_rtcp_mki

pub unsafe extern "C" fn srtp_unprotect_rtcp_mki(
    ctx: srtp_t,
    srtcp_hdr: *mut c_void,
    pkt_octet_len: *mut c_int,
    use_mki: c_uint
) -> srtp_err_status_t

@brief srtp_unprotect_rtcp() is the Secure RTCP receiver-side packet processing function.

The function call srtp_unprotect_rtcp(ctx, srtp_hdr, len_ptr) verifies the Secure RTCP protection of the SRTCP packet pointed to by srtcp_hdr (which has length *len_ptr), using the SRTP session context ctx. If srtp_err_status_ok is returned, then srtcp_hdr points to the resulting RTCP 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 the SRTCP packet is aligned on a 32-bit boundary.

@param ctx is a pointer to the srtp_t which applies to the particular packet.

@param srtcp_hdr is a pointer to the header of the SRTCP packet (before the call). After the function returns, it points to the rtp packet if srtp_err_status_ok was returned; otherwise, the value of the data to which it points is undefined.

@param pkt_octet_len is a pointer to the length in octets of the complete SRTCP packet (header and body) before the function call, and of the complete rtp 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

@return

  • srtp_err_status_ok if the RTCP packet is valid.
  • srtp_err_status_auth_fail if the SRTCP packet failed the message authentication check.
  • srtp_err_status_replay_fail if the SRTCP packet is a replay (e.g. has already been processed and accepted).
  • srtp_err_status_bad_mki if the MKI in the packet is not a known MKI id
  • [other] if there has been an error in the cryptographic mechanisms.