TLS ECH: Update ECH configuration parsing logic to be more robust#6441
Merged
Conversation
Member
|
@Fangliding ready 时说一声 |
Member
|
就这样吧 |
Member
|
@jamesliu96 |
Contributor
Author
|
@RPRX Thanks for the heads-up! According to GitHub's documentation (see GitHub Docs), accounts created before July 18, 2017 use the USERNAME@users.noreply.github.com format without the ID prefix. That's why it looks a bit different. |
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.
Key Changes: Robust Configuration String Splitting
Swapped out aggressive, un-delimited splitting in favor of
strings.SplitN(c.EchConfigList, "+", 2).This ensures that if the downstream DoH or h2c URL contains query parameters or search paths that inherently use the plus sign (+) (e.g.,
https://some-dns.com/dns-query?token=123+xyz), it will no longer be erroneously truncated.IPv6 and port detection support. Improved the port-appending mechanism for fallback classic UDP servers using standard library
net.SplitHostPort.The previous
strings.Contains(udpServerAddr, ":")check was fundamentally flawed when users inputted explicit IPv6 formats likeudp://[2001:db8::1], bypassing the default :53 port injection.