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

Unified Diff: net/quic/crypto/crypto_server_test.cc

Issue 2187463004: Add a new flag to require QUIC handshake confirmation, but only for versions before 33 FLAGS_quic_r… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@128425078
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 | « no previous file | net/quic/crypto/quic_crypto_server_config.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/crypto_server_test.cc
diff --git a/net/quic/crypto/crypto_server_test.cc b/net/quic/crypto/crypto_server_test.cc
index 40a715b6f2d7fc97e69488508812f23c07b0344b..3e564d88cb39b59ba862041f57f57ef475958a3b 100644
--- a/net/quic/crypto/crypto_server_test.cc
+++ b/net/quic/crypto/crypto_server_test.cc
@@ -119,6 +119,8 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
client_version_string_ =
QuicUtils::TagToString(QuicVersionToQuicTag(client_version_));
+ FLAGS_quic_require_handshake_confirmation_pre33 =
+ false;
FLAGS_enable_quic_stateless_reject_support =
GetParam().enable_stateless_rejects;
use_stateless_rejects_ = GetParam().use_stateless_rejects;
@@ -1174,5 +1176,42 @@ TEST_P(AsyncStrikeServerVerificationTest, AsyncReplayProtection) {
CheckRejectTag();
}
+TEST_P(AsyncStrikeServerVerificationTest, RequireHandshakeCofirmationPre33) {
+ FLAGS_quic_require_handshake_confirmation = false;
+ FLAGS_quic_require_handshake_confirmation_pre33 = true;
+ // clang-format off
+ CryptoHandshakeMessage msg = CryptoTestUtils::Message(
+ "CHLO",
+ "PDMD", "X509",
+ "AEAD", "AESG",
+ "KEXS", "C255",
+ "SNI", "foobar1.example.com",
+ "SCID", scid_hex_.c_str(),
+ "#004b5453", srct_hex_.c_str(),
+ "PUBS", pub_hex_.c_str(),
+ "NONC", nonce_hex_.c_str(),
+ "VER\0", client_version_string_.c_str(),
+ "XLCT", XlctHexString().c_str(),
+ "$padding", static_cast<int>(kClientHelloMinimumSize),
+ nullptr);
+ // clang-format on
+
+ ShouldSucceed(msg);
+
+ if (client_version_ <= QUIC_VERSION_32) {
+ // clang-format off
+ const HandshakeFailureReason kRejectReasons[] = {
+ SERVER_NONCE_REQUIRED_FAILURE
+ };
+ // clang-format on
+ CheckRejectReasons(kRejectReasons, arraysize(kRejectReasons));
+ EXPECT_EQ(0, strike_register_client_->PendingVerifications());
+ } else {
+ // version 33.
+ ASSERT_EQ(kSHLO, out_.tag());
+ CheckServerHello(out_);
+ }
+}
+
} // namespace test
} // namespace net
« no previous file with comments | « no previous file | net/quic/crypto/quic_crypto_server_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698