Skip to content

Fragment TLS 1.3 NewSessionTicket to max fragment length - #11578

Open
embhorn wants to merge 2 commits into
wolfSSL:masterfrom
embhorn:gh11079
Open

embhorn wants to merge 2 commits into
wolfSSL:masterfrom
embhorn:gh11079

Conversation

@embhorn

@embhorn embhorn commented Sep 29, 2026

Copy link
Copy Markdown
Member

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

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@embhorn embhorn self-assigned this Sep 29, 2026
Copilot AI balanced review requested due to automatic review settings September 29, 2026 12:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Low severity

Open (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.

Comment thread tests/api/test_tls13.c Resolved
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .text +256 B (+0.0%, 800,932 B / 1,048,576 B, total: 76% used)

gcc-arm-cortex-m4-pq

  • FLASH: .text +192 B (+0.1%, 312,976 B / 1,048,576 B, total: 30% used)

gcc-arm-cortex-m4-rsa-only

  • FLASH: .text +192 B (+0.1%, 343,824 B / 1,048,576 B, total: 33% used)

gcc-arm-cortex-m4-tls13

  • FLASH: .text +192 B (+0.1%, 249,698 B / 262,144 B, total: 95% used)

gcc-arm-cortex-m7-pq

  • FLASH: .text +192 B (+0.1%, 313,808 B / 1,048,576 B, total: 30% used)

gcc-arm-cortex-m7-tls13

  • FLASH: .text +256 B (+0.1%, 249,762 B / 262,144 B, total: 95% used)

zephyr-frdm_rw612

  • FLASH: log_const_area -8 B, rodata -8 B, text +1,592 B (+0.6%, 284,040 B / 67,108,864 B, total: 0% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

Comment thread src/internal.c Resolved
Comment thread tests/api/test_tls13.c Resolved
@rizlik rizlik assigned embhorn and unassigned rizlik Oct 13, 2026
@embhorn
embhorn force-pushed the gh11079 branch 3 times, most recently from 7db1399 to 78a1446 Compare October 16, 2026 19:14
@philljj

philljj commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Retest this please.

(fipsv2 test was disrupted)

@rizlik rizlik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rizlik
rizlik previously approved these changes Nov 3, 2026
@embhorn

embhorn commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Rebased to address conflicts

@embhorn

embhorn commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

retest this please

@embhorn embhorn removed their assignment Nov 5, 2026
Comment thread src/tls13.c
if (!ssl->options.dtls) {
maxFrag = wolfssl_local_GetMaxPlaintextSize(ssl);
if (maxFrag <= 0)
return (maxFrag < 0) ? maxFrag : BUFFER_E;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why return negative maxFrag?

@SparkiDev

Copy link
Copy Markdown
Contributor

Fix conflicts

@embhorn embhorn removed their assignment Nov 6, 2026
@embhorn
embhorn requested a review from SparkiDev November 6, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TLS 1.3 NewSessionTicket is not fragmented under reduced max fragment length

6 participants