OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/crypto/quic_crypto_server_config.h" | 5 #include "net/quic/crypto/quic_crypto_server_config.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 if (server_nonce_error == HANDSHAKE_OK) { | 1007 if (server_nonce_error == HANDSHAKE_OK) { |
1008 info->unique = true; | 1008 info->unique = true; |
1009 } else { | 1009 } else { |
1010 info->reject_reasons.push_back(server_nonce_error); | 1010 info->reject_reasons.push_back(server_nonce_error); |
1011 info->unique = false; | 1011 info->unique = false; |
1012 } | 1012 } |
1013 DVLOG(1) << "Using server nonce, unique: " << info->unique; | 1013 DVLOG(1) << "Using server nonce, unique: " << info->unique; |
1014 helper.ValidationComplete(QUIC_NO_ERROR, ""); | 1014 helper.ValidationComplete(QUIC_NO_ERROR, ""); |
1015 return; | 1015 return; |
1016 } | 1016 } |
| 1017 // If we hit this block, the server nonce was empty. If we're requiring |
| 1018 // handshake confirmation for DoS reasons and there's no server nonce present, |
| 1019 // reject the CHLO. |
| 1020 if (FLAGS_quic_require_handshake_confirmation) { |
| 1021 info->reject_reasons.push_back(SERVER_NONCE_REQUIRED_FAILURE); |
| 1022 helper.ValidationComplete(QUIC_NO_ERROR, ""); |
| 1023 return; |
| 1024 } |
1017 | 1025 |
1018 // We want to contact strike register only if there are no errors because it | 1026 // We want to contact strike register only if there are no errors because it |
1019 // is a RPC call and is expensive. | 1027 // is a RPC call and is expensive. |
1020 if (found_error) { | 1028 if (found_error) { |
1021 helper.ValidationComplete(QUIC_NO_ERROR, ""); | 1029 helper.ValidationComplete(QUIC_NO_ERROR, ""); |
1022 return; | 1030 return; |
1023 } | 1031 } |
1024 | 1032 |
1025 // Use the client nonce to establish uniqueness. | 1033 // Use the client nonce to establish uniqueness. |
1026 StrikeRegisterClient* strike_register_client; | 1034 StrikeRegisterClient* strike_register_client; |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 QuicCryptoServerConfig::Config::Config() | 1647 QuicCryptoServerConfig::Config::Config() |
1640 : channel_id_enabled(false), | 1648 : channel_id_enabled(false), |
1641 is_primary(false), | 1649 is_primary(false), |
1642 primary_time(QuicWallTime::Zero()), | 1650 primary_time(QuicWallTime::Zero()), |
1643 priority(0), | 1651 priority(0), |
1644 source_address_token_boxer(nullptr) {} | 1652 source_address_token_boxer(nullptr) {} |
1645 | 1653 |
1646 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } | 1654 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } |
1647 | 1655 |
1648 } // namespace net | 1656 } // namespace net |
OLD | NEW |