break;
case OPT_X509:
x509 = 1;
- newreq = 1;
break;
case OPT_DAYS:
days = atoi(opt_arg());
if (argc != 0)
goto opthelp;
+ if (x509 && infile == NULL)
+ newreq = 1;
+
/* TODO: simplify this as pkey is still always NULL here */
private = newreq && (pkey == NULL) ? 1 : 0;
}
}
- if (newreq) {
+ if (newreq || x509) {
if (pkey == NULL) {
BIO_printf(bio_err, "you need to specify a private key\n");
goto end;