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

Unified Diff: net/http/transport_security_state.cc

Issue 695523002: Change dont_embed_build_metadata default to 1 except for Official build and fix some unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the logic in ssl_error_classification.cc Created 6 years, 2 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/ssl/ssl_error_classification.cc ('k') | no next file » | 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 d0c0b33a896588bc86e6e1c1414f9d3532f60284..907e6d88a089471e969b2af3becfa528237a9e76 100644
--- a/net/http/transport_security_state.cc
+++ b/net/http/transport_security_state.cc
@@ -721,9 +721,18 @@ void TransportSecurityState::ReportUMAOnPinFailure(const std::string& host) {
// static
bool TransportSecurityState::IsBuildTimely() {
+ // If the build metadata aren't embedded in the binary then we can't use the
+ // build time to determine if the build is timely, return true by default. If
+ // we're building an official build then keep using the build time, even if
+ // it's invalid it'd be a date in the past and this function will return
+ // false.
+#if defined(DONT_EMBED_BUILD_METADATA) && !defined(OFFICIAL_BUILD)
+ return true;
+#else
const base::Time build_time = base::GetBuildTime();
// We consider built-in information to be timely for 10 weeks.
return (base::Time::Now() - build_time).InDays() < 70 /* 10 weeks */;
+#endif
}
bool TransportSecurityState::CheckPublicKeyPinsImpl(
« no previous file with comments | « chrome/browser/ssl/ssl_error_classification.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698