Echo HRR Cookie by default on client. Fix a few sniffer issues. Document DES function size requirements. - #11163
Echo HRR Cookie by default on client. Fix a few sniffer issues. Document DES function size requirements.#11163kareem-wolfssl wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes TLS 1.3 clients RFC 8446-compliant by enabling HelloRetryRequest (HRR) cookie echoing by default (with an opt-out for size-constrained clients), while also hardening the packet sniffer’s TCP sequence/FIN handling and documenting DES buffer sizing requirements.
Changes:
- Enable
HAVE_TLSX_COOKIEby default for TLS 1.3 clients (opt-out viaWOLFSSL_NO_CLIENT_HRR_COOKIE) and switch HRR-cookie logic to use that feature macro. - Fix sniffer edge cases: negative-length handling, FIN capture when relative sequence is 0, and 32-bit wrap-safe sequence comparisons.
- Document DES-CBC function behavior requiring buffers sized to
round_up(len, DES_BLOCK_SIZE).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
wolfssl/wolfcrypt/settings.h |
Defines HAVE_TLSX_COOKIE by default for TLS 1.3 clients (with opt-out) to ensure HRR cookie echo support is compiled in. |
wolfssl/internal.h |
Gates hrrSentCookie option bit on HAVE_TLSX_COOKIE instead of WOLFSSL_SEND_HRR_COOKIE. |
src/tls13.c |
Uses HAVE_TLSX_COOKIE to include HRR cookie presence in client-side HRR validation. |
src/tls.c |
Compiles TLSX Cookie extension support under HAVE_TLSX_COOKIE and refines cookie parsing behavior when server-side cookie generation is disabled. |
src/ssl_crypto.c |
Adds Doxygen notes clarifying DES-CBC rounding/padding behavior and buffer size requirements. |
src/sniffer.c |
Improves robustness around negative lengths, sequence wrap comparisons, and FIN capture semantics. |
.wolfssl_known_macro_extras |
Registers HAVE_TLSX_COOKIE and WOLFSSL_NO_CLIENT_HRR_COOKIE as known macros. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
Jenkins retest this please |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11163
Scan targets checked: wolfcrypt-bugs, wolfcrypt-rs-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
Findings: 3
2 finding(s) posted as inline comments (see file-level comments below)
Medium (1)
AdjustSequence mixes signed and unsigned relative-sequence comparisons
File: src/sniffer.c:5913
Function: AdjustSequence
Category: Logic errors
The branch selection at lines 5864/5871 now uses signed (wrap-safe) arithmetic, but the nested *seqLast comparisons at lines 5913 and 5943 remain unsigned. A retransmit whose real + *sslBytes - 1 crosses the 2^32 relative-sequence wrap enters the overlap branch and then skips the *sslBytes -= overlap trim, feeding already-consumed bytes into the TLS stream instead of dropping the segment as before.
Recommendation: Compare with (sword32)(real + (word32)*sslBytes - 1 - *seqLast) at lines 5913 and 5943 to match the new signed convention.
Referenced code: src/sniffer.c:5913-5915 (3 lines)
This review was generated automatically by Fenrir. Findings are non-blocking.
… sniffer. Thanks to NVIDIA Project Vanessa for the report.
…ENT_HRR_COOKIE. Fixes wolfSSL#11010.
A complete fix is not possible without breaking OpenSSL compatibility. Fixes F-2246.
706be75 to
40e54a0
Compare
|
Retest this please Jenkins |
Description
Fixes zd#21992, #11010, F-2246
Testing
Built in tests, provided reproducers
Checklist