diff options
Diffstat (limited to 'src/libstrongswan/asn1/asn1.c')
-rw-r--r-- | src/libstrongswan/asn1/asn1.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/libstrongswan/asn1/asn1.c b/src/libstrongswan/asn1/asn1.c index c52fb2dce..bde6ab22e 100644 --- a/src/libstrongswan/asn1/asn1.c +++ b/src/libstrongswan/asn1/asn1.c @@ -17,16 +17,11 @@ #include <string.h> #include <time.h> +#include "types.h" #include "asn1.h" #include <utils/logger_manager.h> -/* Names of the months */ -static const char* months[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" -}; - /* some common prefabricated ASN.1 constants */ static u_char ASN1_INTEGER_0_str[] = { 0x02, 0x00 }; static u_char ASN1_INTEGER_1_str[] = { 0x02, 0x01, 0x01 }; @@ -215,23 +210,6 @@ bool is_printablestring(chunk_t str) } /** - * Display a date either in local or UTC time - */ -void timetoa(char *buf, size_t buflen, const time_t *time, bool utc) -{ - if (*time == 0) - snprintf(buf, buflen, "--- -- --:--:--%s----", (utc)?" UTC ":" "); - else - { - struct tm *t = (utc)? gmtime(time) : localtime(time); - - snprintf(buf, buflen, "%s %02d %02d:%02d:%02d%s%04d", - months[t->tm_mon], t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, - (utc)?" UTC ":" ", t->tm_year + 1900); - } -} - -/** * Converts ASN.1 UTCTIME or GENERALIZEDTIME into calender time */ time_t asn1totime(const chunk_t *utctime, asn1_t type) |