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

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

Issue 1404523004: relnote: Check QUIC handshake reject_reasons to decide whether to send (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Create_Quic_version_28_103943396
Patch Set: Created 5 years, 2 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/crypto/quic_crypto_server_config.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/quic_crypto_server_config.cc
diff --git a/net/quic/crypto/quic_crypto_server_config.cc b/net/quic/crypto/quic_crypto_server_config.cc
index 8481a0ed0d823deaf34fbb857e31e58ee55e2e96..ec123a606713aa324a3d9219e3c0498351f2ee6e 100644
--- a/net/quic/crypto/quic_crypto_server_config.cc
+++ b/net/quic/crypto/quic_crypto_server_config.cc
@@ -120,7 +120,6 @@ class VerifyNonceIsValidAndUniqueCallback
InsertStatus nonce_error) override {
DVLOG(1) << "Using client nonce, unique: " << nonce_is_valid_and_unique
<< " nonce_error: " << nonce_error;
- result_->info.unique = nonce_is_valid_and_unique;
if (!nonce_is_valid_and_unique) {
HandshakeFailureReason client_nonce_error;
switch (nonce_error) {
@@ -168,12 +167,7 @@ const char QuicCryptoServerConfig::TESTING[] = "secret string for testing";
ClientHelloInfo::ClientHelloInfo(const IPAddressNumber& in_client_ip,
QuicWallTime in_now)
- : client_ip(in_client_ip),
- now(in_now),
- valid_source_address_token(false),
- client_nonce_well_formed(false),
- unique(false) {
-}
+ : client_ip(in_client_ip), now(in_now), valid_source_address_token(false) {}
ClientHelloInfo::~ClientHelloInfo() {
}
@@ -617,10 +611,7 @@ QuicErrorCode QuicCryptoServerConfig::ProcessClientHello(
return QUIC_HANDSHAKE_FAILED;
}
- if (!info.valid_source_address_token ||
- !info.client_nonce_well_formed ||
- !info.unique ||
- !requested_config.get()) {
+ if (!info.reject_reasons.empty() || !requested_config.get()) {
BuildRejection(*primary_config, client_hello, info,
validate_chlo_result.cached_network_params,
use_stateless_rejects, server_designated_connection_id, rand,
@@ -1032,10 +1023,8 @@ void QuicCryptoServerConfig::EvaluateClientHello(
}
}
- if (client_hello.GetStringPiece(kNONC, &info->client_nonce) &&
- info->client_nonce.size() == kNonceSize) {
- info->client_nonce_well_formed = true;
- } else {
+ if (!client_hello.GetStringPiece(kNONC, &info->client_nonce) ||
+ info->client_nonce.size() != kNonceSize) {
info->reject_reasons.push_back(CLIENT_NONCE_INVALID_FAILURE);
// Invalid client nonce.
DVLOG(1) << "Invalid client nonce.";
@@ -1047,9 +1036,6 @@ void QuicCryptoServerConfig::EvaluateClientHello(
}
if (!replay_protection_) {
- if (!found_error) {
- info->unique = true;
- }
DVLOG(1) << "No replay protection.";
helper.ValidationComplete(QUIC_NO_ERROR, "");
return;
@@ -1060,13 +1046,11 @@ void QuicCryptoServerConfig::EvaluateClientHello(
// If the server nonce is present, use it to establish uniqueness.
HandshakeFailureReason server_nonce_error =
ValidateServerNonce(info->server_nonce, info->now);
- if (server_nonce_error == HANDSHAKE_OK) {
- info->unique = true;
- } else {
+ bool is_unique = server_nonce_error == HANDSHAKE_OK;
+ if (!is_unique) {
info->reject_reasons.push_back(server_nonce_error);
- info->unique = false;
}
- DVLOG(1) << "Using server nonce, unique: " << info->unique;
+ DVLOG(1) << "Using server nonce, unique: " << is_unique;
helper.ValidationComplete(QUIC_NO_ERROR, "");
return;
}
« no previous file with comments | « net/quic/crypto/quic_crypto_server_config.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698