| Index: net/quic/core/crypto/quic_crypto_client_config.cc
|
| diff --git a/net/quic/core/crypto/quic_crypto_client_config.cc b/net/quic/core/crypto/quic_crypto_client_config.cc
|
| index 0bee46290dbcb6c592551f00634c190bdafcf3ed..3385491a630017c6c0165770c2883422467434b1 100644
|
| --- a/net/quic/core/crypto/quic_crypto_client_config.cc
|
| +++ b/net/quic/core/crypto/quic_crypto_client_config.cc
|
| @@ -66,7 +66,9 @@ QuicCryptoClientConfig::~QuicCryptoClientConfig() {
|
| }
|
|
|
| QuicCryptoClientConfig::CachedState::CachedState()
|
| - : server_config_valid_(false), generation_counter_(0) {}
|
| + : server_config_valid_(false),
|
| + expiration_time_(QuicWallTime::Zero()),
|
| + generation_counter_(0) {}
|
|
|
| QuicCryptoClientConfig::CachedState::~CachedState() {}
|
|
|
| @@ -89,15 +91,11 @@ bool QuicCryptoClientConfig::CachedState::IsComplete(QuicWallTime now) const {
|
| return false;
|
| }
|
|
|
| - uint64_t expiry_seconds;
|
| - if (scfg->GetUint64(kEXPY, &expiry_seconds) != QUIC_NO_ERROR) {
|
| - RecordInchoateClientHelloReason(SERVER_CONFIG_INVALID_EXPIRY);
|
| - return false;
|
| - }
|
| - if (now.ToUNIXSeconds() >= expiry_seconds) {
|
| + if (now.IsAfter(expiration_time_)) {
|
| UMA_HISTOGRAM_CUSTOM_TIMES(
|
| "Net.QuicClientHelloServerConfig.InvalidDuration",
|
| - base::TimeDelta::FromSeconds(now.ToUNIXSeconds() - expiry_seconds),
|
| + base::TimeDelta::FromSeconds(now.ToUNIXSeconds() -
|
| + expiration_time_.ToUNIXSeconds()),
|
| base::TimeDelta::FromMinutes(1), base::TimeDelta::FromDays(20), 50);
|
| RecordInchoateClientHelloReason(SERVER_CONFIG_EXPIRED);
|
| return false;
|
| @@ -170,8 +168,9 @@ QuicCryptoClientConfig::CachedState::SetServerConfig(StringPiece server_config,
|
| *error_details = "SCFG missing EXPY";
|
| return SERVER_CONFIG_INVALID_EXPIRY;
|
| }
|
| + expiration_time_ = QuicWallTime::FromUNIXSeconds(expiry_seconds);
|
|
|
| - if (now.ToUNIXSeconds() >= expiry_seconds) {
|
| + if (now.IsAfter(expiration_time_)) {
|
| *error_details = "SCFG has expired";
|
| return SERVER_CONFIG_EXPIRED;
|
| }
|
|
|