Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The regression test can pass without exercising fragmentation when the generated ticket fits in one record.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds TLS 1.3 NewSessionTicket fragmentation to respect negotiated record limits.
Changes:
- Fragments oversized tickets across adjacent TLS records.
- Updates ticket-size rationale for resumed ClientHello messages.
- Adds a fragmentation and resumption test.
| File | Description |
|---|---|
src/tls13.c |
Implements ticket fragmentation. |
src/internal.c |
Updates the peer-certificate exclusion rationale. |
tests/api/test_tls13.c |
Adds the regression test. |
tests/api/test_tls13.h |
Registers the new test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
| /* The ticket returns in a ClientHello, which is never | ||
| * fragmented and after a HelloRetryRequest must fit the | ||
| * reduced limit. */ |
There was a problem hiding this comment.
The current situation is that:
- wolfSSL server defragments CH1 and CH2.
- wolfSSL client never fragments CH1/CH2, but both CH1 and/or CH2 can exceed the offered max fragment limit. However, Max Fragment Length isn't negotiated yet when CH2 is sent (the server acknowledges the extension in EE), so exceeding that offered limit isn't violating the RFC. Nevertheless, wolfSSL (and OpenSSL) enforces the reduced limit early, so it would be better to enable CH fragmentation. This can also be an opportunity to consolidate TLS 1.3 fragmentation into shared helpers and enable fragmentation for EE, HRR, CertificateRequest, and SH as well.
It can be done in a follow-up PR.
There was a problem hiding this comment.
Agreed on follow-up work
| ExpectIntEQ(wolfSSL_get_error(ssl_c, -1), WOLFSSL_ERROR_WANT_READ); | ||
| ExpectIntEQ(test_ctx.c_len, 0); | ||
|
|
||
| ExpectIntEQ(wolfSSL_send_SessionTicket(ssl_s), WOLFSSL_SUCCESS); |
There was a problem hiding this comment.
consider using a custom SessionTicketEncCb to enforce a ticket that always exceed the limit.
7db1399 to
78a1446
Compare
|
Retest this please. (fipsv2 test was disrupted) |

Description
Split the ticket into several records when it is larger than the negotiated max fragment length.
Fixes #11079
Testing
Added a regression test.
Checklist