Skip to content

Fix: prevent public SNI from being installed on ctx#10678

Open
sebastian-carpenter wants to merge 1 commit into
wolfSSL:masterfrom
sebastian-carpenter:tls-ech-ctx-fix
Open

Fix: prevent public SNI from being installed on ctx#10678
sebastian-carpenter wants to merge 1 commit into
wolfSSL:masterfrom
sebastian-carpenter:tls-ech-ctx-fix

Conversation

@sebastian-carpenter

@sebastian-carpenter sebastian-carpenter commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

Reworked the changeSNI logic so it never installs the public SNI onto the shared ctx.

Testing

Added a regression test to check the plaintext SNI is always the public_name. Added matrix to verify ctx SNI swap works.

  • test_wolfSSL_Tls13_ECH_wire_sni

Checklist

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

@sebastian-carpenter sebastian-carpenter self-assigned this Jun 12, 2026
Copilot AI review requested due to automatic review settings June 12, 2026 23:46

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.

Pull request overview

This PR adjusts TLS 1.3 ECH SNI-swapping so the public (outer) SNI is never installed onto a shared WOLFSSL_CTX extension list, preventing cross-connection state mutation when the inner SNI was configured at the context level.

Changes:

  • Update TLSX_EchChangeSNI() to avoid mutating ssl->ctx->extensions while still ensuring the public SNI is used on the wire for ClientHelloOuter.
  • Add a regression test that inspects ClientHello(1/2) bytes to validate the plaintext SNI equals public_name across {accept,reject} × {inner SNI on ssl, ctx}.
  • Move/centralize small ClientHello extension-parsing helpers used by multiple ECH memio tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/tls.c Prevents ECH SNI swap from installing the public SNI on the shared ctx extension list.
tests/api.c Adds a memio regression test to validate wire SNI behavior for ECH across multiple branches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/api.c
Comment thread tests/api.c
@sebastian-carpenter

Copy link
Copy Markdown
Contributor Author

Jenkins retest this please.

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.

3 participants