Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: net/quic/crypto/quic_crypto_server_config.cc

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/crypto/quic_crypto_server_config.h ('k') | net/quic/quic_client_session.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/quic/crypto/quic_crypto_server_config.h ('k') | net/quic/quic_client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698