Skip to content

harden downgrade path for ECH - #11870

Merged
philljj merged 2 commits into
wolfSSL:masterfrom
sebastian-carpenter:ech-downgrade
Oct 28, 2026
Merged

philljj merged 2 commits into
wolfSSL:masterfrom
sebastian-carpenter:ech-downgrade

Conversation

@sebastian-carpenter

@sebastian-carpenter sebastian-carpenter commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Clients using Encrypted Client Hello do not properly handle rejection via a downgrade to TLS1.2.

  • Added an abort before the handshake completes, as in TLS1.3
  • Improve session handling on ECH rejection
  • Improve cert handling on ECH rejection

zd#22661

Testing

Added test with an ECH client that gets downgraded to TLS1.2. This also tests:

  • Session storage
  • What cert is sent

A client configured for TLS1.2 with ECH fails outright, instead of later

Harden resumption handling for TLS1.2

Checklist

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

@sebastian-carpenter sebastian-carpenter self-assigned this Oct 22, 2026
Copilot AI balanced review requested due to automatic review settings October 22, 2026 23:07

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

Signature-algorithm selection can still trigger a credential-dependent abort before the required empty-certificate response.

1 open issue
What changed in this PR

This PR hardens wolfSSL’s Encrypted Client Hello (ECH) rejection handling when a server negotiates TLS 1.2.

Changes:

  • Returns an ECH-required error instead of reporting handshake success.
  • Suppresses client certificates and session persistence after ECH rejection.
  • Adds a downgrade regression test covering rejection, certificates, and session storage.
File Description
tests/​api.c Adds and registers the ECH-to-TLS-1.2 downgrade test.
src/​ssl_api_hs.c Aborts rejected ECH connections before reporting success.
src/​internal.c Suppresses certificates, session caching, and ticket storage after rejection.

Review effort: Balanced

Comment thread src/internal.c Outdated

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, the TLS 1.2 downgrade now aborts with ech_required as it should. I built it with --enable-all --enable-ech, the new tests pass, and dropping the new check in wolfSSL_connect makes test_wolfSSL_Tls13_ECH_tls12_downgrade fail, so the fix is covered. The main question is the TLS 1.2 session case below; the rest are smaller.

Comment thread src/tls.c
Comment thread tests/api.c Outdated
Comment thread src/internal.c
Comment thread src/ssl_api_hs.c
Comment thread src/internal.c Outdated
@sebastian-carpenter

Copy link
Copy Markdown
Contributor Author

Jenkins retest this please.

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@Frauschi Frauschi removed their assignment Oct 28, 2026
@Frauschi
Frauschi requested a review from philljj October 28, 2026 09:17
@philljj philljj self-assigned this Oct 28, 2026
@philljj

philljj commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

tests good with multi-test with gcc-c89, c89-clang-tidy, tls13, etc scenarios.

@philljj
philljj merged commit 891db04 into wolfSSL:master Oct 28, 2026
420 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