summaryrefslogtreecommitdiffstats
path: root/apps/ocsp.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-08-24 12:03:12 +0200
committerDr. David von Oheimb <dev@ddvo.net>2022-01-11 12:45:33 +0100
commit2c2724476ef50b8926b033f009bdfc85ac3f1816 (patch)
tree063c001d6a1f66afd83a8ce91df68bc7959901b4 /apps/ocsp.c
parent870871e5df4f47611c38e81d3f50e38cbf362082 (diff)
APPS: Add check for multiple 'unknown' options
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/16416)
Diffstat (limited to 'apps/ocsp.c')
-rw-r--r--apps/ocsp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/ocsp.c b/apps/ocsp.c
index d8e45ccd43..18e7c44191 100644
--- a/apps/ocsp.c
+++ b/apps/ocsp.c
@@ -196,8 +196,10 @@ const OPTIONS ocsp_options[] = {
{"VAfile", OPT_VAFILE, '<', "Validator certificates file"},
{"verify_other", OPT_VERIFY_OTHER, '<',
"Additional certificates to search for signer"},
- {"cert", OPT_CERT, '<', "Certificate to check"},
- {"serial", OPT_SERIAL, 's', "Serial number to check"},
+ {"cert", OPT_CERT, '<',
+ "Certificate to check; may be given multiple times"},
+ {"serial", OPT_SERIAL, 's',
+ "Serial number to check; may be given multiple times"},
{"validity_period", OPT_VALIDITY_PERIOD, 'u',
"Maximum validity discrepancy in seconds"},
{"signkey", OPT_SIGNKEY, 's', "Private key to sign OCSP request with"},
@@ -261,6 +263,7 @@ int ocsp_main(int argc, char **argv)
|| (vpm = X509_VERIFY_PARAM_new()) == NULL)
goto end;
+ opt_set_unknown_name("digest");
prog = opt_init(argc, argv, ocsp_options);
while ((o = opt_next()) != OPT_EOF) {
switch (o) {
@@ -436,6 +439,7 @@ int ocsp_main(int argc, char **argv)
goto end;
break;
case OPT_CERT:
+ reset_unknown();
X509_free(cert);
cert = load_cert(opt_arg(), FORMAT_UNDEF, "certificate");
if (cert == NULL)
@@ -449,6 +453,7 @@ int ocsp_main(int argc, char **argv)
trailing_md = 0;
break;
case OPT_SERIAL:
+ reset_unknown();
if (cert_id_md == NULL)
cert_id_md = (EVP_MD *)EVP_sha1();
if (!add_ocsp_serial(&req, opt_arg(), cert_id_md, issuer, ids))