X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=apps%2Freq.c;h=26661245464c6ca9bea16d233091d270e6f1549b;hb=599e5904b22f3d50c5f4720aa3bc8ab8af0ffa98;hp=112553b48e3a11105f8086282d559ca59cc7f31f;hpb=cc69629626ce0dab934704e1d9e806e0823c87d0;p=openssl.git diff --git a/apps/req.c b/apps/req.c index 112553b48e..2666124546 100644 --- a/apps/req.c +++ b/apps/req.c @@ -289,6 +289,7 @@ int req_main(int argc, char **argv) break; case OPT_X509: x509 = 1; + newreq = 1; break; case OPT_DAYS: days = atoi(opt_arg()); @@ -578,7 +579,7 @@ int req_main(int argc, char **argv) } } - if (newreq || x509) { + if (newreq) { if (pkey == NULL) { BIO_printf(bio_err, "you need to specify a private key\n"); goto end; @@ -616,9 +617,7 @@ int req_main(int argc, char **argv) if (!X509_set_issuer_name(x509ss, X509_REQ_get_subject_name(req))) goto end; - if (!X509_gmtime_adj(X509_get_notBefore(x509ss), 0)) - goto end; - if (!X509_time_adj_ex(X509_get_notAfter(x509ss), days, 0, NULL)) + if (!set_cert_times(x509ss, NULL, NULL, days)) goto end; if (!X509_set_subject_name (x509ss, X509_REQ_get_subject_name(req)))