fix printout of expiry days if -enddate is used in ca

This commit is contained in:
Dr. Stephen Henson 2012-11-20 15:22:15 +00:00
parent 598c423e65
commit f7ac0ec89d
1 changed files with 7 additions and 1 deletions

View File

@ -2052,7 +2052,13 @@ again2:
if (enddate == NULL)
X509_time_adj_ex(X509_get_notAfter(ret),days, 0, NULL);
else ASN1_TIME_set_string(X509_get_notAfter(ret),enddate);
else
{
int tdays;
ASN1_TIME_set_string(X509_get_notAfter(ret),enddate);
ASN1_TIME_diff(&tdays, NULL, NULL, X509_get_notAfter(ret));
days = tdays;
}
if (!X509_set_subject_name(ret,subject)) goto err;