summaryrefslogtreecommitdiffstats
path: root/apps/ca.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-08-19 16:21:21 +0100
committerDr. Stephen Henson <steve@openssl.org>2016-08-19 16:52:58 +0100
commitdc047d31fa0c31872db8601a1b9fcd35f24d8589 (patch)
tree751aa4ab6e7c2344281f6f9f73130d07f650cee6 /apps/ca.c
parent3a60d6fa2f8a908d972f8787dc137acb7b8b26e3 (diff)
Set certificate times in one function.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'apps/ca.c')
-rw-r--r--apps/ca.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/apps/ca.c b/apps/ca.c
index a20ba44c09..ef61de2eef 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1698,16 +1698,11 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
goto end;
}
- if (strcmp(startdate, "today") == 0)
- X509_gmtime_adj(X509_get_notBefore(ret), 0);
- else
- ASN1_TIME_set_string(X509_get_notBefore(ret), startdate);
+ if (!set_cert_times(ret, startdate, enddate, days))
+ goto end;
- if (enddate == NULL)
- X509_time_adj_ex(X509_get_notAfter(ret), days, 0, NULL);
- else {
+ if (enddate != NULL) {
int tdays;
- ASN1_TIME_set_string(X509_get_notAfter(ret), enddate);
ASN1_TIME_diff(&tdays, NULL, NULL, X509_get_notAfter(ret));
days = tdays;
}