Skip to content

Check SNI/ALPN on session ID resumption without session tickets - #11738

Merged
philljj merged 3 commits into
wolfSSL:masterfrom
padelsbach:sni-binding
Oct 30, 2026
Merged

philljj merged 3 commits into
wolfSSL:masterfrom
padelsbach:sni-binding

Conversation

@padelsbach

@padelsbach padelsbach commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

The TLS 1.2 session ID required HAVE_SESSION_TICKET. This PR enables ID based resumption without ticket support.

Testing

Added unit tests

Checklist

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

Copilot AI balanced review requested due to automatic review settings October 14, 2026 00:35
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .text -128 B (-0.0%, 796,124 B / 1,048,576 B, total: 76% used)

zephyr-frdm_rw612

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

No memory changes detected for:


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

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.

🟡 Changes recommended

Legacy ClientHello resumption bypasses the new security check, and the persisted cache version was not updated.

2 open findings
What changed in this PR

Extends SNI/ALPN validation to TLS 1.2 session-ID resumption without session tickets.

Changes:

  • Stores SNI/ALPN hashes in all resumable sessions.
  • Validates hashes during stateful resumption.
  • Expands no-ticket regression-test coverage.
File Description
wolfssl/​internal.h Exposes session binding fields and helpers without tickets.
src/​internal.c Enforces stateful resumption bindings.
src/​ssl_sess.c Stores and serializes binding hashes.
tests/​api/​test_tls.c Enables mismatch tests in no-ticket builds.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/internal.c Resolved
Comment thread wolfssl/internal.h Resolved
@padelsbach padelsbach self-assigned this Oct 14, 2026
@padelsbach
padelsbach requested review from wolfSSL-Fenrir-bot and a balanced review from Copilot October 14, 2026 17:21

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #11738

Scan targets checked: wolfssl-src, wolfssl-bugs
Coverage: 4 of 4 in-scope changed file(s) opened by the reviewer

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

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.

🔵 Needs a closer look

Hashing failures can leave insecure stale bindings, and successful bound session-ID resumption lacks coverage.

0 open findings

2 resolved since last review
Previously missed (2)

In code that hasn't changed since last review

Medium severity Handle hash failures before caching sessions

src/​ssl_sess.c:3933

These return values are discarded even though wc_Hash can fail (for example, WOLFSSL_SMALL_STACK returns MEMORY_E when its temporary allocation fails). The session is still cached, leaving a zero or stale binding; a later no-extension resumption can then match zero, or a reused session can remain bound to the previous SNI/ALPN. Treat a hash failure as a session-setup failure and do not cache/issue that session.

Low severity Avoid binding allocations when session resumption is unavailable

wolfssl/​internal.h:5258

These hashes are now allocated for every SNI/ALPN session even when NO_SESSION_CACHE is set and session tickets are absent, where no server resumption path can consume them. This unnecessarily enlarges each session by one or two digest sizes in the low-resource configuration. Gate the binding state and helpers on resumption being available (HAVE_SESSION_TICKET || !NO_SESSION_CACHE) as well as SNI/ALPN.

🧠 Review effort: Balanced

@philljj

philljj commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@claude review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings marked 🟡 are optional suggestions and need no follow-up push.

Comment thread src/internal.c Resolved
Comment thread src/ssl_sess.c Resolved
@philljj

philljj commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Tests good with multi-test with gcc-c89, c89-clang-tidy, wolfssl-all, openssl-extra-coexist, tls13, dtls13, etc.

@philljj philljj 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.

Tests good.

Please review Claude feedback, and consider commenting the #endif spaghetti in src/ssl_sess.c (some of the changes are difficult to interpret).

Comment thread src/ssl_sess.c Resolved
@philljj philljj assigned padelsbach and unassigned wolfSSL-Bot Oct 28, 2026
@padelsbach padelsbach removed their assignment Oct 28, 2026
@padelsbach
padelsbach requested a review from philljj October 29, 2026 16:44

@philljj philljj 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.

merge conflict

@padelsbach padelsbach removed their assignment Oct 30, 2026
@padelsbach
padelsbach requested a review from philljj October 30, 2026 00:29
@philljj
philljj merged commit 98e4e49 into wolfSSL:master Oct 30, 2026
435 of 437 checks passed
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.

5 participants