Repository navigation
F-19177: Keep WANT_WRITE resume count in SendData until used - #12296
Open
julek-wolfssl wants to merge 1 commit into
Open
julek-wolfssl wants to merge 1 commit into
julek-wolfssl wants to merge 1 commit into
Conversation
The count of a blocked write was only applied when the retry itself flushed the output buffer. It was lost when another message flushed the record first, or when the retry flushed it and then blocked on a pending alert or the deferred KeyUpdate. The retry then sent the data again. Apply the count after those steps, whoever sent the record. Flush a counted record of a grouped early data write instead of building it again. Reset the count in wolfSSL_clear().
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the nonblocking write-resumption changes.
No open issues 🎉
What changed in this PR
Fixes nonblocking write resumption so application data already sent after WANT_WRITE is not transmitted again.
Changes:
- Preserve resume counts until buffered output, pending alerts, and deferred KeyUpdate handling complete.
- Flush previously buffered grouped early data instead of rebuilding it.
- Clear resume state in
wolfSSL_clear()and add regression tests for retries and connection reuse.
| File | Description |
|---|---|
tests/api/test_tls13.h |
Declares and registers the new TLS 1.3 regression tests. |
tests/api/test_tls13.c |
Tests deferred KeyUpdate retries and grouped early-data retries. |
tests/api/test_ssl_rw.h |
Declares and registers write-retry and clear-state tests. |
tests/api/test_ssl_rw.c |
Tests retries after another message flushes output and writes after connection reuse. |
src/ssl.c |
Resets pending-write counts in wolfSSL_clear(). |
src/internal.c |
Delays resume-count consumption and flushes counted grouped records before retrying. |
Review effort: Balanced
|
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.
When a write blocked with WANT_WRITE, the count of bytes to resume with was applied only if the retry itself flushed the output buffer. The count was lost in two cases: another message flushed the record first, or the retry flushed it and then blocked on a pending alert or the deferred KeyUpdate. The retry then sent the data again.
Changes:
wolfSSL_clear().