quiche icon indicating copy to clipboard operation
quiche copied to clipboard

Force Handshake packet epoch if handshake hasn't been confirmed

Open evanrittenhouse opened this issue 1 year ago • 0 comments

The RFC states that an endpoint can immediately close a connection by sending a CONNECTION_CLOSE frame during the handshake:

However, prior to confirming the handshake, it is possible that more advanced packet protection keys are not available to the peer, so another CONNECTION_CLOSE frame MAY be sent in a packet that uses a lower packet protection level.

Currently, when we decide the packet epoch when a CC frame is present, we always choose Application. This commit downgrades the epoch to Handshake if the handshake wasn't confirmed.

The test added in this PR fails without this patch - since the packet is sent in the Application space without keys, the server can't decrypt it, so its peer_error is None.

  • [x] Fix CI
  • [x] Squash

evanrittenhouse avatar Aug 27 '24 19:08 evanrittenhouse