Skip to content

Commit

Permalink
Validate 0-RTT frames based on packet type, not handshake progress
Browse files Browse the repository at this point in the history
0-RTT packets might be received after we derive 1-RTT keys, e.g. if we
received a complete ClientHello. That shouldn't cause us to relax
0-RTT frame type restrictions.
  • Loading branch information
Ralith authored and djc committed Dec 8, 2023
1 parent 106d44b commit 7723cbc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions quinn-proto/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2499,7 +2499,6 @@ impl Connection {
packet: Packet,
) -> Result<(), TransportError> {
let payload = packet.payload.freeze();
let is_0rtt = self.spaces[SpaceId::Data].crypto.is_none();
let mut is_probing_packet = true;
let mut close = None;
let payload_len = payload.len();
Expand Down Expand Up @@ -2530,7 +2529,7 @@ impl Connection {
}

let _guard = span.as_ref().map(|x| x.enter());
if is_0rtt {
if packet.header.is_0rtt() {
match frame {
Frame::Crypto(_) | Frame::Close(Close::Application(_)) => {
return Err(TransportError::PROTOCOL_VIOLATION(
Expand Down

0 comments on commit 7723cbc

Please sign in to comment.