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

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

Issue 398623003: To be used in internal change: 70123647 when processing a mid-connection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e045df5c222707b540412d975dca0393c9671810..c887e07793e7f7b1c318b70f3a65fb354c4ec784 100644
--- a/net/quic/crypto/quic_crypto_client_config.cc
+++ b/net/quic/crypto/quic_crypto_client_config.cc
@@ -529,21 +529,16 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
return QUIC_NO_ERROR;
}
-QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
- const CryptoHandshakeMessage& rej,
+QuicErrorCode QuicCryptoClientConfig::CacheNewServerConfig(
+ const CryptoHandshakeMessage& message,
QuicWallTime now,
CachedState* cached,
QuicCryptoNegotiatedParameters* out_params,
string* error_details) {
DCHECK(error_details != NULL);
- if (rej.tag() != kREJ) {
- *error_details = "Message is not REJ";
- return QUIC_CRYPTO_INTERNAL_ERROR;
- }
-
StringPiece scfg;
- if (!rej.GetStringPiece(kSCFG, &scfg)) {
+ if (!message.GetStringPiece(kSCFG, &scfg)) {
*error_details = "Missing SCFG";
return QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND;
}
@@ -554,18 +549,13 @@ QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
}
StringPiece token;
- if (rej.GetStringPiece(kSourceAddressTokenTag, &token)) {
+ if (message.GetStringPiece(kSourceAddressTokenTag, &token)) {
cached->set_source_address_token(token);
}
- StringPiece nonce;
- if (rej.GetStringPiece(kServerNonceTag, &nonce)) {
- out_params->server_nonce = nonce.as_string();
- }
-
StringPiece proof, cert_bytes;
- bool has_proof = rej.GetStringPiece(kPROF, &proof);
- bool has_cert = rej.GetStringPiece(kCertificateTag, &cert_bytes);
+ bool has_proof = message.GetStringPiece(kPROF, &proof);
+ bool has_cert = message.GetStringPiece(kCertificateTag, &cert_bytes);
if (has_proof && has_cert) {
vector<string> certs;
if (!CertCompressor::DecompressChain(cert_bytes, out_params->cached_certs,
@@ -588,6 +578,33 @@ QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
}
}
+ return QUIC_NO_ERROR;
+}
+
+QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
+ const CryptoHandshakeMessage& rej,
+ QuicWallTime now,
+ CachedState* cached,
+ QuicCryptoNegotiatedParameters* out_params,
+ string* error_details) {
+ DCHECK(error_details != NULL);
+
+ if (rej.tag() != kREJ) {
+ *error_details = "Message is not REJ";
+ return QUIC_CRYPTO_INTERNAL_ERROR;
+ }
+
+ QuicErrorCode error =
+ CacheNewServerConfig(rej, now, cached, out_params, error_details);
+ if (error != QUIC_NO_ERROR) {
+ return error;
+ }
+
+ StringPiece nonce;
+ if (rej.GetStringPiece(kServerNonceTag, &nonce)) {
+ out_params->server_nonce = nonce.as_string();
+ }
+
const uint32* reject_reasons;
size_t num_reject_reasons;
COMPILE_ASSERT(sizeof(QuicTag) == sizeof(uint32), header_out_of_sync);
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698