diff options
Diffstat (limited to 'trust/builder.c')
-rw-r--r-- | trust/builder.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/trust/builder.c b/trust/builder.c index 53201ed..b23d018 100644 --- a/trust/builder.c +++ b/trust/builder.c @@ -257,14 +257,12 @@ calc_date (node_asn *node, ret = asn1_read_value (node, sub, buf, &len); return_val_if_fail (ret == ASN1_SUCCESS, false); timet = p11_asn1_parse_general (buf, &when); - return_val_if_fail (timet >= 0, false); } else if (strcmp (buf, "utcTime") == 0) { len = sizeof (buf) - 1; ret = asn1_read_value (node, sub, buf, &len); return_val_if_fail (ret == ASN1_SUCCESS, false); timet = p11_asn1_parse_utc (buf, &when); - return_val_if_fail (timet >= 0, false); } else { return_val_if_reached (false); @@ -272,6 +270,9 @@ calc_date (node_asn *node, free (sub); + if (timet < 0) + return false; + assert (sizeof (date->year) == 4); snprintf ((char *)buf, 5, "%04d", 1900 + when.tm_year); memcpy (date->year, buf, 4); |