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 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 " private key."; | 1327 " private key."; |
1328 return nullptr; | 1328 return nullptr; |
1329 } | 1329 } |
1330 break; | 1330 break; |
1331 default: | 1331 default: |
1332 LOG(WARNING) << "Server config message contains unknown key exchange " | 1332 LOG(WARNING) << "Server config message contains unknown key exchange " |
1333 "method: " << tag; | 1333 "method: " << tag; |
1334 return nullptr; | 1334 return nullptr; |
1335 } | 1335 } |
1336 | 1336 |
1337 for (vector<KeyExchange*>::const_iterator j = config->key_exchanges.begin(); | 1337 for (const KeyExchange* key_exchange : config->key_exchanges) { |
1338 j != config->key_exchanges.end(); ++j) { | 1338 if (key_exchange->tag() == tag) { |
1339 if ((*j)->tag() == tag) { | |
1340 LOG(WARNING) << "Duplicate key exchange in config: " << tag; | 1339 LOG(WARNING) << "Duplicate key exchange in config: " << tag; |
1341 return nullptr; | 1340 return nullptr; |
1342 } | 1341 } |
1343 } | 1342 } |
1344 | 1343 |
1345 config->key_exchanges.push_back(ka.release()); | 1344 config->key_exchanges.push_back(ka.release()); |
1346 } | 1345 } |
1347 | 1346 |
1348 return config; | 1347 return config; |
1349 } | 1348 } |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1694 QuicCryptoServerConfig::Config::Config() | 1693 QuicCryptoServerConfig::Config::Config() |
1695 : channel_id_enabled(false), | 1694 : channel_id_enabled(false), |
1696 is_primary(false), | 1695 is_primary(false), |
1697 primary_time(QuicWallTime::Zero()), | 1696 primary_time(QuicWallTime::Zero()), |
1698 priority(0), | 1697 priority(0), |
1699 source_address_token_boxer(nullptr) {} | 1698 source_address_token_boxer(nullptr) {} |
1700 | 1699 |
1701 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } | 1700 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } |
1702 | 1701 |
1703 } // namespace net | 1702 } // namespace net |
OLD | NEW |