src/net/third_party/quiche/src/quic/core/quic_dispatcher_test.cc
// Disabling CHLO size validation allows the dispatcher to send version
// negotiation packets in response to a CHLO that is otherwise too small.
Disabling CHLO size validation allows the dispatcher to send version
negotiation packets in response to a CHLO that is otherwise too small.
Disabling CHLO size validation allows the dispatcher to send version negotiation packets in response to a CHLO that is otherwise too small .
TEST_P(QuicDispatcherTestOneVersion,
       VersionNegotiationWithoutChloSizeValidation) {
  crypto_config_.set_validate_chlo_size(false);
  CreateTimeWaitListManager();
  QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
  EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _)).Times(0);
  EXPECT_CALL(*time_wait_list_manager_,
              SendVersionNegotiationPacket(_, _, _, _, _, _, _, _))
      .Times(1);
  std::string chlo = SerializeCHLO() + std::string(1200, 'a');
  DCHECK_LE(1200u, chlo.length());
  std::string truncated_chlo = chlo.substr(0, 1100);
  DCHECK_EQ(1100u, truncated_chlo.length());
  ProcessPacket(client_address, TestConnectionId(1), true,
                QuicVersionReservedForNegotiation(), truncated_chlo, true,
                CONNECTION_ID_PRESENT, PACKET_4BYTE_PACKET_NUMBER, 1);
}
TEST_P ( QuicDispatcherTestOneVersion , VersionNegotiationWithoutChloSizeValidation ) { crypto_config_ . set_validate_chlo_size ( false ) ; CreateTimeWaitListManager ( ) ; QuicSocketAddress client_address ( QuicIpAddress :: Loopback4 ( ) , 1 ) ; EXPECT_CALL ( * dispatcher_ , CreateQuicSession ( _ , _ , _ , _ ) ) . Times ( 0 ) ; EXPECT_CALL ( * time_wait_list_manager_ , SendVersionNegotiationPacket ( _ , _ , _ , _ , _ , _ , _ , _ ) ) . Times ( 1 ) ; std :: string chlo = SerializeCHLO ( ) + std :: string ( 1200 , ' ' ) ; DCHECK_LE ( 1200u , chlo . length ( ) ) ; std :: string truncated_chlo = chlo . substr ( 0 , 1100 ) ; DCHECK_EQ ( 1100u , truncated_chlo . length ( ) ) ; ProcessPacket ( client_address , TestConnectionId ( 1 ) , true , QuicVersionReservedForNegotiation ( ) , truncated_chlo , true , CONNECTION_ID_PRESENT , PACKET_4BYTE_PACKET_NUMBER , 1 ) ; }
Disabling CHLO size validation allows the dispatcher to send version
negotiation packets in response to a CHLO that is otherwise too small.
Disabling CHLO size validation allows the dispatcher to send version negotiation packets in response to a CHLO that is otherwise too small .
// Truncate to 1100 bytes of payload which results in a packet just // under 1200 bytes after framing, packet, and encryption overhead.