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); |