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(
}
QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
CachedState* cached,
const CryptoHandshakeMessage& rej,
QuicWallTime now,
CachedState* cached,
QuicCryptoNegotiatedParameters* out_params,
string* error_details) {
DCHECK(error_details != NULL);
......@@ -856,6 +856,7 @@ QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
QuicErrorCode QuicCryptoClientConfig::ProcessServerHello(
const CryptoHandshakeMessage& server_hello,
QuicGuid guid,
CachedState* cached,
QuicCryptoNegotiatedParameters* out_params,
string* error_details) {
DCHECK(error_details != NULL);
......@@ -865,6 +866,12 @@ QuicErrorCode QuicCryptoClientConfig::ProcessServerHello(
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):
// learn about updated SCFGs.
......
......@@ -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
// it will be saved in |out_params|. |now| is used to judge whether the
// server config in the rejection message has expired.
QuicErrorCode ProcessRejection(CachedState* cached,
const CryptoHandshakeMessage& rej,
QuicErrorCode ProcessRejection(const CryptoHandshakeMessage& rej,
QuicWallTime now,
CachedState* cached,
QuicCryptoNegotiatedParameters* out_params,
std::string* error_details);
// ProcessServerHello processes the message in |server_hello|, writes the
// negotiated parameters to |out_params| and returns QUIC_NO_ERROR. If
// |server_hello| is unacceptable then it puts an error message in
// |error_details| and returns an error code.
// ProcessServerHello processes the message in |server_hello|, updates the
// cached information about that server, writes the negotiated parameters to
// |out_params| and returns QUIC_NO_ERROR. If |server_hello| is unacceptable
// then it puts an error message in |error_details| and returns an error
// code.
QuicErrorCode ProcessServerHello(const CryptoHandshakeMessage& server_hello,
QuicGuid guid,
CachedState* cached,
QuicCryptoNegotiatedParameters* out_params,
std::string* error_details);
......
......@@ -234,7 +234,7 @@ void QuicCryptoClientStream::DoHandshakeLoop(
return;
}
error = crypto_config_->ProcessRejection(
cached, *in, session()->connection()->clock()->WallNow(),
*in, session()->connection()->clock()->WallNow(), cached,
&crypto_negotiated_params_, &error_details);
if (error != QUIC_NO_ERROR) {
CloseConnectionWithDetails(error, error_details);
......@@ -334,8 +334,8 @@ void QuicCryptoClientStream::DoHandshakeLoop(
return;
}
error = crypto_config_->ProcessServerHello(
*in, session()->connection()->guid(), &crypto_negotiated_params_,
&error_details);
*in, session()->connection()->guid(), cached,
&crypto_negotiated_params_, &error_details);
if (error != QUIC_NO_ERROR) {
CloseConnectionWithDetails(
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