Skip to content

Commit

Permalink
gracefully handle Initial+Handshake packets after dropping Initial epoch
Browse files Browse the repository at this point in the history
When datagram with Initial+Handshake coalesced packets is received after
the Initial epoch has already been dropped, we would drop the entire
datagram, causing the peer to resend the Handshake packet.

Instead we should just skip over the Initial packet and continue
processing the datagram.

Closes #1834.
  • Loading branch information
ghedo committed Jan 23, 2025
1 parent 57bdafd commit 2506301
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions quiche/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2654,6 +2654,17 @@ impl Connection {
return Ok(pkt_len);
}

// A datagram with Initial+Handshake coalesced packets might be
// received after the Initial epoch has already been dropped.
//
// To avoid rejecting the Handshake packet (due to the Initial
// being undecryptable), simply skip over the Initial packet and
// continue processing the rest of the datagram.
if hdr.ty == packet::Type::Initial {
let pkt_len = b.off() + payload_len;
return Ok(pkt_len);
}

let e = drop_pkt_on_err(
Error::CryptoFail,
self.recv_count,
Expand Down

0 comments on commit 2506301

Please sign in to comment.