| 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 9b9bcb5bdeca6aed26d3f1d5385c8d2e5dff27d8..52e338b1842697f6ef8b2186f753bf20d905ec16 100644
|
| --- a/net/quic/crypto/quic_crypto_server_config.cc
|
| +++ b/net/quic/crypto/quic_crypto_server_config.cc
|
| @@ -482,18 +482,19 @@ QuicErrorCode QuicCryptoServerConfig::ProcessClientHello(
|
| // case, we need to make sure that we actually do not support this version
|
| // and that it wasn't a downgrade attack.
|
| QuicTag client_version_tag;
|
| - // TODO(rch): Make this check mandatory.
|
| - if (client_hello.GetUint32(kVER, &client_version_tag) == QUIC_NO_ERROR) {
|
| - QuicVersion client_version = QuicTagToQuicVersion(client_version_tag);
|
| - if (client_version != version) {
|
| - // Just because client_version is a valid version enum doesn't mean that
|
| - // this server actually supports that version, so we check to see if
|
| - // it's actually in the supported versions list.
|
| - for (size_t i = 0; i < supported_versions.size(); ++i) {
|
| - if (client_version == supported_versions[i]) {
|
| - *error_details = "Downgrade attack detected";
|
| - return QUIC_VERSION_NEGOTIATION_MISMATCH;
|
| - }
|
| + if (client_hello.GetUint32(kVER, &client_version_tag) != QUIC_NO_ERROR) {
|
| + *error_details = "client hello missing version list";
|
| + return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
|
| + }
|
| + QuicVersion client_version = QuicTagToQuicVersion(client_version_tag);
|
| + if (client_version != version) {
|
| + // Just because client_version is a valid version enum doesn't mean that
|
| + // this server actually supports that version, so we check to see if
|
| + // it's actually in the supported versions list.
|
| + for (size_t i = 0; i < supported_versions.size(); ++i) {
|
| + if (client_version == supported_versions[i]) {
|
| + *error_details = "Downgrade attack detected";
|
| + return QUIC_VERSION_NEGOTIATION_MISMATCH;
|
| }
|
| }
|
| }
|
|
|