-
Notifications
You must be signed in to change notification settings - Fork 487
Open
Description
As a receiver, I fail to update srtp keys with MKI using the srtp_stream_update
This is new to master, this works fine with version 2.6.0
scenario:
- init srtp with ssrc_any_inbound, use_mki is true
- try to unprotect a packet with ssrc0 and associated mki0 => failure
- add srtp key with matching mki0 => success
- try to unprotect a packet with ssrc0 and associated mki0 => success
- try to unprotect a packet with ssrc1 and associated mki1 => failure
- add srtp key with matching mki1 => failure
- update srtp with srtp key with matching mki1 => failure
I suspect the bug to be around update_template_stream_cb
or srtp_stream_remove
.
srtp_unprotect
creates a new stream with srtp_stream_clone
, ssrc is stored in network order
static bool update_template_stream_cb(srtp_stream_t stream, void *raw_data)
{
struct update_template_stream_data *data =
(struct update_template_stream_data *)raw_data;
srtp_t session = data->session;
uint32_t ssrc = stream->ssrc; // ssrc is in network order
...
/* remove stream */
data->status = srtp_stream_remove(session, ssrc);
if (data->status) {
return false;
}
but then, srtp_strp_remove
expect ssrc to be given in host order
so possible fix can be to replace the call in update_template_stream_cb
to be consistent with the changes made in the API:
data->status = srtp_stream_remove(session, ntohl(ssrc));
PR: #711
Metadata
Metadata
Assignees
Labels
No labels