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

Unified Diff: net/cert/cert_verify_proc.cc

Issue 2090713003: Make callers of FromUTC(Local)Exploded in net/ use new time API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert Created 4 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 | « no previous file | net/cert/ct_policy_enforcer_unittest.cc » ('j') | net/cert/ct_policy_enforcer_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/cert_verify_proc.cc
diff --git a/net/cert/cert_verify_proc.cc b/net/cert/cert_verify_proc.cc
index 8fdd93cbb1bb0c4720273867ee9c9de3fb723ed6..6895bc6023b49353d475805325ac28feb47e47e0 100644
--- a/net/cert/cert_verify_proc.cc
+++ b/net/cert/cert_verify_proc.cc
@@ -693,12 +693,23 @@ bool CertVerifyProc::HasTooLongValidity(const X509Certificate& cert) {
if (exploded_expiry.day_of_month > exploded_start.day_of_month)
++month_diff;
- static const base::Time time_2012_07_01 =
- base::Time::FromUTCExploded({2012, 7, 0, 1, 0, 0, 0, 0});
- static const base::Time time_2015_04_01 =
- base::Time::FromUTCExploded({2015, 4, 0, 1, 0, 0, 0, 0});
- static const base::Time time_2019_07_01 =
- base::Time::FromUTCExploded({2019, 7, 0, 1, 0, 0, 0, 0});
+ static base::Time time_2012_07_01;
+ if (!base::Time::FromUTCExploded({2012, 7, 0, 1, 0, 0, 0, 0},
eroman 2016/10/20 18:05:21 This translation is not the same -- before FromUTC
+ &time_2012_07_01)) {
+ return false;
+ }
+
+ static base::Time time_2015_04_01;
+ if (!base::Time::FromUTCExploded({2015, 4, 0, 1, 0, 0, 0, 0},
+ &time_2015_04_01)) {
+ return false;
+ }
+
+ static base::Time time_2019_07_01;
+ if (!base::Time::FromUTCExploded({2019, 7, 0, 1, 0, 0, 0, 0},
+ &time_2019_07_01)) {
+ return false;
+ }
// For certificates issued before the BRs took effect.
if (start < time_2012_07_01 && (month_diff > 120 || expiry > time_2019_07_01))
« no previous file with comments | « no previous file | net/cert/ct_policy_enforcer_unittest.cc » ('j') | net/cert/ct_policy_enforcer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698