Chromium Code Reviews| Index: net/der/parse_values.cc |
| diff --git a/net/der/parse_values.cc b/net/der/parse_values.cc |
| index 903daafdc0d7221e29607486f46e6064c795564e..93f6650d81005cba4271c18668fbd8b721196a04 100644 |
| --- a/net/der/parse_values.cc |
| +++ b/net/der/parse_values.cc |
| @@ -6,6 +6,7 @@ |
| #include "base/logging.h" |
| #include "base/numerics/safe_math.h" |
| +#include "base/time/time.h" |
| #include "net/der/parse_values.h" |
| namespace net { |
| @@ -383,6 +384,21 @@ bool ParseGeneralizedTime(const Input& in, GeneralizedTime* value) { |
| return true; |
| } |
| +der::GeneralizedTime ConvertBaseUTCTime(const base::Time& time) { |
| + base::Time::Exploded exploded; |
| + time.UTCExplode(&exploded); |
| + |
| + der::GeneralizedTime result; |
| + result.year = exploded.year; |
| + result.month = exploded.month; |
| + result.day = exploded.day_of_month; |
| + result.hours = exploded.hour; |
| + result.minutes = exploded.minute; |
| + result.seconds = exploded.second; |
| + DCHECK(ValidateGeneralizedTime(result)); |
|
Ryan Sleevi
2016/06/28 17:33:30
Why DCHECK here? A DCHECK signals that there's a c
dadrian
2016/06/28 19:15:27
Presumably we should handle this the same way expl
dadrian
2016/06/29 22:54:02
Nvm, just removed the DCHECK().
|
| + return result; |
| +} |
| + |
| } // namespace der |
| } // namespace net |