gfe-relnote: (n/a) Remove parameter "reject_is_stateless" from function quic::test::crypto_test_utils::FillInDummyReject. Test only.
PiperOrigin-RevId: 249059306
Change-Id: Iaef55264d3a2687ef65f3f3cb6895296529af756
diff --git a/quic/core/crypto/quic_crypto_client_config_test.cc b/quic/core/crypto/quic_crypto_client_config_test.cc
index b7dd529..563c7f1 100644
--- a/quic/core/crypto/quic_crypto_client_config_test.cc
+++ b/quic/core/crypto/quic_crypto_client_config_test.cc
@@ -535,7 +535,7 @@
TEST_F(QuicCryptoClientConfigTest, ProcessReject) {
CryptoHandshakeMessage rej;
- crypto_test_utils::FillInDummyReject(&rej, /* stateless */ false);
+ crypto_test_utils::FillInDummyReject(&rej);
// Now process the rejection.
QuicCryptoClientConfig::CachedState cached;
@@ -554,7 +554,7 @@
TEST_F(QuicCryptoClientConfigTest, ProcessRejectWithLongTTL) {
CryptoHandshakeMessage rej;
- crypto_test_utils::FillInDummyReject(&rej, /* stateless */ false);
+ crypto_test_utils::FillInDummyReject(&rej);
QuicTime::Delta one_week = QuicTime::Delta::FromSeconds(kNumSecondsPerWeek);
int64_t long_ttl = 3 * one_week.ToSeconds();
rej.SetValue(kSTTL, long_ttl);
@@ -578,55 +578,6 @@
QuicWallTime::FromUNIXSeconds(one_week.ToSeconds() - 1)));
}
-TEST_F(QuicCryptoClientConfigTest, ProcessStatelessReject) {
- // Create a dummy reject message and mark it as stateless.
- CryptoHandshakeMessage rej;
- crypto_test_utils::FillInDummyReject(&rej, /* stateless */ true);
- const QuicConnectionId kConnectionId = TestConnectionId(0xdeadbeef);
- const std::string server_nonce = "SERVER_NONCE";
- const uint64_t kConnectionId64 = TestConnectionIdToUInt64(kConnectionId);
- rej.SetValue(kRCID, kConnectionId64);
- rej.SetStringPiece(kServerNonceTag, server_nonce);
-
- // Now process the rejection.
- QuicCryptoClientConfig::CachedState cached;
- QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> out_params(
- new QuicCryptoNegotiatedParameters);
- std::string error;
- QuicCryptoClientConfig config(crypto_test_utils::ProofVerifierForTesting(),
- TlsClientHandshaker::CreateSslCtx());
- EXPECT_EQ(QUIC_NO_ERROR,
- config.ProcessRejection(rej, QuicWallTime::FromUNIXSeconds(0),
- AllSupportedTransportVersions().front(), "",
- &cached, out_params, &error));
- EXPECT_TRUE(cached.has_server_designated_connection_id());
- EXPECT_EQ(TestConnectionId(QuicEndian::NetToHost64(
- TestConnectionIdToUInt64(kConnectionId))),
- cached.GetNextServerDesignatedConnectionId());
- EXPECT_EQ(server_nonce, cached.GetNextServerNonce());
-}
-
-TEST_F(QuicCryptoClientConfigTest, BadlyFormattedStatelessReject) {
- // Create a dummy reject message and mark it as stateless. Do not
- // add an server-designated connection-id.
- CryptoHandshakeMessage rej;
- crypto_test_utils::FillInDummyReject(&rej, /* stateless */ true);
-
- // Now process the rejection.
- QuicCryptoClientConfig::CachedState cached;
- QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> out_params(
- new QuicCryptoNegotiatedParameters);
- std::string error;
- QuicCryptoClientConfig config(crypto_test_utils::ProofVerifierForTesting(),
- TlsClientHandshaker::CreateSslCtx());
- EXPECT_EQ(QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND,
- config.ProcessRejection(rej, QuicWallTime::FromUNIXSeconds(0),
- AllSupportedTransportVersions().front(), "",
- &cached, out_params, &error));
- EXPECT_FALSE(cached.has_server_designated_connection_id());
- EXPECT_EQ("Missing kRCID", error);
-}
-
TEST_F(QuicCryptoClientConfigTest, ServerNonceinSHLO) {
// Test that the server must include a nonce in the SHLO.
CryptoHandshakeMessage msg;
diff --git a/quic/core/http/quic_spdy_client_session_test.cc b/quic/core/http/quic_spdy_client_session_test.cc
index 0d6b36c..ea9e058 100644
--- a/quic/core/http/quic_spdy_client_session_test.cc
+++ b/quic/core/http/quic_spdy_client_session_test.cc
@@ -214,7 +214,7 @@
// an inchoate CHLO to be sent and will leave the encryption level
// at NONE.
CryptoHandshakeMessage rej;
- crypto_test_utils::FillInDummyReject(&rej, /* stateless */ false);
+ crypto_test_utils::FillInDummyReject(&rej);
EXPECT_TRUE(session_->IsEncryptionEstablished());
crypto_test_utils::SendHandshakeMessageToStream(
session_->GetMutableCryptoStream(), rej, Perspective::IS_CLIENT);
diff --git a/quic/test_tools/crypto_test_utils.cc b/quic/test_tools/crypto_test_utils.cc
index ac7e384..6471814 100644
--- a/quic/test_tools/crypto_test_utils.cc
+++ b/quic/test_tools/crypto_test_utils.cc
@@ -481,12 +481,8 @@
return new class MockCommonCertSets(cert, hash, index);
}
-void FillInDummyReject(CryptoHandshakeMessage* rej, bool reject_is_stateless) {
- if (reject_is_stateless) {
- rej->set_tag(kSREJ);
- } else {
- rej->set_tag(kREJ);
- }
+void FillInDummyReject(CryptoHandshakeMessage* rej) {
+ rej->set_tag(kREJ);
// Minimum SCFG that passes config validation checks.
// clang-format off
diff --git a/quic/test_tools/crypto_test_utils.h b/quic/test_tools/crypto_test_utils.h
index 7397f85..421c0f3d 100644
--- a/quic/test_tools/crypto_test_utils.h
+++ b/quic/test_tools/crypto_test_utils.h
@@ -132,7 +132,7 @@
// Creates a minimal dummy reject message that will pass the client-config
// validation tests. This will include a server config, but no certs, proof
// source address token, or server nonce.
-void FillInDummyReject(CryptoHandshakeMessage* rej, bool reject_is_stateless);
+void FillInDummyReject(CryptoHandshakeMessage* rej);
// ParseTag returns a QuicTag from parsing |tagstr|. |tagstr| may either be
// in the format "EXMP" (i.e. ASCII format), or "#11223344" (an explicit hex