Skip to content

Commit

Permalink
discussion: downgrade override
Browse files Browse the repository at this point in the history
  • Loading branch information
evanrittenhouse committed Aug 28, 2024
1 parent 0555b91 commit 8c0784d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion quiche/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6816,6 +6816,7 @@ impl Connection {
.as_ref()
.map_or(false, |conn_err| !conn_err.is_app)
{
let mut force_downgrade = false;
let epoch = match self.handshake.write_level() {
crypto::Level::Initial => packet::Epoch::Initial,
crypto::Level::ZeroRTT => unreachable!(),
Expand All @@ -6831,6 +6832,7 @@ impl Connection {
// Initial later on.
//
// https://datatracker.ietf.org/doc/html/rfc9000#name-immediate-close-during-the-
force_downgrade = true;
packet::Epoch::Handshake
}
},
Expand All @@ -6847,7 +6849,8 @@ impl Connection {
// not be able to decrypt handshake packets yet.
packet::Epoch::Handshake
if self.pkt_num_spaces[packet::Epoch::Initial]
.has_keys() =>
.has_keys() &&
!force_downgrade =>
return Ok(packet::Type::Initial),

_ => (),
Expand Down

0 comments on commit 8c0784d

Please sign in to comment.