ECH: cleanups#21532
Closed
bagder wants to merge 1 commit into
Closed
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens CURLOPT_ECH option parsing in curl_easy_setopt() so applications can reliably detect typos/unknown strings by receiving an error return, rather than silently accepting an unrecognized value.
Changes:
- Refactors
CURLOPT_ECHparsing into a dedicated helper (setopt_ech()) and returnsCURLE_BAD_FUNCTION_ARGUMENTfor unknown strings. - Updates the lib1521 option-error allowlist generator to treat
CURLOPT_ECHas an option that may returnCURLE_BAD_FUNCTION_ARGUMENTfor invalid strings.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/libtest/mk-lib1521.pl | Adds CURLOPT_ECH to the set of string options allowed to return CURLE_BAD_FUNCTION_ARGUMENT for unrecognized values. |
| lib/setopt.c | Introduces setopt_ech() and makes CURLOPT_ECH return an error for unknown strings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- passing an unknown string to CURLOPT_ECH now returns error To properly allow applications to spot if they pass in a typo or something to libcurl. - CURLECH_DISABLE is now a plain zero internally, not a dedicated bit which simplifies checks for when ECH is enabled - Dropped the CURLECH_CLA_CFG bit, and just check STRING_ECH_CONFIG - Turn grease/enable/hard into three different numerical values, no bitmask needed - Convert the struct field 'tls_ech' from an int to a byte.
Member
Author
|
augment review |
🤖 Augment PR SummarySummary: This PR refactors libcurl’s ECH (Encrypted Client Hello) option handling to be stricter on invalid input and simpler internally. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
outcast36
pushed a commit
to greearb/curl
that referenced
this pull request
Jun 3, 2026
- passing an unknown string to CURLOPT_ECH now returns error To properly allow applications to spot if they pass in a typo or something to libcurl. - CURLECH_DISABLE is now a plain zero internally, not a dedicated bit which simplifies checks for when ECH is enabled - Dropped the CURLECH_CLA_CFG bit, and just check STRING_ECH_CONFIG - Turn grease/enable/hard into three different numerical values, no bitmask needed - Convert the struct field 'tls_ech' from an int to a byte. Closes curl#21532
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.
passing an unknown string to CURLOPT_ECH now returns error
To properly allow applications to spot if they pass in a typo or
something to libcurl.
CURLECH_DISABLE is now a plain zero internally, not a dedicated bit which
simplifies checks for when ECH is enabled
Dropped the CURLECH_CLA_CFG bit, and just check STRING_ECH_CONFIG
Turn grease/enable/hard into three different numerical values, no bitmask
needed
Convert the struct field 'tls_ech' from an int to a byte.