Skip to content

Qualify long-horizon KMREQ replay protection and document #112 compatibility boundary - #491

Merged
SRTPioneer merged 2 commits into
mainfrom
test/kmreq-long-horizon-replay-112
Dec 5, 2026
Merged

SRTPioneer merged 2 commits into
mainfrom
test/kmreq-long-horizon-replay-112

Conversation

@SRTPioneer

Copy link
Copy Markdown
Member

Summary

Resolves the compatibility-boundary decision and live-UDP runtime qualification checklist for long-horizon KMREQ/KMRSP replay protection.

Closes #112

Compatibility-Boundary Decision

  • Default passphrase mode (SRTO_ROBOTWEAX_SESSIONAUTH = false) intentionally preserves draft-sharabayko-srt-01 / Haivision v1.5.x wire compatibility (KEKI == 0, unauthenticated SRT_CMD_KMREQ/SRT_CMD_KMRSP) and therefore provides bounded-history replay rejection plus recovery on subsequent legitimate rotation, not unbounded key-epoch freshness.
  • Applications requiring unbounded long-horizon KMREQ/KMRSP replay protection opt into one of the authenticated profiles:
    • SRTO_ROBOTWEAX_SESSIONAUTH (Caller/Listener, AES-CTR or AES-GCM)
    • SRTO_ROBOTWEAX_PEERAUTH (Caller/Listener, AES-GCM, plus Backup groups when enabled)
    • SRTO_ROBOTWEAX_ACP1_REQUIRED (Caller/Listener v3, Rendezvous v4, Broadcast/Backup Groups v5, Group Rendezvous v6, AES-GCM mandatory)

Runtime Qualification Added

  • robotweax_srt_kmreq_long_horizon_tests (tests/test_kmreq_long_horizon_replay.cpp, runs in default and sanitizer CI):
    • SRTO_ROBOTWEAX_SESSIONAUTH (AES-CTR and AES-GCM): drives >= 40 live loopback UDP rotations (SRTO_KMREFRESHRATE = 8, SRTO_KMPREANNOUNCE = 2), replays captured rotation-1 0x7f03/0x7f04, and verifies zero receive-key disruption, 100% byte-exact bidirectional DATA delivery, pktRcvUndecryptTotal == 0, and clean subsequent rotations.
    • Delayed/duplicate current-epoch KMREQ/KMRSP retries and dropped-KMRSP response matching remain idempotent without key rollback.
    • 31-bit SRT packet sequence wrap (0x7ffffff0 -> 0x00000010) combined with >= 40 rotations, stale 0x7f03/0x7f04 replay, legacy bare-KMREQ injection, and strict fail-closed negotiation in both directions without downgrade.
    • Legacy Haivision-compatible baseline (SRTO_ROBOTWEAX_SESSIONAUTH = 0, AES-CTR and AES-GCM): verifies short-horizon replay rejection (<= 4 rotations) with uninterrupted DATA delivery, and post-eviction (>= 36 rotations) safe behavior / recovery without crash, hang, or memory corruption.
  • robotweax_srt_acp1_kmreq_long_horizon_tests (enabled with ROBOTWEAX_SRT_ENABLE_EXPERIMENTAL_ACP1=ON, runs in experimental-acp1.yml):
    • Qualifies >= 36-rotation 0x7f05 KMREQ/KMRSP replay rejection across Caller/Listener (v3, plus stale inner 0x7f03 re-wrapped inside a fresh outer 0x7f05 ctrl_seq), Rendezvous (v4), Broadcast & Backup Groups (v5, including per-member key/counter isolation and cross-member replay rejection), and Group Rendezvous (v6).
  • peer_auth_kmreq_long_horizon_replay_preserves_key_and_data (tests/test_peer_authentication_exchange.cpp, enabled with ROBOTWEAX_SRT_ENABLE_EXPERIMENTAL_PEERAUTH=ON, runs in experimental-peerauth.yml):
    • Qualifies >= 40-rotation 0x7f03/0x7f04 replay rejection over loopback UDP in SRTO_ROBOTWEAX_PEERAUTH (AES-GCM).

Documentation Updated

  • docs/encryption.md (explicit #112 compatibility boundary + opt-in profile matrix)
  • docs/session-authentication.md (unbounded monotonic counter scope & link to compatibility boundary)
  • docs/experimental-acp1.md (compatibility boundary & v3–v6 long-horizon qualification summary)
  • docs/testing.md (references to the new checked-in live-UDP long-horizon regression suites)

Local Verification

  • Default-OFF build (-Werror): ctest -R "kmreq_long_horizon|session_auth" — 3/3 PASS.
  • ASan+UBSan build (ENABLE_AEAD_API_PREVIEW=ON, ACP1=ON, PEERAUTH=ON, -Werror, UBSAN_OPTIONS=halt_on_error=1): ctest -R "kmreq_long_horizon|acp1_kmreq|session_auth" — 4/4 PASS; peer_auth_kmreq_long_horizon_replay_preserves_key_and_data — PASS.
  • clang-format --dry-run --Werror PASS; python3 tests/package_consumer/check_documentation.py . PASS (111 Markdown files).

…ty boundary

Add live-UDP ConnectionRuntime regression suites across >= 36 key rotations
(cycling even/odd selectors and evicting bounded CryptoSession histories)
and document the #112 compatibility boundary across encryption,
session-authentication, experimental-acp1, and testing docs:

- SESSIONAUTH (AES-CTR and AES-GCM): reject replayed rotation-1 0x7f03/0x7f04
  controls after >= 40 rotations without disturbing active keys or byte-exact
  DATA delivery; verify idempotent retries and response matching across
  dropped/duplicated controls, 31-bit packet sequence wrap (0x7ffffff0 ->
  0x00000010), legacy bare-KMREQ rejection, and strict fail-closed negotiation.
- Experimental ACP1 (AES-GCM): verify long-horizon 0x7f05 KMREQ/KMRSP replay
  rejection across Caller/Listener (v3, plus stale inner 0x7f03 re-wrapped
  in a fresh outer 0x7f05 ctrl_seq), Rendezvous (v4), Broadcast/Backup Groups
  (v5, including per-member key/counter isolation and cross-member replay
  rejection), and Group Rendezvous (v6).
- Experimental PEERAUTH (AES-GCM): verify long-horizon 0x7f03/0x7f04 replay
  rejection over loopback UDP.
- Legacy Haivision-compatible baseline (SRTO_ROBOTWEAX_SESSIONAUTH=0, AES-CTR
  and AES-GCM): verify short-horizon replay rejection and post-eviction
  safe behavior / recovery.

Signed-off-by: Marc Cymontkowski <srtpioneer@proton.me>
…rkflow

Align robotweax_srt_kmreq_long_horizon_tests (TIMEOUT 30) and
robotweax_srt_acp1_kmreq_long_horizon_tests (TIMEOUT 60, matching the
acp1_kmreq_long_horizon partition naming convention) with
interop/tests/test_ci_build_scope.py and include
robotweax_srt_kmreq_long_horizon_tests in ci.yml's optional
retransmission-limit matrix.

Signed-off-by: Marc Cymontkowski <srtpioneer@proton.me>
@SRTPioneer
SRTPioneer force-pushed the test/kmreq-long-horizon-replay-112 branch from 33ab6f6 to de59ff5 Compare December 4, 2026 22:24
@SRTPioneer
SRTPioneer merged commit 0a68d0b into main Dec 5, 2026
155 of 160 checks passed
@SRTPioneer
SRTPioneer deleted the test/kmreq-long-horizon-replay-112 branch December 5, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Investigate long-horizon KMREQ replay protection

1 participant