Skip to content

Commit 7723cbc

Browse files
Ralithdjc
authored andcommitted
Validate 0-RTT frames based on packet type, not handshake progress
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.
1 parent 106d44b commit 7723cbc

File tree

1 file changed

+1
-2
lines changed
  • quinn-proto/src/connection

1 file changed

+1
-2
lines changed

quinn-proto/src/connection/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,7 +2499,6 @@ impl Connection {
24992499
packet: Packet,
25002500
) -> Result<(), TransportError> {
25012501
let payload = packet.payload.freeze();
2502-
let is_0rtt = self.spaces[SpaceId::Data].crypto.is_none();
25032502
let mut is_probing_packet = true;
25042503
let mut close = None;
25052504
let payload_len = payload.len();
@@ -2530,7 +2529,7 @@ impl Connection {
25302529
}
25312530

25322531
let _guard = span.as_ref().map(|x| x.enter());
2533-
if is_0rtt {
2532+
if packet.header.is_0rtt() {
25342533
match frame {
25352534
Frame::Crypto(_) | Frame::Close(Close::Application(_)) => {
25362535
return Err(TransportError::PROTOCOL_VIOLATION(

0 commit comments

Comments
 (0)