Apply GREASE to QUIC Version Negotiation packets
This prevents client implementations from breaking when they observe unknown versions.
This also ensures that the produced packet will always be long enough to allow QUIC proxy munging.
gfe-relnote: minor change to packet format of Version Negotiation packets, protected by --gfe2_reloadable_flag_quic_disable_version_negotiation_grease_randomness
PiperOrigin-RevId: 255015606
Change-Id: I8070d543a765e914a2cdc07fd941fa5e1b359c14
diff --git a/quic/core/quic_framer_test.cc b/quic/core/quic_framer_test.cc
index 26e756f..486023a 100644
--- a/quic/core/quic_framer_test.cc
+++ b/quic/core/quic_framer_test.cc
@@ -6705,13 +6705,16 @@
}
TEST_P(QuicFramerTest, BuildVersionNegotiationPacket) {
+ SetQuicReloadableFlag(quic_version_negotiation_grease, true);
+ SetQuicFlag(FLAGS_quic_disable_version_negotiation_grease_randomness, true);
// clang-format off
unsigned char packet[] = {
// public flags (version, 8 byte connection_id)
0x0D,
// connection_id
0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
- // version tag
+ // supported versions
+ 0xDA, 0x5A, 0x3A, 0x3A,
QUIC_VERSION_BYTES,
};
unsigned char packet44[] = {
@@ -6723,7 +6726,8 @@
0x05,
// connection_id
0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
- // version tag
+ // supported versions
+ 0xDA, 0x5A, 0x3A, 0x3A,
QUIC_VERSION_BYTES,
};
// clang-format on
@@ -6752,6 +6756,8 @@
// Client connection IDs cannot be used unless this flag is true.
SetQuicRestartFlag(quic_do_not_override_connection_id, true);
+ SetQuicReloadableFlag(quic_version_negotiation_grease, true);
+ SetQuicFlag(FLAGS_quic_disable_version_negotiation_grease_randomness, true);
// clang-format off
unsigned char packet[] = {
@@ -6765,7 +6771,8 @@
0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x11,
// server/source connection ID
0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
- // version tag
+ // supported versions
+ 0xDA, 0x5A, 0x3A, 0x3A,
QUIC_VERSION_BYTES,
};
// clang-format on