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

Unified Diff: net/quic/crypto/quic_server_info.cc

Issue 1818393003: QUIC - Persist "Hash of the CHLO message" and "Signed timestamp of the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Default chlo_hash to empty string for old disk cache data Created 4 years, 9 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/crypto/quic_server_info.h ('k') | net/quic/quic_chromium_client_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/quic_server_info.cc
diff --git a/net/quic/crypto/quic_server_info.cc b/net/quic/crypto/quic_server_info.cc
index 2627fb48609a6b493bf3ee5ca04f0a70c11f6fba..24edb9bd622ade6f17e2a8013ed8a5c288727db5 100644
--- a/net/quic/crypto/quic_server_info.cc
+++ b/net/quic/crypto/quic_server_info.cc
@@ -12,7 +12,10 @@ using std::string;
namespace {
-const int kQuicCryptoConfigVersion = 1;
+// TODO(rtenneti): Delete kQuicCryptoConfigVersionNoChloHash after
+// QUIC_VERSION_31 becomes the default.
+const int kQuicCryptoConfigVersionNoChloHash = 1;
+const int kQuicCryptoConfigVersion = 2;
} // namespace
@@ -25,6 +28,8 @@ QuicServerInfo::State::~State() {}
void QuicServerInfo::State::Clear() {
server_config.clear();
source_address_token.clear();
+ cert_sct.clear();
+ chlo_hash.clear();
server_config_sig.clear();
certs.clear();
}
@@ -70,7 +75,10 @@ bool QuicServerInfo::ParseInner(const string& data) {
return false;
}
- if (version != kQuicCryptoConfigVersion) {
+ // TODO(rtenneti): Delete kQuicCryptoConfigVersionNoChloHash after
+ // QUIC_VERSION_31 becomes the default.
+ if (!(version == kQuicCryptoConfigVersionNoChloHash ||
+ version == kQuicCryptoConfigVersion)) {
DVLOG(1) << "Unsupported version";
return false;
}
@@ -83,6 +91,21 @@ bool QuicServerInfo::ParseInner(const string& data) {
DVLOG(1) << "Malformed source_address_token";
return false;
}
+ // TODO(rtenneti): Delete kQuicCryptoConfigVersionNoChloHash after
+ // QUIC_VERSION_31 becomes the default.
+ if (version == kQuicCryptoConfigVersionNoChloHash) {
+ state->cert_sct.clear();
+ state->chlo_hash.clear();
+ } else {
+ if (!iter.ReadString(&state->cert_sct)) {
+ DVLOG(1) << "Malformed cert_sct";
+ return false;
+ }
+ if (!iter.ReadString(&state->chlo_hash)) {
+ DVLOG(1) << "Malformed chlo_hash";
+ return false;
+ }
+ }
if (!iter.ReadString(&state->server_config_sig)) {
DVLOG(1) << "Malformed server_config_sig";
return false;
@@ -119,6 +142,7 @@ string QuicServerInfo::SerializeInner() const {
if (!p.WriteInt(kQuicCryptoConfigVersion) ||
!p.WriteString(state_.server_config) ||
!p.WriteString(state_.source_address_token) ||
+ !p.WriteString(state_.cert_sct) || !p.WriteString(state_.chlo_hash) ||
!p.WriteString(state_.server_config_sig) ||
state_.certs.size() > std::numeric_limits<uint32_t>::max() ||
!p.WriteUInt32(state_.certs.size())) {
« no previous file with comments | « net/quic/crypto/quic_server_info.h ('k') | net/quic/quic_chromium_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698