| 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 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1413 source_address_token.set_ip(IPAddressToPackedString(ip_address)); | 1413 source_address_token.set_ip(IPAddressToPackedString(ip_address)); |
| 1414 source_address_token.set_timestamp(now.ToUNIXSeconds()); | 1414 source_address_token.set_timestamp(now.ToUNIXSeconds()); |
| 1415 if (cached_network_params != nullptr) { | 1415 if (cached_network_params != nullptr) { |
| 1416 source_address_token.set_cached_network_parameters(*cached_network_params); | 1416 source_address_token.set_cached_network_parameters(*cached_network_params); |
| 1417 } | 1417 } |
| 1418 | 1418 |
| 1419 return config.source_address_token_boxer->Box( | 1419 return config.source_address_token_boxer->Box( |
| 1420 rand, source_address_token.SerializeAsString()); | 1420 rand, source_address_token.SerializeAsString()); |
| 1421 } | 1421 } |
| 1422 | 1422 |
| 1423 bool QuicCryptoServerConfig::HasProofSource() const { |
| 1424 return proof_source_ != nullptr; |
| 1425 } |
| 1426 |
| 1423 HandshakeFailureReason QuicCryptoServerConfig::ValidateSourceAddressToken( | 1427 HandshakeFailureReason QuicCryptoServerConfig::ValidateSourceAddressToken( |
| 1424 const Config& config, | 1428 const Config& config, |
| 1425 StringPiece token, | 1429 StringPiece token, |
| 1426 const IPEndPoint& ip, | 1430 const IPEndPoint& ip, |
| 1427 QuicWallTime now, | 1431 QuicWallTime now, |
| 1428 CachedNetworkParameters* cached_network_params) const { | 1432 CachedNetworkParameters* cached_network_params) const { |
| 1429 string storage; | 1433 string storage; |
| 1430 StringPiece plaintext; | 1434 StringPiece plaintext; |
| 1431 if (!config.source_address_token_boxer->Unbox(token, &storage, &plaintext)) { | 1435 if (!config.source_address_token_boxer->Unbox(token, &storage, &plaintext)) { |
| 1432 return SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE; | 1436 return SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 QuicCryptoServerConfig::Config::Config() | 1558 QuicCryptoServerConfig::Config::Config() |
| 1555 : channel_id_enabled(false), | 1559 : channel_id_enabled(false), |
| 1556 is_primary(false), | 1560 is_primary(false), |
| 1557 primary_time(QuicWallTime::Zero()), | 1561 primary_time(QuicWallTime::Zero()), |
| 1558 priority(0), | 1562 priority(0), |
| 1559 source_address_token_boxer(nullptr) {} | 1563 source_address_token_boxer(nullptr) {} |
| 1560 | 1564 |
| 1561 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } | 1565 QuicCryptoServerConfig::Config::~Config() { STLDeleteElements(&key_exchanges); } |
| 1562 | 1566 |
| 1563 } // namespace net | 1567 } // namespace net |
| OLD | NEW |