Our ASN1_GENERALIZEDTIME_set() doesn't accept time strings with
fractional seconds, so don't feed it milliseconds, but only seconds.
Ensures that openssl x509 -text prints timestamps instead of skipping
them.
ok beck jsing
* Note GeneralizedTime from ASN1_GENERALIZETIME_adj is always 15
* characters long with a final Z. Update it with fractional seconds.
*/
- snprintf(genstr, sizeof(genstr), "%.14s.%03dZ",
- ASN1_STRING_get0_data(gen), (unsigned int)(timestamp % 1000));
+ snprintf(genstr, sizeof(genstr), "%.14sZ", ASN1_STRING_get0_data(gen));
if (ASN1_GENERALIZEDTIME_set_string(gen, genstr))
ASN1_GENERALIZEDTIME_print(out, gen);
ASN1_GENERALIZEDTIME_free(gen);