Skip to content

Enhancement (ECH): Trial decryption and ECH connection status#10469

Open
sebastian-carpenter wants to merge 2 commits into
wolfSSL:masterfrom
sebastian-carpenter:tls-ech-server-improvements
Open

Enhancement (ECH): Trial decryption and ECH connection status#10469
sebastian-carpenter wants to merge 2 commits into
wolfSSL:masterfrom
sebastian-carpenter:tls-ech-server-improvements

Conversation

@sebastian-carpenter
Copy link
Copy Markdown
Contributor

Description

1. ECH trial decryption (server)src/tls.c, src/ssl_ech.c, wolfssl/internal.h

  • Previously, the server always fell back to trying every config when the configId didn't match. Now that fallback is opt-in via a new enableEchTrialDecrypt flag (off by default, matching RFC guidance).
  • New API: wolfSSL_CTX_SetEchEnableTrialDecrypt() / wolfSSL_SetEchEnableTrialDecrypt().
  • Also tightens TLSX_ECH_Parse rejection logic so a config lookup miss (vs. a decrypt failure) is treated as rejection cleanly.

2. ECH connection-status APIsrc/ssl_ech.c, wolfssl/ssl.h

Testing

  • test_wolfSSL_Tls13_ECH_trial_decrypt — mangles the client's configId to test trial decryption.
  • Existing ECH tests (_all_algos, _no_private_name, _bad_configs, _retry_configs, _retry_configs_bad, _new_config, _GREASE, _disable_conn, _HRR_rejection, _ch2_no_ech, _ch2_decrypt_error, _rejected_cert_valid, _rejected_empty_client_cert) were updated to assert wolfSSL_GetEchStatus() on both client and server in place of the internal options.echAccepted check, covering all four status values (NOT_OFFERED, GREASE, REJECTED, ACCEPTED) including the asymmetric cases (e.g. GREASE: server NOT_OFFERED/REJECTED, client GREASE; SNI-reject: server ACCEPTED, client REJECTED).

Checklist

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

@sebastian-carpenter sebastian-carpenter self-assigned this May 12, 2026
Copilot AI review requested due to automatic review settings May 12, 2026 18:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds opt-in ECH trial decryption on the server and introduces a public API to query ECH connection status, updating tests accordingly.

Changes:

  • Add CTX/SSL APIs to enable/disable ECH trial decryption (default off) and plumb the option from WOLFSSL_CTX into WOLFSSL.
  • Introduce wolfSSL_GetEchStatus() + public status constants and migrate tests to assert status instead of internal flags.
  • Adjust server ECH parsing logic to avoid unconditional “try every config” behavior unless trial decryption is enabled.

Reviewed changes

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

Show a summary per file
File Description
wolfssl/ssl.h Declares new public APIs and ECH status constants.
wolfssl/internal.h Adds bitfields for the trial-decrypt option on ctx/options.
src/internal.c Copies trial-decrypt option from ctx into per-SSL options at init.
src/tls.c Changes ECH config selection + opt-in trial decryption behavior and acceptance/rejection handling.
src/ssl_ech.c Implements trial-decrypt setters and wolfSSL_GetEchStatus().
tests/api.c Updates ECH tests to assert wolfSSL_GetEchStatus() and adds trial-decrypt test.

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

Comment thread src/tls.c
Comment thread wolfssl/ssl.h
Comment thread wolfssl/ssl.h
Comment thread src/tls.c
@sebastian-carpenter
Copy link
Copy Markdown
Contributor Author

sebastian-carpenter commented May 12, 2026

Jenkins retest this please.

@github-actions
Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

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