Fix expected_server_connection_id_length on client
When should_update_expected_server_connection_id_length is true, ProcessAndValidateIetfConnectionIdLength, expected_server_connection_id_length will update expected_server_connection_id_length. Unfortunately that code was wrong on the client as it only looked at the destination connection ID length instead of the source on the client. This CL fixes that error and adds a test. This wasn't an issue in production because we've only ever used should_update_expected_server_connection_id_length on the server.
gfe-relnote: client-only change, not flag protected
PiperOrigin-RevId: 250586674
Change-Id: Iccb6776bc9aa41350f1e80ecddea76ba8aa4eb30
diff --git a/quic/test_tools/quic_framer_peer.cc b/quic/test_tools/quic_framer_peer.cc
index 6eedd60..94493c3 100644
--- a/quic/test_tools/quic_framer_peer.cc
+++ b/quic/test_tools/quic_framer_peer.cc
@@ -351,5 +351,22 @@
return framer->largest_decrypted_packet_numbers_[packet_number_space];
}
+// static
+bool QuicFramerPeer::ProcessAndValidateIetfConnectionIdLength(
+ QuicDataReader* reader,
+ ParsedQuicVersion version,
+ Perspective perspective,
+ bool should_update_expected_server_connection_id_length,
+ uint8_t* expected_server_connection_id_length,
+ uint8_t* destination_connection_id_length,
+ uint8_t* source_connection_id_length,
+ std::string* detailed_error) {
+ return QuicFramer::ProcessAndValidateIetfConnectionIdLength(
+ reader, version, perspective,
+ should_update_expected_server_connection_id_length,
+ expected_server_connection_id_length, destination_connection_id_length,
+ source_connection_id_length, detailed_error);
+}
+
} // namespace test
} // namespace quic