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 52ff70908942f92f46c0045c89b854d75c33f4c1..26648a801f2ac701e36d2d5d5cccf4c2464be00d 100644 |
--- a/net/quic/crypto/quic_crypto_server_config.cc |
+++ b/net/quic/crypto/quic_crypto_server_config.cc |
@@ -484,18 +484,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 when we remove QUIC_VERSION_12. |
- 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; |
} |
} |
} |