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

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

Issue 1569853005: relnote: Require QUIC handshakes to require either a valid server nonce or a remote strike register. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02_CL_111655037
Patch Set: rebase after remove 111628983 Created 4 years, 11 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 6c07ad7fe4db6a955d30c66b6c3271fa6e7d8943..b2fa3472e189961772a5c54787f79161a45af1c3 100644
--- a/net/quic/crypto/crypto_server_test.cc
+++ b/net/quic/crypto/crypto_server_test.cc
@@ -359,9 +359,9 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
void CheckRejectTag() {
if (RejectsAreStateless()) {
- ASSERT_EQ(kSREJ, out_.tag());
+ ASSERT_EQ(kSREJ, out_.tag()) << QuicUtils::TagToString(out_.tag());
} else {
- ASSERT_EQ(kREJ, out_.tag());
+ ASSERT_EQ(kREJ, out_.tag()) << QuicUtils::TagToString(out_.tag());
}
}
@@ -761,6 +761,7 @@ TEST_P(CryptoServerTest, ReplayProtection) {
if (client_version_ > QUIC_VERSION_30) {
return;
}
+ FLAGS_require_strike_register_or_server_nonce = false;
// This tests that disabling replay protection works.
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
@@ -798,6 +799,33 @@ TEST_P(CryptoServerTest, ReplayProtection) {
CheckServerHello(out_);
}
+TEST_P(CryptoServerTest, NoServerNonce) {
+ FLAGS_require_strike_register_or_server_nonce = true;
+ // When no server nonce is present and no strike register is configured,
+ // the CHLO should be rejected.
+ // clang-format off
+ CryptoHandshakeMessage msg = CryptoTestUtils::Message(
+ "CHLO",
+ "AEAD", "AESG",
+ "KEXS", "C255",
+ "SCID", scid_hex_.c_str(),
+ "#004b5453", srct_hex_.c_str(),
+ "PUBS", pub_hex_.c_str(),
+ "NONC", nonce_hex_.c_str(),
+ "XLCT", XlctHexString().c_str(),
+ "VER\0", client_version_string_.c_str(),
+ "$padding", static_cast<int>(kClientHelloMinimumSize),
+ nullptr);
+ // clang-format on
+
+ ShouldSucceed(msg);
+
+ CheckRejectTag();
+ const HandshakeFailureReason kRejectReasons[] = {
+ SERVER_NONCE_REQUIRED_FAILURE};
+ CheckRejectReasons(kRejectReasons, arraysize(kRejectReasons));
+}
+
TEST_P(CryptoServerTest, ProofForSuppliedServerConfig) {
ValueRestore<bool> old_flag(&FLAGS_quic_use_primary_config_for_proof, true);
client_address_ = IPEndPoint(Loopback6(), 1234);
« 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