srtp code modification

01 July 2020

Views: 254

//srtp.c
srtp_err_status_t srtp_protect_mki(srtp_ctx_t *ctx, void *rtp_hdr, int *pkt_octet_len, unsigned int use_mki, unsigned int mki_index){
---------------------------------
if (enc_start) {
printf("encrypt plaintext : %s", srtp_octet_string_hex_string(enc_start,strlen(enc_start)));
status =
srtp_cipher_encrypt(session_keys->rtp_cipher, (uint8_t *)enc_start, (unsigned int *)&enc_octet_len);
if (status)
return srtp_err_status_cipher_fail;
printf("encrypt ciphertext : %s", srtp_octet_string_hex_string(enc_start,strlen(enc_start)));
}
-----------------------------
}

srtp_err_status_t srtp_unprotect_mki(srtp_ctx_t *ctx, void *srtp_hdr, int *pkt_octet_len, unsigned int use_mki, unsigned int mki_index){
---------------------------------
if (enc_start) {
printf("decrypt ciphertext : %s", srtp_octet_string_hex_string(enc_start,enc_start)));
status = srtp_cipher_decrypt(session_keys->rtp_cipher,
(uint8_t *)enc_start, &enc_octet_len);
if (status)
return srtp_err_status_cipher_fail;
printf("decrypt plaintext : %s", srtp_octet_string_hex_string(enc_start,strlen(enc_start)));
}
-----------------------------
}

Share