Enhancement (ECH): Trial decryption and ECH connection status#10469
Open
sebastian-carpenter wants to merge 2 commits into
Open
Enhancement (ECH): Trial decryption and ECH connection status#10469sebastian-carpenter wants to merge 2 commits into
sebastian-carpenter wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
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_CTXintoWOLFSSL. - 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.
Contributor
Author
|
Jenkins retest this please. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
1. ECH trial decryption (server) —
src/tls.c,src/ssl_ech.c,wolfssl/internal.henableEchTrialDecryptflag (off by default, matching RFC guidance).wolfSSL_CTX_SetEchEnableTrialDecrypt()/wolfSSL_SetEchEnableTrialDecrypt().TLSX_ECH_Parserejection logic so a config lookup miss (vs. a decrypt failure) is treated as rejection cleanly.2. ECH connection-status API —
src/ssl_ech.c,wolfssl/ssl.hwolfSSL_GetEchStatus()returning one ofWOLFSSL_ECH_STATUS_{NOT_OFFERED, GREASE, REJECTED, ACCEPTED}for both client and server.Testing
test_wolfSSL_Tls13_ECH_trial_decrypt— mangles the client's configId to test trial decryption._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 assertwolfSSL_GetEchStatus()on both client and server in place of the internaloptions.echAcceptedcheck, covering all four status values (NOT_OFFERED,GREASE,REJECTED,ACCEPTED) including the asymmetric cases (e.g. GREASE: serverNOT_OFFERED/REJECTED, clientGREASE; SNI-reject: serverACCEPTED, clientREJECTED).Checklist