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

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

Issue 1072913003: Fix "security certificate expired 0 day(s) ago" bug (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Felt comments Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_error_info.cc
diff --git a/chrome/browser/ssl/ssl_error_info.cc b/chrome/browser/ssl/ssl_error_info.cc
index d4ad26d975429a0ce6797b01d9b3ac25cb05d7d3..00916e8c6326f5f2a7813c26f38a9270d9d97573 100644
--- a/chrome/browser/ssl/ssl_error_info.cc
+++ b/chrome/browser/ssl/ssl_error_info.cc
@@ -59,10 +59,13 @@ SSLErrorInfo SSLErrorInfo::CreateError(ErrorType error_type,
}
case CERT_DATE_INVALID:
if (cert->HasExpired()) {
+ // Make sure to round up to the smallest integer value not less than
+ // the expiration value (https://crbug.com/476758).
+ int expiration_value =
+ (base::Time::Now() - cert->valid_expiry()).InDays() + 1;
details = l10n_util::GetStringFUTF16(
IDS_CERT_ERROR_EXPIRED_DETAILS, UTF8ToUTF16(request_url.host()),
- base::IntToString16(
- (base::Time::Now() - cert->valid_expiry()).InDays()),
+ base::IntToString16(expiration_value),
base::TimeFormatFriendlyDate(base::Time::Now()));
short_description =
l10n_util::GetStringUTF16(IDS_CERT_ERROR_EXPIRED_DESCRIPTION);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698