Skip to content

Add SRTCP AES-GCM multi-packet round-trip regression test#1678

Merged
sipsorcery merged 1 commit into
masterfrom
test/rtcp-gcm-replay-iv
Jun 7, 2026
Merged

Add SRTCP AES-GCM multi-packet round-trip regression test#1678
sipsorcery merged 1 commit into
masterfrom
test/rtcp-gcm-replay-iv

Conversation

@sipsorcery
Copy link
Copy Markdown
Member

UnprotectRtcp must derive the per-packet AES-GCM IV from the SRTCP index of the packet being decrypted, not from the connection's highest-seen index (S_l). A single-packet round trip cannot detect a regression here because S_l defaults to 0 and the first index is 0, so they coincide.

This test protects and unprotects an in-order multi-packet RTCP stream and asserts every packet round-trips with its payload intact, which only holds when the IV tracks each packet's own index. It guards against the RTCP replay-window refactor in PR #1675 deriving the IV from a stale S_l once the replay update is deferred until after authentication.

UnprotectRtcp must derive the per-packet AES-GCM IV from the SRTCP index
of the packet being decrypted, not from the connection's highest-seen
index (S_l). A single-packet round trip cannot detect a regression here
because S_l defaults to 0 and the first index is 0, so they coincide.

This test protects and unprotects an in-order multi-packet RTCP stream
and asserts every packet round-trips with its payload intact, which only
holds when the IV tracks each packet's own index. It guards against the
RTCP replay-window refactor in PR #1675 deriving the IV from a stale S_l
once the replay update is deferred until after authentication.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sipsorcery sipsorcery merged commit 2cfe31b into master Jun 7, 2026
8 checks passed
@sipsorcery sipsorcery deleted the test/rtcp-gcm-replay-iv branch June 7, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant