| 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 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 } | 1459 } |
| 1460 | 1460 |
| 1461 return config.source_address_token_boxer->Box( | 1461 return config.source_address_token_boxer->Box( |
| 1462 rand, source_address_tokens.SerializeAsString()); | 1462 rand, source_address_tokens.SerializeAsString()); |
| 1463 } | 1463 } |
| 1464 | 1464 |
| 1465 bool QuicCryptoServerConfig::HasProofSource() const { | 1465 bool QuicCryptoServerConfig::HasProofSource() const { |
| 1466 return proof_source_ != nullptr; | 1466 return proof_source_ != nullptr; |
| 1467 } | 1467 } |
| 1468 | 1468 |
| 1469 int QuicCryptoServerConfig::NumberOfConfigs() const { |
| 1470 base::AutoLock locked(configs_lock_); |
| 1471 return configs_.size(); |
| 1472 } |
| 1473 |
| 1469 HandshakeFailureReason QuicCryptoServerConfig::ParseSourceAddressToken( | 1474 HandshakeFailureReason QuicCryptoServerConfig::ParseSourceAddressToken( |
| 1470 const Config& config, | 1475 const Config& config, |
| 1471 StringPiece token, | 1476 StringPiece token, |
| 1472 SourceAddressTokens* tokens) const { | 1477 SourceAddressTokens* tokens) const { |
| 1473 string storage; | 1478 string storage; |
| 1474 StringPiece plaintext; | 1479 StringPiece plaintext; |
| 1475 if (!config.source_address_token_boxer->Unbox(token, &storage, &plaintext)) { | 1480 if (!config.source_address_token_boxer->Unbox(token, &storage, &plaintext)) { |
| 1476 return SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE; | 1481 return SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE; |
| 1477 } | 1482 } |
| 1478 | 1483 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1692 QuicCryptoServerConfig::Config::Config() | 1697 QuicCryptoServerConfig::Config::Config() |
| 1693 : channel_id_enabled(false), | 1698 : channel_id_enabled(false), |
| 1694 is_primary(false), | 1699 is_primary(false), |
| 1695 primary_time(QuicWallTime::Zero()), | 1700 primary_time(QuicWallTime::Zero()), |
| 1696 priority(0), | 1701 priority(0), |
| 1697 source_address_token_boxer(nullptr) {} | 1702 source_address_token_boxer(nullptr) {} |
| 1698 | 1703 |
| 1699 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } | 1704 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } |
| 1700 | 1705 |
| 1701 } // namespace net | 1706 } // namespace net |
| OLD | NEW |