Commit 49cdfde5 authored by wtc@chromium.org's avatar wtc@chromium.org

QuicCryptoClientConfig::ProcessServerHello should learn about updated

source address tokens in ServerHello messages.

Merge internal CL: 51981820

List output parameters after input parameters.

Merge internal CL: 52069947

R=rch@chromium.org,rtenneti@chromium.org
BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/23766019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222175 0039d316-1c4b-4281-b951-d872f2087c98
parent 5e7176f1
...@@ -792,9 +792,9 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello( ...@@ -792,9 +792,9 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
} }
QuicErrorCode QuicCryptoClientConfig::ProcessRejection( QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
CachedState* cached,
const CryptoHandshakeMessage& rej, const CryptoHandshakeMessage& rej,
QuicWallTime now, QuicWallTime now,
CachedState* cached,
QuicCryptoNegotiatedParameters* out_params, QuicCryptoNegotiatedParameters* out_params,
string* error_details) { string* error_details) {
DCHECK(error_details != NULL); DCHECK(error_details != NULL);
...@@ -856,6 +856,7 @@ QuicErrorCode QuicCryptoClientConfig::ProcessRejection( ...@@ -856,6 +856,7 @@ QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
QuicErrorCode QuicCryptoClientConfig::ProcessServerHello( QuicErrorCode QuicCryptoClientConfig::ProcessServerHello(
const CryptoHandshakeMessage& server_hello, const CryptoHandshakeMessage& server_hello,
QuicGuid guid, QuicGuid guid,
CachedState* cached,
QuicCryptoNegotiatedParameters* out_params, QuicCryptoNegotiatedParameters* out_params,
string* error_details) { string* error_details) {
DCHECK(error_details != NULL); DCHECK(error_details != NULL);
...@@ -865,6 +866,12 @@ QuicErrorCode QuicCryptoClientConfig::ProcessServerHello( ...@@ -865,6 +866,12 @@ QuicErrorCode QuicCryptoClientConfig::ProcessServerHello(
return QUIC_INVALID_CRYPTO_MESSAGE_TYPE; return QUIC_INVALID_CRYPTO_MESSAGE_TYPE;
} }
// Learn about updated source address tokens.
StringPiece token;
if (server_hello.GetStringPiece(kSourceAddressTokenTag, &token)) {
cached->set_source_address_token(token);
}
// TODO(agl): // TODO(agl):
// learn about updated SCFGs. // learn about updated SCFGs.
......
...@@ -352,18 +352,20 @@ class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { ...@@ -352,18 +352,20 @@ class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig {
// state about a future handshake (i.e. an nonce value from the server), then // state about a future handshake (i.e. an nonce value from the server), then
// it will be saved in |out_params|. |now| is used to judge whether the // it will be saved in |out_params|. |now| is used to judge whether the
// server config in the rejection message has expired. // server config in the rejection message has expired.
QuicErrorCode ProcessRejection(CachedState* cached, QuicErrorCode ProcessRejection(const CryptoHandshakeMessage& rej,
const CryptoHandshakeMessage& rej,
QuicWallTime now, QuicWallTime now,
CachedState* cached,
QuicCryptoNegotiatedParameters* out_params, QuicCryptoNegotiatedParameters* out_params,
std::string* error_details); std::string* error_details);
// ProcessServerHello processes the message in |server_hello|, writes the // ProcessServerHello processes the message in |server_hello|, updates the
// negotiated parameters to |out_params| and returns QUIC_NO_ERROR. If // cached information about that server, writes the negotiated parameters to
// |server_hello| is unacceptable then it puts an error message in // |out_params| and returns QUIC_NO_ERROR. If |server_hello| is unacceptable
// |error_details| and returns an error code. // then it puts an error message in |error_details| and returns an error
// code.
QuicErrorCode ProcessServerHello(const CryptoHandshakeMessage& server_hello, QuicErrorCode ProcessServerHello(const CryptoHandshakeMessage& server_hello,
QuicGuid guid, QuicGuid guid,
CachedState* cached,
QuicCryptoNegotiatedParameters* out_params, QuicCryptoNegotiatedParameters* out_params,
std::string* error_details); std::string* error_details);
......
...@@ -234,7 +234,7 @@ void QuicCryptoClientStream::DoHandshakeLoop( ...@@ -234,7 +234,7 @@ void QuicCryptoClientStream::DoHandshakeLoop(
return; return;
} }
error = crypto_config_->ProcessRejection( error = crypto_config_->ProcessRejection(
cached, *in, session()->connection()->clock()->WallNow(), *in, session()->connection()->clock()->WallNow(), cached,
&crypto_negotiated_params_, &error_details); &crypto_negotiated_params_, &error_details);
if (error != QUIC_NO_ERROR) { if (error != QUIC_NO_ERROR) {
CloseConnectionWithDetails(error, error_details); CloseConnectionWithDetails(error, error_details);
...@@ -334,8 +334,8 @@ void QuicCryptoClientStream::DoHandshakeLoop( ...@@ -334,8 +334,8 @@ void QuicCryptoClientStream::DoHandshakeLoop(
return; return;
} }
error = crypto_config_->ProcessServerHello( error = crypto_config_->ProcessServerHello(
*in, session()->connection()->guid(), &crypto_negotiated_params_, *in, session()->connection()->guid(), cached,
&error_details); &crypto_negotiated_params_, &error_details);
if (error != QUIC_NO_ERROR) { if (error != QUIC_NO_ERROR) {
CloseConnectionWithDetails( CloseConnectionWithDetails(
error, "Server hello invalid: " + error_details); error, "Server hello invalid: " + error_details);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment