| Index: net/quic/crypto/quic_crypto_client_config.cc
|
| diff --git a/net/quic/crypto/quic_crypto_client_config.cc b/net/quic/crypto/quic_crypto_client_config.cc
|
| index 95d17265a00933fb5903aa8234b35ae78a18a43e..a0b3e9efa688d2e4990f03f1f1cbbd7b29295446 100644
|
| --- a/net/quic/crypto/quic_crypto_client_config.cc
|
| +++ b/net/quic/crypto/quic_crypto_client_config.cc
|
| @@ -648,23 +648,24 @@ QuicErrorCode QuicCryptoClientConfig::ProcessServerHello(
|
|
|
| const QuicTag* supported_version_tags;
|
| size_t num_supported_versions;
|
| - // TODO(rch): Once QUIC_VERSION_12 is removed, then make it a failure
|
| - // if the server does not have a version list.
|
| +
|
| if (server_hello.GetTaglist(kVER, &supported_version_tags,
|
| - &num_supported_versions) == QUIC_NO_ERROR) {
|
| - if (!negotiated_versions.empty()) {
|
| - bool mismatch = num_supported_versions != negotiated_versions.size();
|
| - for (size_t i = 0; i < num_supported_versions && !mismatch; ++i) {
|
| - mismatch = QuicTagToQuicVersion(supported_version_tags[i]) !=
|
| - negotiated_versions[i];
|
| - }
|
| - // The server sent a list of supported versions, and the connection
|
| - // reports that there was a version negotiation during the handshake.
|
| + &num_supported_versions) != QUIC_NO_ERROR) {
|
| + *error_details = "server hello missing version list";
|
| + return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
|
| + }
|
| + if (!negotiated_versions.empty()) {
|
| + bool mismatch = num_supported_versions != negotiated_versions.size();
|
| + for (size_t i = 0; i < num_supported_versions && !mismatch; ++i) {
|
| + mismatch = QuicTagToQuicVersion(supported_version_tags[i]) !=
|
| + negotiated_versions[i];
|
| + }
|
| + // The server sent a list of supported versions, and the connection
|
| + // reports that there was a version negotiation during the handshake.
|
| // Ensure that these two lists are identical.
|
| - if (mismatch) {
|
| - *error_details = "Downgrade attack detected";
|
| - return QUIC_VERSION_NEGOTIATION_MISMATCH;
|
| - }
|
| + if (mismatch) {
|
| + *error_details = "Downgrade attack detected";
|
| + return QUIC_VERSION_NEGOTIATION_MISMATCH;
|
| }
|
| }
|
|
|
|
|