X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fbtls%2Fbtls-util.c;h=7c7f4ca5b41a511496b431425788a3531f425749;hb=971b7a4e48a2619866c35e7b4761e330fe746e61;hp=824b101f34c50ed68b88fd0e804a050ed7add745;hpb=2fb07d6c6d5b3915ef4665391febbb7b8be09fb5;p=mono.git diff --git a/mono/btls/btls-util.c b/mono/btls/btls-util.c index 824b101f34c..7c7f4ca5b41 100644 --- a/mono/btls/btls-util.c +++ b/mono/btls/btls-util.c @@ -8,32 +8,33 @@ #include #include -#include - -#if defined(__ANDROID__) && !defined(__LP64__) -#include -extern time_t timegm (struct tm* const t); -#endif +// #include extern int asn1_generalizedtime_to_tm (struct tm *tm, const ASN1_GENERALIZEDTIME *d); +extern int64_t btls_timegm64 (const struct tm *date); + + MONO_API void mono_btls_free (void *data) { OPENSSL_free (data); } -long +int64_t mono_btls_util_asn1_time_to_ticks (ASN1_TIME *time) { ASN1_GENERALIZEDTIME *gtime; struct tm tm; - time_t epoch; + int64_t epoch; + int ret; + + memset (&tm, 0, sizeof (tm)); gtime = ASN1_TIME_to_generalizedtime (time, NULL); - asn1_generalizedtime_to_tm (&tm, gtime); + ret = asn1_generalizedtime_to_tm (&tm, gtime); ASN1_GENERALIZEDTIME_free (gtime); - epoch = timegm(&tm); + epoch = btls_timegm64 (&tm); return epoch; }