-
Notifications
You must be signed in to change notification settings - Fork 115
feat(x): add ECH GREASE support to fetch tool #518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for ECH (Encrypted Client Hello) GREASE functionality to the fetch tool. The implementation allows testing ECH behavior by generating GREASE ECH configurations that can help identify middleboxes that reject ECH-enabled connections.
- Implements ECH GREASE configuration generation using HPKE X25519 key pairs
- Adds command-line support for ECH configuration in the fetch tool
- Includes comprehensive test coverage for the ECH GREASE functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
x/tools/fetch/main.go | Adds ECH support with --ech-config flag and GREASE mode |
x/ech/ech_grease.go | Implements ECH GREASE configuration list generation |
x/ech/ech_grease_test.go | Provides test coverage for ECH GREASE functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
// Can we make it work with a fake domain that validates the right domain? | ||
echConfigBytes, err := ech.GenerateGreaseECHConfigList(rand.Reader, reqURL.Hostname()) | ||
if err != nil { | ||
slog.Error("Failed to decode base64 ECH config", "error", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message is misleading for the GREASE case since no base64 decoding is performed. Consider using a more accurate message like 'Failed to generate GREASE ECH config'.
slog.Error("Failed to decode base64 ECH config", "error", err) | |
slog.Error("Failed to generate GREASE ECH config", "error", err) |
Copilot uses AI. Check for mistakes.
x/ech/ech_grease.go
Outdated
} | ||
|
||
// uint8 maximum_name_length | ||
b.AddUint8(uint8(42)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic number 42 for maximum_name_length should be replaced with a named constant or documented inline comment explaining its purpose.
Copilot uses AI. Check for mistakes.
Not working yet. For some reason I'm getting server rejections. Not sure what I'm doing wrong.
Error source:
https://cs.opensource.google/search?q=%22server%20rejected%20ECH%22&ss=go%2Fgo
Note that with a valid ECH Config from a different site it does the handshake (though the certificate validation fails as expected):