ASN1_GENERALIZEDTIME *gtime;
struct tm tm;
int64_t epoch;
+ int ret;
memset (&tm, 0, sizeof (tm));
gtime = ASN1_TIME_to_generalizedtime (time, NULL);
- /* FIXME: check return value of asn1_generalizedtime_to_tm () */
- asn1_generalizedtime_to_tm (&tm, gtime);
+ ret = asn1_generalizedtime_to_tm (&tm, gtime);
ASN1_GENERALIZEDTIME_free (gtime);
+
+ /* FIXME: check the return value in managed code */
+ if (ret == 0) {
+ return 0;
+ }
+
epoch = btls_timegm64 (&tm);
return epoch;