ech: implement inner hello extension compression#2001
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2001 +/- ##
==========================================
+ Coverage 94.17% 94.18% +0.01%
==========================================
Files 97 97
Lines 21566 21640 +74
==========================================
+ Hits 20309 20382 +73
- Misses 1257 1258 +1 ☔ View full report in Codecov by Sentry. |
5fead9d to
3ccbdcf
Compare
Benchmark resultsInstruction countsSignificant differencesClick to expand
Other differencesClick to expand
Wall-timeSignificant differencesThere are no significant wall-time differences Other differencesClick to expand
Additional informationCheckout details:
|
ctz
left a comment
There was a problem hiding this comment.
A couple of things unrelated to this PR I noticed while reviewing:
The head comment in examples/src/bin/ech-client.rs has an example usage that wants to find ech-client in the rustls-provider-example crate; it has moved since.
It would be nice if cargo run --bin ech-client -- --help included an example usage.
Do we want to run ech-client in the connect-tests job?
This commit extends the existing client-side ECH support to enable the "SHOULD" recommendation of compressing extensions that are identical between the outer client hello and the inner client hello. This optimization reduces the overhead of ECH, shrinking the total client hello size. Achieving this is a bit tricky (which is why it was done separately at the end!). To-be-compressed extensions must be in a contiguous block in the inner hello. When we encode that contiguous block for the encoded inner hello, we replace the block with a marker extension listing all of the extension types that were replaced. In the outer hello the compressed extensions must be present in the same relative order (but don't need to be contiguous). With this feature implemented we can also activate a couple of bogo tests that were previously excluded.
Use `log::trace!` for writing the current & total number of requests being made instead of a bare `println!`.
The ech-client was moved from the provider-example crate into the examples crate, but the usage example in the header comment wasn't updated.
Also 'grep' for the HTML output that's rendered when ECH was successful.
3ccbdcf to
3271e01
Compare
Good catch, thanks. Fixed.
Done.
I added a test invocation of the |
This commit extends the initial client-side ECH support from #1718 to enable the "SHOULD" recommendation of compressing extensions that are identical between the outer client hello and the inner client hello. This optimization reduces the overhead of ECH, shrinking the total client hello size.
Achieving this is a bit tricky (which is why it was done separately at the end!). To-be-compressed extensions must be in a contiguous block in the inner hello. When we encode that contiguous block for the encoded inner hello, we replace the block with a marker extension listing all of the extension types that were replaced. In the outer hello the compressed extensions must be present in the same relative order (but don't need to be contiguous). We also need the uncompressed inner hello with the uncompressed extensions in place to update the inner transcript.
With this feature implemented we can also activate a couple of bogo tests that were previously excluded.