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

Unified Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 940543003: added clock interstitial to chrome://interstitials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | chrome/browser/ui/webui/interstitials/interstitial_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_blocking_page.cc
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index ecf70291056c8b47e64f534c76b29a09aad97083..82e63340e2e1f7502b34dd218101787785888df2 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -205,6 +205,7 @@ bool IsErrorDueToBadClock(const base::Time& now, int error) {
SSLErrorInfo::CERT_DATE_INVALID) {
return false;
}
+
lgarron 2015/02/19 22:57:06 Nit: I try to avoid introducing extra whitespace,
felt 2015/02/20 16:01:53 looks like you haven't addressed this?
fahl 2015/02/23 23:47:49 Acknowledged.
return SSLErrorClassification::IsUserClockInThePast(now) ||
SSLErrorClassification::IsUserClockInTheFuture(now);
}
@@ -232,9 +233,18 @@ SSLBlockingPage::SSLBlockingPage(content::WebContents* web_contents,
strict_enforcement_((options_mask & STRICT_ENFORCEMENT) != 0),
expired_but_previously_allowed_(
(options_mask & EXPIRED_BUT_PREVIOUSLY_ALLOWED) != 0) {
- interstitial_reason_ =
- IsErrorDueToBadClock(base::Time::NowFromSystemTime(), cert_error_) ?
- SSL_REASON_BAD_CLOCK : SSL_REASON_SSL;
+ // somehow we need to override the clockcheck - otherwise the interstitial
+ // will not be shown
+ std::string testHost("yourclockiswrong.com");
lgarron 2015/02/19 22:57:06 If we have to hardcode a website, I think we shoul
felt 2015/02/19 23:16:07 We probably shouldn't be hardcoding anything for a
+ if ((SSLErrorInfo::NetErrorToErrorType(cert_error_) ==
+ SSLErrorInfo::CERT_DATE_INVALID) &&
+ (request_url.host().compare(testHost) == 0)) {
+ interstitial_reason_ = SSL_REASON_BAD_CLOCK;
+ } else {
+ interstitial_reason_ =
+ IsErrorDueToBadClock(base::Time::NowFromSystemTime(), cert_error_) ?
+ SSL_REASON_BAD_CLOCK : SSL_REASON_SSL;
+ }
// We collapse the Rappor metric name to just "ssl" so we don't leak
// the "overridable" bit. We skip Rappor altogether for bad clocks.
« no previous file with comments | « no previous file | chrome/browser/ui/webui/interstitials/interstitial_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698