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

Unified Diff: net/http/transport_security_state.cc

Issue 1211363005: Parse HPKP report-uri and persist in TransportSecurityPersister (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor cleanup Created 5 years, 6 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
Index: net/http/transport_security_state.cc
diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc
index c24fc1f500716fa1356c107b13814342e713db19..528bb45ba4f51870dcbaada15df80abc1189b2f4 100644
--- a/net/http/transport_security_state.cc
+++ b/net/http/transport_security_state.cc
@@ -586,7 +586,8 @@ void TransportSecurityState::AddHPKPInternal(const std::string& host,
const base::Time& last_observed,
const base::Time& expiry,
bool include_subdomains,
- const HashValueVector& hashes) {
+ const HashValueVector& hashes,
+ const std::string& report_uri) {
DCHECK(CalledOnValidThread());
// Copy-and-modify the existing DomainState for this host (if any).
@@ -601,6 +602,7 @@ void TransportSecurityState::AddHPKPInternal(const std::string& host,
domain_state.pkp.expiry = expiry;
domain_state.pkp.include_subdomains = include_subdomains;
domain_state.pkp.spki_hashes = hashes;
+ domain_state.pkp.report_uri = report_uri;
EnableHost(host, domain_state);
}
@@ -718,14 +720,17 @@ bool TransportSecurityState::AddHPKPHeader(const std::string& host,
base::TimeDelta max_age;
bool include_subdomains;
HashValueVector spki_hashes;
+ std::string report_uri;
+
if (!ParseHPKPHeader(value, ssl_info.public_key_hashes, &max_age,
- &include_subdomains, &spki_hashes)) {
+ &include_subdomains, &spki_hashes, &report_uri)) {
return false;
}
// Handle max-age == 0.
if (max_age.InSeconds() == 0)
spki_hashes.clear();
- AddHPKPInternal(host, now, now + max_age, include_subdomains, spki_hashes);
+ AddHPKPInternal(host, now, now + max_age, include_subdomains, spki_hashes,
+ report_uri);
return true;
}
@@ -740,9 +745,11 @@ void TransportSecurityState::AddHSTS(const std::string& host,
void TransportSecurityState::AddHPKP(const std::string& host,
const base::Time& expiry,
bool include_subdomains,
- const HashValueVector& hashes) {
+ const HashValueVector& hashes,
+ const std::string& report_uri) {
DCHECK(CalledOnValidThread());
- AddHPKPInternal(host, base::Time::Now(), expiry, include_subdomains, hashes);
+ AddHPKPInternal(host, base::Time::Now(), expiry, include_subdomains, hashes,
+ report_uri);
}
// static

Powered by Google App Engine
This is Rietveld 408576698