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

Unified Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.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 | « chrome/browser/resources/net_internals/hsts_view.js ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/net_internals/net_internals_ui.cc
===================================================================
--- chrome/browser/ui/webui/net_internals/net_internals_ui.cc (revision 186438)
+++ chrome/browser/ui/webui/net_internals/net_internals_ui.cc (working copy)
@@ -1233,17 +1233,21 @@
result->SetBoolean("result", found);
if (found) {
- result->SetInteger("mode", static_cast<int>(state.upgrade_mode));
- result->SetBoolean("subdomains", state.include_subdomains);
- result->SetString("domain", state.domain);
- result->SetDouble("expiry", state.upgrade_expiry.ToDoubleT());
- result->SetDouble("dynamic_spki_hashes_expiry",
- state.dynamic_spki_hashes_expiry.ToDoubleT());
-
- result->SetString("static_spki_hashes",
- HashesToBase64String(state.static_spki_hashes));
- result->SetString("dynamic_spki_hashes",
- HashesToBase64String(state.dynamic_spki_hashes));
+ result->SetBoolean("HSTS", state.ShouldUpgradeToSSL());
+ if (state.HasPublicKeyPins()) {
+ const net::HashValueVector& good_hashes =
+ state.GetPublicKeyPinsGoodHashes();
+ const net::HashValueVector& bad_hashes =
+ state.GetPublicKeyPinsBadHashes();
+ if (!good_hashes.empty())
+ result->SetString("Public_Key_Pins_Good",
+ HashesToBase64String(
+ state.GetPublicKeyPinsGoodHashes()));
+ if (!bad_hashes.empty())
+ result->SetString("Public_Key_Pins_Bad",
+ HashesToBase64String(
+ state.GetPublicKeyPinsBadHashes()));
+ }
}
}
}
@@ -1271,15 +1275,16 @@
if (!transport_security_state)
return;
- base::Time expiry = base::Time::Now() + base::TimeDelta::FromDays(1000);
+ base::Time now = base::Time::Now();
+ base::Time expiry = now + base::TimeDelta::FromDays(1000);
net::HashValueVector hashes;
if (!hashes_str.empty()) {
if (!Base64StringToHashes(hashes_str, &hashes))
return;
}
- transport_security_state->AddHSTS(domain, expiry, include_subdomains);
- transport_security_state->AddHPKP(domain, expiry, include_subdomains,
+ transport_security_state->AddHSTS(domain, now, expiry, include_subdomains);
+ transport_security_state->AddHPKP(domain, now, expiry, include_subdomains,
hashes);
}
« no previous file with comments | « chrome/browser/resources/net_internals/hsts_view.js ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698