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

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

Issue 2289243003: Store the QUIC server's crypto config expiration time explicitly in the client's CachedState, inste… (Closed)
Patch Set: Store the QUIC server's crypto config expiration time explicitly in the client's CachedState, inste… Created 4 years, 3 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/core/crypto/quic_crypto_client_config.h ('k') | net/quic/core/quic_crypto_client_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « net/quic/core/crypto/quic_crypto_client_config.h ('k') | net/quic/core/quic_crypto_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698