Respect the direction set in a template stream#618
Conversation
|
This code apears to be 17 years old and kind of unchanged, I agree that it should be fixed, but it might break things for exisitng clients if they have been doing it wrong. Maybe this is something for 3.0 ? |
This is a failing test for cisco#618
A stream can no be used for both protecting and unprotecting. Treat it as an error as well as rasing the collision event.
Keep existing stream directions unchanged when srtp_update rebuilds specific streams, and reject wildcard template updates that attempt to flip inbound/outbound direction. Add regression coverage for specific and template-derived streams to verify direction preservation and template direction mismatch rejection.
7736c30 to
c2fcc91
Compare
|
@bifurcation , I took your change and applied some more direction checking, can you do a review ? Summary of changes: Tightens SRTP stream direction handling so sender and receiver streams cannot be used for the wrong operation. It adds a new The change also preserves stream direction across |
This PR attempts to fix the logical error noted in #617, that the directions set on a template stream are not checked when the template stream is used to create new (directed) streams. It simply adds checks in
srtp_protect_mkiandsrtp_unprotect_mkithat verify that the template stream's direction is compatible with the context, either the same direction ordir_srtp_unknown. Marking as WIP because even if we agree on approach, we probably need to cover the analgous RTCP methods.Note that there is compatibility risk in merging this PR: If there are consumers that are relying the ambiguity noted here, then they will fail.