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

Unified Diff: chrome/browser/ui/webui/interstitials/interstitial_ui.cc

Issue 1772143002: Use network time for bad clock interstitial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass "gn check out/Default" Created 4 years, 9 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_handler.cc ('k') | components/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/interstitials/interstitial_ui.cc
diff --git a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
index 70c4a34dd2c25973eedc351182d03b7424f949d1..8f5ac6d413b97ffae3abb18305ceb8fd8f756599 100644
--- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
+++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
@@ -156,14 +156,15 @@ BadClockBlockingPage* CreateBadClockBlockingPage(
}
// Determine whether to change the clock to be ahead or behind.
- base::Time time_triggered_ = base::Time::NowFromSystemTime();
std::string clock_manipulation_param;
+ ssl_errors::ClockState clock_state = ssl_errors::CLOCK_STATE_PAST;
if (net::GetValueForKeyInQuery(web_contents->GetURL(), "clock_manipulation",
&clock_manipulation_param)) {
int time_offset;
- if (!base::StringToInt(clock_manipulation_param, &time_offset))
- time_offset = 2;
- time_triggered_ += base::TimeDelta::FromDays(365 * time_offset);
+ if (base::StringToInt(clock_manipulation_param, &time_offset)) {
+ clock_state = time_offset > 0 ? ssl_errors::CLOCK_STATE_FUTURE
+ : ssl_errors::CLOCK_STATE_PAST;
+ }
}
net::SSLInfo ssl_info;
@@ -176,8 +177,8 @@ BadClockBlockingPage* CreateBadClockBlockingPage(
if (strict_enforcement)
options_mask |= security_interstitials::SSLErrorUI::STRICT_ENFORCEMENT;
return new BadClockBlockingPage(web_contents, cert_error, ssl_info,
- request_url, time_triggered_, nullptr,
- base::Callback<void(bool)>());
+ request_url, base::Time::Now(), clock_state,
+ nullptr, base::Callback<void(bool)>());
}
safe_browsing::SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage(
« no previous file with comments | « chrome/browser/ssl/ssl_error_handler.cc ('k') | components/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698