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

Unified Diff: net/quic/crypto/quic_crypto_server_config.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.cc ('k') | net/quic/crypto/quic_crypto_server_config_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/quic_crypto_server_config.cc
diff --git a/net/quic/crypto/quic_crypto_server_config.cc b/net/quic/crypto/quic_crypto_server_config.cc
index 7f6a3afdbb1347d068308d44e2adebc63fe0cf21..7c76ba85acd910405ca000ad62b017448362880c 100644
--- a/net/quic/crypto/quic_crypto_server_config.cc
+++ b/net/quic/crypto/quic_crypto_server_config.cc
@@ -452,7 +452,7 @@ bool QuicCryptoServerConfig::SetConfigs(
reinterpret_cast<const char *>(config->orbit), kOrbitSize)
<< " primary_time " << config->primary_time.ToUNIXSeconds()
<< " priority " << config->priority;
- new_configs.insert(make_pair(config->id, config));
+ new_configs.insert(std::make_pair(config->id, config));
}
}
@@ -684,16 +684,17 @@ QuicErrorCode QuicCryptoServerConfig::ProcessClientHello(
return QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED;
}
- scoped_ptr<QuicData> cetv_plaintext(crypters.decrypter->DecryptPacket(
+ char plaintext[kMaxPacketSize];
+ size_t plaintext_length = 0;
+ const bool success = crypters.decrypter->DecryptPacket(
0 /* sequence number */, StringPiece() /* associated data */,
- cetv_ciphertext));
- if (!cetv_plaintext.get()) {
+ cetv_ciphertext, plaintext, &plaintext_length, kMaxPacketSize);
+ if (!success) {
*error_details = "CETV decryption failure";
- return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
+ return QUIC_PACKET_TOO_LARGE;
}
-
- scoped_ptr<CryptoHandshakeMessage> cetv(CryptoFramer::ParseMessage(
- cetv_plaintext->AsStringPiece()));
+ scoped_ptr<CryptoHandshakeMessage> cetv(
+ CryptoFramer::ParseMessage(StringPiece(plaintext, plaintext_length)));
if (!cetv.get()) {
*error_details = "CETV parse error";
return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
@@ -835,7 +836,7 @@ void QuicCryptoServerConfig::SelectNewPrimaryConfig(
return;
}
- sort(configs.begin(), configs.end(), ConfigPrimaryTimeLessThan);
+ std::sort(configs.begin(), configs.end(), ConfigPrimaryTimeLessThan);
Config* best_candidate = configs[0].get();
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.cc ('k') | net/quic/crypto/quic_crypto_server_config_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698