quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Fix `no-protection` option in perf crate #1550

Closed aochagavia closed 1 year ago

aochagavia commented 1 year ago

While profiling stuff with perf_server and perf_client, I discovered that the no-protection option was not working as expected (it did not disable packet encryption / decryption, as my flamegraphs revealed). It looks like the original feature did disable encryption after a key update, but forgot to do so right after the handshake. This PR fixes that.

In case you are curious, you can observe the problem by running the following commands:

  1. cargo run --release --bin perf_server
  2. cargo run --release --bin perf_client -- --no-protection
  3. Watch the server and the client happily exchange packets (instead of failing to connect because of the mismatch in encryption)