Skip to content
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

Force Handshake packet epoch if handshake hasn't been confirmed #1836

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

evanrittenhouse
Copy link
Contributor

@evanrittenhouse evanrittenhouse commented Aug 27, 2024

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.

  • Fix CI
  • Squash

@evanrittenhouse evanrittenhouse requested a review from a team as a code owner August 27, 2024 19:40
@evanrittenhouse evanrittenhouse marked this pull request as draft August 27, 2024 19:41
@evanrittenhouse evanrittenhouse force-pushed the evanrittenhouse/force-packet-epoch branch 3 times, most recently from 8c0784d to 28dcb9d Compare August 28, 2024 02:56
quiche/src/lib.rs Outdated Show resolved Hide resolved
@evanrittenhouse evanrittenhouse marked this pull request as ready for review August 28, 2024 03:06
@evanrittenhouse evanrittenhouse force-pushed the evanrittenhouse/force-packet-epoch branch 2 times, most recently from decb16b to a040cde Compare August 28, 2024 13:17
…nfirmed

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.
@evanrittenhouse evanrittenhouse force-pushed the evanrittenhouse/force-packet-epoch branch from a040cde to 53185d0 Compare August 28, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant