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

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

Issue 1810073002: Log when client nonce is invalid. No functional change. Not flag protected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116973081
Patch Set: Created 4 years, 9 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 16140937c363bf4bdf7b17b5f36fbc9452c12de2..c65927aa9137756d387ca385088561140a7cd949 100644
--- a/net/quic/crypto/crypto_server_test.cc
+++ b/net/quic/crypto/crypto_server_test.cc
@@ -584,7 +584,6 @@ TEST_P(CryptoServerTest, BadSourceAddressToken) {
}
TEST_P(CryptoServerTest, BadClientNonce) {
- // Invalid nonces should be ignored.
// clang-format off
static const char* const kBadNonces[] = {
"",
@@ -594,6 +593,7 @@ TEST_P(CryptoServerTest, BadClientNonce) {
// clang-format on
for (size_t i = 0; i < arraysize(kBadNonces); i++) {
+ // Invalid nonces should be ignored, in an inchoate CHLO.
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
@@ -606,6 +606,30 @@ TEST_P(CryptoServerTest, BadClientNonce) {
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
CheckRejectReasons(kRejectReasons, arraysize(kRejectReasons));
+
+ // Invalid nonces should result in CLIENT_NONCE_INVALID_FAILURE.
+ // clang-format off
+ CryptoHandshakeMessage msg1 = CryptoTestUtils::Message(
+ "CHLO",
+ "AEAD", "AESG",
+ "KEXS", "C255",
+ "SCID", scid_hex_.c_str(),
+ "#004b5453", srct_hex_.c_str(),
+ "PUBS", pub_hex_.c_str(),
+ "NONC", kBadNonces[i],
+ "NONP", kBadNonces[i],
+ "XLCT", XlctHexString().c_str(),
+ "VER\0", client_version_string_.c_str(),
+ "$padding", static_cast<int>(kClientHelloMinimumSize),
+ nullptr);
+ // clang-format on
+
+ ShouldSucceed(msg1);
+
+ CheckRejectTag();
+ const HandshakeFailureReason kRejectReasons1[] = {
+ CLIENT_NONCE_INVALID_FAILURE};
+ CheckRejectReasons(kRejectReasons1, arraysize(kRejectReasons1));
}
}
« 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