Index: net/quic/crypto/quic_crypto_client_config.cc |
diff --git a/net/quic/crypto/quic_crypto_client_config.cc b/net/quic/crypto/quic_crypto_client_config.cc |
index 1e12424b111065ed5fdca7a144d5b542c5d79196..9ec19fd8f1b5d737cc2b5d958c14a717f4f32e1f 100644 |
--- a/net/quic/crypto/quic_crypto_client_config.cc |
+++ b/net/quic/crypto/quic_crypto_client_config.cc |
@@ -23,8 +23,6 @@ |
#include "net/quic/quic_utils.h" |
using base::StringPiece; |
-using std::find; |
-using std::make_pair; |
using std::map; |
using std::string; |
using std::vector; |
@@ -324,7 +322,7 @@ QuicCryptoClientConfig::CachedState* QuicCryptoClientConfig::LookupOrCreate( |
} |
CachedState* cached = new CachedState; |
- cached_states_.insert(make_pair(server_id, cached)); |
+ cached_states_.insert(std::make_pair(server_id, cached)); |
bool cache_populated = PopulateFromCanonicalConfig(server_id, cached); |
UMA_HISTOGRAM_BOOLEAN( |
"Net.QuicCryptoClientConfig.PopulatedFromCanonicalConfig", |
@@ -545,16 +543,19 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello( |
} |
const QuicData& cetv_plaintext = cetv.GetSerialized(); |
- scoped_ptr<QuicData> cetv_ciphertext(crypters.encrypter->EncryptPacket( |
- 0 /* sequence number */, |
- StringPiece() /* associated data */, |
- cetv_plaintext.AsStringPiece())); |
- if (!cetv_ciphertext.get()) { |
+ const size_t encrypted_len = |
+ crypters.encrypter->GetCiphertextSize(cetv_plaintext.length()); |
+ scoped_ptr<char[]> output(new char[encrypted_len]); |
+ size_t output_size = 0; |
+ if (!crypters.encrypter->EncryptPacket( |
+ 0 /* sequence number */, StringPiece() /* associated data */, |
+ cetv_plaintext.AsStringPiece(), output.get(), &output_size, |
+ encrypted_len)) { |
*error_details = "Packet encryption failed"; |
return QUIC_ENCRYPTION_FAILURE; |
} |
- out->SetStringPiece(kCETV, cetv_ciphertext->AsStringPiece()); |
+ out->SetStringPiece(kCETV, StringPiece(output.get(), output_size)); |
out->MarkDirty(); |
out->set_minimum_size(orig_min_size); |
@@ -837,7 +838,7 @@ void QuicCryptoClientConfig::PreferAesGcm() { |
if (aead.size() <= 1) { |
return; |
} |
- QuicTagVector::iterator pos = find(aead.begin(), aead.end(), kAESG); |
+ QuicTagVector::iterator pos = std::find(aead.begin(), aead.end(), kAESG); |
if (pos != aead.end()) { |
aead.erase(pos); |
aead.insert(aead.begin(), kAESG); |