summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2012-11-20 15:22:15 +0000
committerDr. Stephen Henson <steve@openssl.org>2013-08-19 21:55:07 +0100
commit9855026c43e4a911dab66b6ddc599aa1f8856eac (patch)
treed688237964a0ec72a5953a5c6969f0ec7e3e8654 /apps
parent904348a4922333106b613754136305db229475ea (diff)
fix printout of expiry days if -enddate is used in ca
(cherry picked from commit f7ac0ec89d0daefdea2956c55c17f1246e81c0a6)
Diffstat (limited to 'apps')
-rw-r--r--apps/ca.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 0cb498b9d9..5d488e2fac 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -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;