Repository navigation
[core] Fixed reception of encrypted stream from HSv4 peer before the key arrives - #3472
Merged
Merged
Conversation
…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>
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.