Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1873)

Unified Diff: net/tools/quic/quic_dispatcher_test.cc

Issue 2128623002: Buffer undecryptable QUIC packets in the Dispatcher when doing cheap stateless rejects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@125958082
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_dispatcher_test.cc
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc
index a063a2daf66da169b2b1417a5745b81af66ce71d..51521daff7b12290cc1403f273093504f5c80ac3 100644
--- a/net/tools/quic/quic_dispatcher_test.cc
+++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -660,6 +660,51 @@ TEST_P(QuicDispatcherStatelessRejectTest, CheapRejects) {
}
}
+TEST_P(QuicDispatcherStatelessRejectTest, BufferNonChlo) {
+ FLAGS_quic_use_cheap_stateless_rejects = true;
+ CreateTimeWaitListManager();
+
+ const IPEndPoint client_address(net::test::Loopback4(), 1);
+ const QuicConnectionId connection_id = 1;
+
+ if (!GetParam().enable_stateless_rejects_via_flag) {
+ // If stateless rejects are not being used, then a connection will be
+ // created immediately.
+ EXPECT_CALL(dispatcher_, CreateQuicSession(connection_id, client_address))
+ .WillOnce(testing::Return(
+ CreateSessionBasedOnTestParams(connection_id, client_address)));
+ }
+ ProcessPacket(client_address, connection_id, true, false,
+ "NOT DATA FOR A CHLO");
+
+ // Process the first packet for the connection.
+ // clang-format off
+ CryptoHandshakeMessage client_hello = CryptoTestUtils::Message(
+ "CHLO",
+ "AEAD", "AESG",
+ "KEXS", "C255",
+ "NONC", "1234567890123456789012",
+ "VER\0", "Q025",
+ "$padding", static_cast<int>(kClientHelloMinimumSize),
+ nullptr);
+ // clang-format on
+
+ if (GetParam().enable_stateless_rejects_via_flag) {
+ // If stateless rejects are enabled then a connection will be created now
+ // and the buffered packet will be processed
+ EXPECT_CALL(dispatcher_, CreateQuicSession(connection_id, client_address))
+ .WillOnce(testing::Return(
+ CreateSessionBasedOnTestParams(connection_id, client_address)));
+ }
+ EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()),
+ ProcessUdpPacket(_, client_address, _))
+ .RetiresOnSaturation();
+ ProcessPacket(client_address, connection_id, true, false,
+ client_hello.GetSerialized().AsStringPiece().as_string());
+ EXPECT_FALSE(
+ time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id));
+}
+
// Verify the stopgap test: Packets with truncated connection IDs should be
// dropped.
class QuicDispatcherTestStrayPacketConnectionId : public QuicDispatcherTest {};
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698