Skip to content

[core] Fixed reception of encrypted stream from HSv4 peer before the key arrives - #3472

Merged
cl-ment merged 1 commit into
Haivision:masterfrom
ethouris:dev-regr-hsv4-securing-drop
Dec 3, 2026
Merged

cl-ment merged 1 commit into
Haivision:masterfrom
ethouris:dev-regr-hsv4-securing-drop

Conversation

@ethouris

@ethouris ethouris commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

The problem:

A pre-1.3.0 (HSv4) sender sends its key in KMREQ only after it receives an ACK. Since packets that can't be decrypted are ignored as if they were never received, the ACK never advanced in the SECURING state, so the key never arrived and no packet could be decrypted.

This is a regression from #3397.

The fix:

In live mode, when the key is still pending, mark the cell of an undecryptable packet as dropped (as in 1.5.7), so that the ACK advances. Undecrypted packets are dropped, but the stream continues, and once the key is installed, decryption works correctly.

…key arrives

A pre-1.3.0 (HSv4) sender sends its key in KMREQ only after it receives
an ACK. Since packets that can't be decrypted are ignored as if they were
never received, the ACK never advanced in the SECURING state, so the key
never arrived and no packet could be decrypted.

In live mode, when the key is still pending, mark the cell of an
undecryptable packet as dropped (as in 1.5.7), so that the ACK advances.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ethouris ethouris added this to the v1.5.8 milestone Dec 3, 2026
@ethouris ethouris added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Dec 3, 2026
@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.62500% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.01%. Comparing base (0976f76) to head (c695ecf).
⚠️ Report is 90 commits behind head on master.

Files with missing lines Patch % Lines
srtcore/core.cpp 37.50% 7 Missing and 3 partials ⚠️
srtcore/buffer_rcv.cpp 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3472      +/-   ##
==========================================
- Coverage   67.88%   67.01%   -0.87%     
==========================================
  Files         101      102       +1     
  Lines       18489    21112    +2623     
  Branches        0     3119    +3119     
==========================================
+ Hits        12551    14149    +1598     
+ Misses       5938     5562     -376     
- Partials        0     1401    +1401     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cl-ment
cl-ment merged commit ebfb9f0 into Haivision:master Dec 3, 2026
20 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants