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

Unified Diff: net/quic/quic_packet_creator_test.cc

Issue 2007223002: Explicitly disallow multi-packet CHLOs. Protected by FLAGS_quic_disallow_multi_packet_chlo, default… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@122481524
Patch Set: remove static_cast Created 4 years, 7 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/quic/quic_packet_creator.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_creator_test.cc
diff --git a/net/quic/quic_packet_creator_test.cc b/net/quic/quic_packet_creator_test.cc
index 6e571a1eb3ae98cfe593e445de4ef8e5527efc56..914650b2509205ff76ce3ccd7a02ddea52d74856 100644
--- a/net/quic/quic_packet_creator_test.cc
+++ b/net/quic/quic_packet_creator_test.cc
@@ -1190,6 +1190,26 @@ TEST_P(QuicPacketCreatorTest, AddUnencryptedStreamDataClosesConnection) {
"Cannot send stream data without encryption.");
}
+TEST_P(QuicPacketCreatorTest, ChloTooLarge) {
+ ValueRestore<bool> old_flag(&FLAGS_quic_disallow_multi_packet_chlo, true);
+ CryptoHandshakeMessage message;
+ message.set_tag(kCHLO);
+ message.set_minimum_size(kMaxPacketSize);
+ CryptoFramer framer;
+ std::unique_ptr<QuicData> message_data;
+ message_data.reset(framer.ConstructHandshakeMessage(message));
+
+ struct iovec iov;
+ QuicIOVector data_iovec(::net::MakeIOVector(
+ StringPiece(message_data->data(), message_data->length()), &iov));
+ QuicFrame frame;
+ EXPECT_CALL(delegate_,
+ OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, _, _));
+ EXPECT_DFATAL(
+ creator_.ConsumeData(1u, data_iovec, 0u, 0u, false, false, &frame),
+ "Client hello won't fit in a single packet.");
+}
+
} // namespace
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698