| Index: net/quic/core/crypto/quic_crypto_client_config.cc
|
| diff --git a/net/quic/core/crypto/quic_crypto_client_config.cc b/net/quic/core/crypto/quic_crypto_client_config.cc
|
| index 3df23ce756f77034dfb4452d6e53acbb1236770d..15258d6b435ccbf3f82c55fe67669a1dfecc4c1d 100644
|
| --- a/net/quic/core/crypto/quic_crypto_client_config.cc
|
| +++ b/net/quic/core/crypto/quic_crypto_client_config.cc
|
| @@ -27,10 +27,7 @@
|
| #include "net/quic/core/quic_utils.h"
|
|
|
| using base::StringPiece;
|
| -using std::map;
|
| using std::string;
|
| -using std::queue;
|
| -using std::vector;
|
|
|
| namespace net {
|
|
|
| @@ -192,14 +189,15 @@ void QuicCryptoClientConfig::CachedState::InvalidateServerConfig() {
|
| server_config_.clear();
|
| scfg_.reset();
|
| SetProofInvalid();
|
| - queue<QuicConnectionId> empty_queue;
|
| + std::queue<QuicConnectionId> empty_queue;
|
| swap(server_designated_connection_ids_, empty_queue);
|
| }
|
|
|
| -void QuicCryptoClientConfig::CachedState::SetProof(const vector<string>& certs,
|
| - StringPiece cert_sct,
|
| - StringPiece chlo_hash,
|
| - StringPiece signature) {
|
| +void QuicCryptoClientConfig::CachedState::SetProof(
|
| + const std::vector<string>& certs,
|
| + StringPiece cert_sct,
|
| + StringPiece chlo_hash,
|
| + StringPiece signature) {
|
| bool has_changed = signature != server_config_sig_ ||
|
| chlo_hash != chlo_hash_ || certs_.size() != certs.size();
|
|
|
| @@ -235,7 +233,7 @@ void QuicCryptoClientConfig::CachedState::Clear() {
|
| proof_verify_details_.reset();
|
| scfg_.reset();
|
| ++generation_counter_;
|
| - queue<QuicConnectionId> empty_queue;
|
| + std::queue<QuicConnectionId> empty_queue;
|
| swap(server_designated_connection_ids_, empty_queue);
|
| }
|
|
|
| @@ -259,8 +257,8 @@ void QuicCryptoClientConfig::CachedState::SetProofInvalid() {
|
| bool QuicCryptoClientConfig::CachedState::Initialize(
|
| StringPiece server_config,
|
| StringPiece source_address_token,
|
| - const vector<string>& certs,
|
| - StringPiece cert_sct,
|
| + const std::vector<string>& certs,
|
| + const string& cert_sct,
|
| StringPiece chlo_hash,
|
| StringPiece signature,
|
| QuicWallTime now,
|
| @@ -281,11 +279,11 @@ bool QuicCryptoClientConfig::CachedState::Initialize(
|
| return false;
|
| }
|
|
|
| + chlo_hash.CopyToString(&chlo_hash_);
|
| signature.CopyToString(&server_config_sig_);
|
| source_address_token.CopyToString(&source_address_token_);
|
| - cert_sct.CopyToString(&cert_sct_);
|
| - chlo_hash.CopyToString(&chlo_hash_);
|
| certs_ = certs;
|
| + cert_sct_ = cert_sct;
|
| return true;
|
| }
|
|
|
| @@ -298,7 +296,7 @@ const string& QuicCryptoClientConfig::CachedState::source_address_token()
|
| return source_address_token_;
|
| }
|
|
|
| -const vector<string>& QuicCryptoClientConfig::CachedState::certs() const {
|
| +const std::vector<string>& QuicCryptoClientConfig::CachedState::certs() const {
|
| return certs_;
|
| }
|
|
|
| @@ -468,17 +466,17 @@ void QuicCryptoClientConfig::FillInchoateClientHello(
|
|
|
| out->SetStringPiece(kCertificateSCTTag, "");
|
|
|
| - const vector<string>& certs = cached->certs();
|
| + const std::vector<string>& certs = cached->certs();
|
| // We save |certs| in the QuicCryptoNegotiatedParameters so that, if the
|
| // client config is being used for multiple connections, another connection
|
| // doesn't update the cached certificates and cause us to be unable to
|
| // process the server's compressed certificate chain.
|
| out_params->cached_certs = certs;
|
| if (!certs.empty()) {
|
| - vector<uint64_t> hashes;
|
| + std::vector<uint64_t> hashes;
|
| hashes.reserve(certs.size());
|
| - for (vector<string>::const_iterator i = certs.begin(); i != certs.end();
|
| - ++i) {
|
| + for (std::vector<string>::const_iterator i = certs.begin();
|
| + i != certs.end(); ++i) {
|
| hashes.push_back(QuicUtils::FNV1a_64_Hash(i->data(), i->size()));
|
| }
|
| out->SetVector(kCCRT, hashes);
|
| @@ -612,7 +610,7 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
|
| }
|
| out->SetStringPiece(kPUBS, out_params->client_key_exchange->public_value());
|
|
|
| - const vector<string>& certs = cached->certs();
|
| + const std::vector<string>& certs = cached->certs();
|
| if (certs.empty()) {
|
| *error_details = "No certs to calculate XLCT";
|
| return QUIC_CRYPTO_INTERNAL_ERROR;
|
| @@ -726,7 +724,7 @@ QuicErrorCode QuicCryptoClientConfig::CacheNewServerConfig(
|
| QuicWallTime now,
|
| QuicVersion version,
|
| StringPiece chlo_hash,
|
| - const vector<string>& cached_certs,
|
| + const std::vector<string>& cached_certs,
|
| CachedState* cached,
|
| string* error_details) {
|
| DCHECK(error_details != nullptr);
|
| @@ -763,7 +761,7 @@ QuicErrorCode QuicCryptoClientConfig::CacheNewServerConfig(
|
| bool has_proof = message.GetStringPiece(kPROF, &proof);
|
| bool has_cert = message.GetStringPiece(kCertificateTag, &cert_bytes);
|
| if (has_proof && has_cert) {
|
| - vector<string> certs;
|
| + std::vector<string> certs;
|
| if (!CertCompressor::DecompressChain(cert_bytes, cached_certs,
|
| common_cert_sets, &certs)) {
|
| *error_details = "Certificate data invalid";
|
|
|