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

Unified Diff: net/http/http_security_headers.cc

Issue 12974003: Improve TransportSecurityState data storage. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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/http_security_headers.h ('k') | net/net.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_security_headers.cc
===================================================================
--- net/http/http_security_headers.cc (revision 186438)
+++ net/http/http_security_headers.cc (working copy)
@@ -164,8 +164,8 @@
// the UA, the UA MUST ignore the unrecognized directives and if the
// STS header field otherwise satisfies the above requirements (1
// through 4), the UA MUST process the recognized directives.
-bool ParseHSTSHeader(const base::Time& now, const std::string& value,
- base::Time* expiry, // OUT
+bool ParseHSTSHeader(const std::string& value,
+ base::TimeDelta* max_age, // OUT
bool* include_subdomains) { // OUT
uint32 max_age_candidate = 0;
bool include_subdomains_candidate = false;
@@ -256,7 +256,7 @@
case AFTER_MAX_AGE:
case AFTER_INCLUDE_SUBDOMAINS:
case AFTER_UNKNOWN_LABEL:
- *expiry = now + base::TimeDelta::FromSeconds(max_age_candidate);
+ *max_age = base::TimeDelta::FromSeconds(max_age_candidate);
*include_subdomains = include_subdomains_candidate;
return true;
case START:
@@ -273,10 +273,9 @@
// "Public-Key-Pins" ":"
// "max-age" "=" delta-seconds ";"
// "pin-" algo "=" base64 [ ";" ... ]
-bool ParseHPKPHeader(const base::Time& now,
- const std::string& value,
+bool ParseHPKPHeader(const std::string& value,
const HashValueVector& chain_hashes,
- base::Time* expiry,
+ base::TimeDelta* max_age,
HashValueVector* hashes) {
bool parsed_max_age = false;
uint32 max_age_candidate = 0;
@@ -318,7 +317,7 @@
if (!IsPinListValid(pins, chain_hashes))
return false;
- *expiry = now + base::TimeDelta::FromSeconds(max_age_candidate);
+ *max_age = base::TimeDelta::FromSeconds(max_age_candidate);
for (HashValueVector::const_iterator i = pins.begin();
i != pins.end(); ++i) {
hashes->push_back(*i);
« no previous file with comments | « net/http/http_security_headers.h ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698