Deprecate --gfe2_reloadable_flag_http2_hpack_varint_decoding_fix
PiperOrigin-RevId: 822586724
diff --git a/quiche/common/quiche_feature_flags_list.h b/quiche/common/quiche_feature_flags_list.h
index 07f5e0c..861fc85 100755
--- a/quiche/common/quiche_feature_flags_list.h
+++ b/quiche/common/quiche_feature_flags_list.h
@@ -10,7 +10,6 @@
QUICHE_FLAG(bool, quiche_reloadable_flag_enable_h3_origin_frame, false, true, "If true, enables support for parsing HTTP/3 ORIGIN frames.")
QUICHE_FLAG(bool, quiche_reloadable_flag_enable_tls_trust_anchor_ids, true, true, "When true, QUIC client and server will support TLS Trust Anchor IDs.")
-QUICHE_FLAG(bool, quiche_reloadable_flag_http2_hpack_varint_decoding_fix, true, true, "If true, HPACK decoders will only allow variable-length integer to be less than 32 bit, and emit compression error otherwise.")
QUICHE_FLAG(bool, quiche_reloadable_flag_quic_act_upon_invalid_header, true, true, "If true, reject or send error response code upon receiving invalid request or response headers.")
QUICHE_FLAG(bool, quiche_reloadable_flag_quic_add_stream_info_to_idle_close_detail, false, true, "If true, include stream information in idle timeout connection close detail.")
QUICHE_FLAG(bool, quiche_reloadable_flag_quic_allow_client_enabled_2x_initial_cwnd, true, true, "Doubles the initial congestion window for QUIC connections when initiated by the client")
diff --git a/quiche/http2/hpack/decoder/hpack_entry_decoder.cc b/quiche/http2/hpack/decoder/hpack_entry_decoder.cc
index 294a5ab..701e315 100644
--- a/quiche/http2/hpack/decoder/hpack_entry_decoder.cc
+++ b/quiche/http2/hpack/decoder/hpack_entry_decoder.cc
@@ -65,8 +65,7 @@
DecodeStatus status = entry_type_decoder_.Start(db);
switch (status) {
case DecodeStatus::kDecodeDone:
- if (GetQuicheReloadableFlag(http2_hpack_varint_decoding_fix) &&
- entry_type_decoder_.varint() > std::numeric_limits<uint32_t>::max()) {
+ if (entry_type_decoder_.varint() > std::numeric_limits<uint32_t>::max()) {
QUICHE_VLOG(2)
<< "Invalid varint for index: " << entry_type_decoder_.varint()
<< ". The index should be representable using 4 bytes as the max "
@@ -129,9 +128,8 @@
// entry_type_decoder_ returned kDecodeDone, now need to decide how
// to proceed.
QUICHE_DVLOG(1) << "kDecodedType: db->Remaining=" << db->Remaining();
- if (GetQuicheReloadableFlag(http2_hpack_varint_decoding_fix) &&
- entry_type_decoder_.varint() >
- std::numeric_limits<uint32_t>::max()) {
+ if (entry_type_decoder_.varint() >
+ std::numeric_limits<uint32_t>::max()) {
error_ = HpackDecodingError::kIndexVarintError;
QUICHE_VLOG(2)
<< "Invalid varint for index: " << entry_type_decoder_.varint()
@@ -242,8 +240,7 @@
bool HpackEntryDecoder::DispatchOnType(HpackEntryDecoderListener* listener) {
const HpackEntryType entry_type = entry_type_decoder_.entry_type();
const uint32_t varint = static_cast<uint32_t>(entry_type_decoder_.varint());
- QUICHE_DCHECK(!GetQuicheReloadableFlag(http2_hpack_varint_decoding_fix) ||
- varint == entry_type_decoder_.varint());
+ QUICHE_DCHECK(varint == entry_type_decoder_.varint());
switch (entry_type) {
case HpackEntryType::kIndexedHeader:
// The entry consists solely of the entry type and varint. See:
diff --git a/quiche/http2/hpack/decoder/hpack_entry_decoder_test.cc b/quiche/http2/hpack/decoder/hpack_entry_decoder_test.cc
index e1c10b8..526404d 100644
--- a/quiche/http2/hpack/decoder/hpack_entry_decoder_test.cc
+++ b/quiche/http2/hpack/decoder/hpack_entry_decoder_test.cc
@@ -86,23 +86,9 @@
const char input[] = {
'\xff', '\x92', '\xff', '\xff', '\xff', '\xff',
'\xff', '\xff', '\xff', '\xff', '\x00'}; // == Index 2^63 + 17 ==
- if (GetQuicheReloadableFlag(http2_hpack_varint_decoding_fix)) {
DecodeBuffer b(input);
EXPECT_TRUE(DecodeAndValidateSeveralWays(&b, ValidateError()));
EXPECT_EQ(decoder_.error(), HpackDecodingError::kIndexVarintError);
- } else {
- DecodeBuffer b1(input);
- auto do_check1 = [this]() {
- return collector_.ValidateIndexedHeader((1ULL << 63) + 17);
- };
- EXPECT_TRUE(DecodeSegmentsAndValidate(&b1, SelectRemaining(),
- ValidateDoneAndEmpty(do_check1)));
- // If decoding 1 byte at a time, the decoder will return a wrong index.
- DecodeBuffer b2(input);
- auto do_check2 = [this]() { return collector_.ValidateIndexedHeader(17); };
- EXPECT_TRUE(DecodeSegmentsAndValidate(&b2, SelectOne(),
- ValidateDoneAndEmpty(do_check2)));
- }
}
TEST_F(HpackEntryDecoderTest, IndexedHeader_Various) {
diff --git a/quiche/http2/hpack/decoder/hpack_string_decoder.h b/quiche/http2/hpack/decoder/hpack_string_decoder.h
index 14ba7b1..210d3c9 100644
--- a/quiche/http2/hpack/decoder/hpack_string_decoder.h
+++ b/quiche/http2/hpack/decoder/hpack_string_decoder.h
@@ -165,8 +165,7 @@
// false otherwise, in which case status set.
template <class Listener>
bool OnStringStart(Listener* cb, DecodeStatus* status) {
- if (GetQuicheReloadableFlag(http2_hpack_varint_decoding_fix) &&
- (length_decoder_.value() > std::numeric_limits<uint32_t>::max())) {
+ if (length_decoder_.value() > std::numeric_limits<uint32_t>::max()) {
// Upper layer decoder is even more strict about the string length. But
// for simplicity, and to avoid the possibility of integer overflow on
// 32-bit platforms, strings with lengths greater than 2^32 are rejected.
diff --git a/quiche/http2/hpack/decoder/hpack_string_decoder_test.cc b/quiche/http2/hpack/decoder/hpack_string_decoder_test.cc
index 3eb0f7c..7b54a76 100644
--- a/quiche/http2/hpack/decoder/hpack_string_decoder_test.cc
+++ b/quiche/http2/hpack/decoder/hpack_string_decoder_test.cc
@@ -161,15 +161,8 @@
memcpy(input, length_prefix, sizeof(length_prefix));
memcpy(input + sizeof(length_prefix), partial_string.data(), 1024);
DecodeBuffer b(input);
- if (GetQuicheReloadableFlag(http2_hpack_varint_decoding_fix)) {
EXPECT_TRUE(DecodeAndValidateSeveralWays(&b, kMayReturnZeroOnFirst,
ValidateError()));
- } else {
- // The decoder should be waiting for more bytes of the excessively long
- // string.
- EXPECT_TRUE(DecodeAndValidateSeveralWays(
- &b, kMayReturnZeroOnFirst, ValidateInProgressAndOffset(b.FullSize())));
- }
}
} // namespace
diff --git a/quiche/quic/core/qpack/qpack_instruction_decoder.cc b/quiche/quic/core/qpack/qpack_instruction_decoder.cc
index c5f2da5..91e324e 100644
--- a/quiche/quic/core/qpack/qpack_instruction_decoder.cc
+++ b/quiche/quic/core/qpack/qpack_instruction_decoder.cc
@@ -242,19 +242,11 @@
return true;
}
- if (GetQuicReloadableFlag(http2_hpack_varint_decoding_fix)) {
if (varint_decoder_.value() > kStringLiteralLengthLimit) {
OnError(ErrorCode::STRING_LITERAL_TOO_LONG, "String literal too long.");
return false;
}
string_length_ = varint_decoder_.value();
- } else {
- string_length_ = varint_decoder_.value();
- if (string_length_ > kStringLiteralLengthLimit) {
- OnError(ErrorCode::STRING_LITERAL_TOO_LONG, "String literal too long.");
- return false;
- }
- }
std::string* const string =
(field_->type == QpackInstructionFieldType::kName) ? &name_ : &value_;