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 a4f28d959fbeef6f9ecf19ae44ecaf7fea2f97bf..173e98080920e548f39e9ba7d5ce881b973819b7 100644 |
--- a/net/quic/crypto/quic_crypto_server_config.cc |
+++ b/net/quic/crypto/quic_crypto_server_config.cc |
@@ -1040,13 +1040,27 @@ void QuicCryptoServerConfig::EvaluateClientHello( |
found_error = true; |
} |
+ // Server nonce is optional, and used for key derivation if present. |
+ client_hello.GetStringPiece(kServerNonceTag, &info->server_nonce); |
+ |
+ if (version > QUIC_VERSION_26) { |
+ DVLOG(1) << "No 0-RTT replay protection in QUIC_VERSION_27 and higher."; |
+ // If the server nonce is empty and we're requiring handshake confirmation |
+ // for DoS reasons then we must reject the CHLO. |
+ if (FLAGS_quic_require_handshake_confirmation && |
+ info->server_nonce.empty()) { |
+ info->reject_reasons.push_back(SERVER_NONCE_REQUIRED_FAILURE); |
+ } |
+ helper.ValidationComplete(QUIC_NO_ERROR, ""); |
+ return; |
+ } |
+ |
if (!replay_protection_) { |
DVLOG(1) << "No replay protection."; |
helper.ValidationComplete(QUIC_NO_ERROR, ""); |
return; |
} |
- client_hello.GetStringPiece(kServerNonceTag, &info->server_nonce); |
if (!info->server_nonce.empty()) { |
// If the server nonce is present, use it to establish uniqueness. |
HandshakeFailureReason server_nonce_error = |