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

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: GetNext() fix Created 5 years, 5 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/http/transport_security_state.h ('k') | net/http/transport_security_state_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/transport_security_state.cc
diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc
index a5f43a016ac129a899b6d033d0351f7c6373cb57..8ad73581e85a2670ac48fcd5c43e3f7dd2161ba3 100644
--- a/net/http/transport_security_state.cc
+++ b/net/http/transport_security_state.cc
@@ -575,7 +575,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 GURL& report_uri) {
DCHECK(CalledOnValidThread());
PKPState pkp_state;
@@ -583,6 +584,7 @@ void TransportSecurityState::AddHPKPInternal(const std::string& host,
pkp_state.expiry = expiry;
pkp_state.include_subdomains = include_subdomains;
pkp_state.spki_hashes = hashes;
+ pkp_state.report_uri = report_uri;
EnablePKPHost(host, pkp_state);
}
@@ -742,14 +744,17 @@ bool TransportSecurityState::AddHPKPHeader(const std::string& host,
base::TimeDelta max_age;
bool include_subdomains;
HashValueVector spki_hashes;
+ GURL 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;
}
@@ -763,9 +768,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 GURL& 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
« no previous file with comments | « net/http/transport_security_state.h ('k') | net/http/transport_security_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698