aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/asn1
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-12-04 16:58:19 -0500
committerJack Lloyd <[email protected]>2017-12-04 16:58:19 -0500
commitf82ee841f719926e91eb4a5533c964821f08488d (patch)
tree21c5924b896caa716e9a690a6cc2463bbede82ea /src/lib/asn1
parente5f39dd483a08accc8a12e8b322a48037c5b3bf4 (diff)
Simplify date conversion by avoiding OS utilities
We have to rely on non-portable OS calls to convert UTC times, and they are not available on many systems (including Solaris and MinGW). But instead there is a simple algorithm due to Howard Hinnant that does the same job. Woo.
Diffstat (limited to 'src/lib/asn1')
-rw-r--r--src/lib/asn1/asn1_time.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/asn1/asn1_time.cpp b/src/lib/asn1/asn1_time.cpp
index f6a0c414e..daa0c4e7d 100644
--- a/src/lib/asn1/asn1_time.cpp
+++ b/src/lib/asn1/asn1_time.cpp
@@ -20,12 +20,12 @@ X509_Time::X509_Time(const std::chrono::system_clock::time_point& time)
{
calendar_point cal = calendar_value(time);
- m_year = cal.year;
- m_month = cal.month;
- m_day = cal.day;
- m_hour = cal.hour;
- m_minute = cal.minutes;
- m_second = cal.seconds;
+ m_year = cal.get_year();
+ m_month = cal.get_month();
+ m_day = cal.get_day();
+ m_hour = cal.get_hour();
+ m_minute = cal.get_minutes();
+ m_second = cal.get_seconds();
m_tag = (m_year >= 2050) ? GENERALIZED_TIME : UTC_TIME;
}