projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make 'openssl req -x509' more equivalent to 'openssl req -new'
[openssl.git]
/
apps
/
req.c
diff --git
a/apps/req.c
b/apps/req.c
index 112553b48e3a11105f8086282d559ca59cc7f31f..26661245464c6ca9bea16d233091d270e6f1549b 100644
(file)
--- 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;
break;
case OPT_X509:
x509 = 1;
+ newreq = 1;
break;
case OPT_DAYS:
days = atoi(opt_arg());
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;
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_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)))
goto end;
if (!X509_set_subject_name
(x509ss, X509_REQ_get_subject_name(req)))