tquic
tquic copied to clipboard
issues 223: Support greasing the QUIC Bit
Overview
This PR implements RFC 9287 "Greasing the QUIC Bit" to enhance QUIC protocol privacy and prevent network ossification. The implementation allows endpoints to negotiate the ability to randomize the second-most significant bit (QUIC bit) in QUIC packets.
Issue
Fixes #223
RPC 9287
RFC 9287 addresses the problem that QUIC packets are easily identifiable because the "QUIC bit" (0x40) is always set to 1. This implementation:
- Prevents ossification: Keeps the QUIC bit available for future protocol extensions
- Enhances privacy: Makes QUIC traffic less identifiable to passive observers
- Maintains compatibility: Only activates when both endpoints support it
Details
- Transport Parameter Negotiation (
src/trans_param.rs) - Addedgrease_quic_bitfield toTransportParams- Implemented parameter ID0x2ab2encoding/decoding - Added validation for empty parameter value requirement - Configuration API (
src/lib.rs) - AddedConfig::enable_grease_quic_bit()method - Added configuration field with defaultfalse- Added comprehensive documentation - Connection Management (
src/connection/connection.rs) - Added bilateral negotiation logic - Added connection state tracking for greasing capability - Added public APIgrease_quic_bit_enabled() - Packet Processing (
src/packet.rs) - Added QUIC bit randomization inencrypt_packet()- Implemented 50% probability randomization - Added safety checks for packet types
Codecov Report
:x: Patch coverage is 98.88889% with 1 line in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 94.74%. Comparing base (b62863a) to head (27882d0).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/packet.rs | 88.88% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## develop #473 +/- ##
===========================================
+ Coverage 94.72% 94.74% +0.01%
===========================================
Files 50 50
Lines 30282 30371 +89
===========================================
+ Hits 28685 28774 +89
Misses 1597 1597
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.