Also gives an error message when you gave it a parameter it didn't expect.
Reviewed-by: Rich Salz <rsalz@openssl.org>
MR: #2009
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
if (oidfile != NULL) {
in = bio_open_default(oidfile, 'r', FORMAT_TEXT);
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
if (!nmflag_set)
nmflag = XN_FLAG_ONELINE;
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
if (!nocrl) {
in = bio_open_default(infile, 'r', informat);
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
+
private = pubin || pubout ? 0 : 1;
if (text && !pubin)
private = 1;
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
+
private = param_out || pubin || pubout ? 0 : 1;
if (text && !pubin)
private = 1;
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
+
private = genkey ? 1 : 0;
in = bio_open_default(infile, 'r', informat);
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
+
private = do_param ? 0 : 1;
if (ctx == NULL)
switch (o) {
case OPT_EOF:
case OPT_ERR:
+ opthelp:
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
goto end;
case OPT_HELP:
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
in = bio_open_default(infile, 'r', FORMAT_PEM);
if (in == NULL)
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
/* Have we anything to do? */
if (!req && !reqin && !respin && !(port && ridx_filename))
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
+
private = 1;
if (passarg) {
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
in = bio_open_default(infile, 'r', informat);
if (in == NULL)
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
+
private = 1;
if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
+
private = !noout && !pubout ? 1 : 0;
if (text && !pubtext)
private = 1;
switch (o) {
case OPT_EOF:
case OPT_ERR:
+ opthelp:
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
goto end;
case OPT_HELP:
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
in = bio_open_default(infile, 'r', FORMAT_PEM);
if (in == NULL)
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
if (inkey == NULL ||
(peerkey != NULL && pkey_op != EVP_PKEY_OP_DERIVE))
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
if (!nmflag_set)
nmflag = XN_FLAG_ONELINE;
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
+
private = (text && !pubin) || (!pubout && !noout) ? 1 : 0;
if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
if (need_priv && (key_type != KEY_PRIVKEY)) {
BIO_printf(bio_err, "A private key is needed for this operation\n");
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
if (proxystr) {
int res;
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
if (cipher == NULL)
cipher = getenv("SSL_CIPHER");
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
x = load_sess_id(infile, informat);
if (x == NULL) {
switch (o) {
case OPT_EOF:
case OPT_ERR:
+ opthelp:
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
goto end;
case OPT_HELP:
}
}
argc = opt_num_rest();
- argv = opt_rest();
+ if (argc != 0)
+ goto opthelp;
if (!app_passwd(passinarg, NULL, &passin, NULL)) {
BIO_printf(bio_err, "Error getting password\n");
}
}
argc = opt_num_rest();
- argv = opt_rest();
if (mode == OPT_ERR || argc != 0)
goto opthelp;