diff options
author | Rich Salz <rsalz@akamai.com> | 2019-09-19 21:33:17 -0400 |
---|---|---|
committer | Tomas Mraz <tmraz@fedoraproject.org> | 2019-11-20 09:49:52 +0100 |
commit | 92de469fbd62a77a36dad5fde3a0ac7034071a59 (patch) | |
tree | bd2dfc3fc90d85af938a0e837813f66c5d3fa16c /apps/verify.c | |
parent | 1838580037a47b42c5b2326b0b988c50c7c64c3c (diff) |
Document command parameters.
Add documentation for all commands that have parameters.
Fix a couple of minor doc and programming bugs, too.
Fixes #10313
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10371)
Diffstat (limited to 'apps/verify.c')
-rw-r--r-- | apps/verify.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/verify.c b/apps/verify.c index bb8f84c84d..5c5042117d 100644 --- a/apps/verify.c +++ b/apps/verify.c @@ -35,7 +35,7 @@ typedef enum OPTION_choice { } OPTION_CHOICE; const OPTIONS verify_options[] = { - {OPT_HELP_STR, 1, '-', "Usage: %s [options] cert.pem...\n"}, + {OPT_HELP_STR, 1, '-', "Usage: %s [options] [cert...]\n"}, OPT_SECTION("General"), {"help", OPT_HELP, '-', "Display this summary"}, @@ -72,6 +72,9 @@ const OPTIONS verify_options[] = { {"sm2-hex-id", OPT_SM2HEXID, 's', "Specify a hex ID string to verify an SM2 certificate"}, #endif + + OPT_PARAMETERS(), + {"cert", 0, 0, "Certificate(s) to verify (optional; stdin used otherwise)"}, {NULL} }; @@ -102,20 +105,20 @@ int verify_main(int argc, char **argv) goto end; case OPT_HELP: opt_help(verify_options); - BIO_printf(bio_err, "Recognized usages:\n"); + BIO_printf(bio_err, "\nRecognized certificate chain purposes:\n"); for (i = 0; i < X509_PURPOSE_get_count(); i++) { - X509_PURPOSE *ptmp; - ptmp = X509_PURPOSE_get0(i); - BIO_printf(bio_err, "\t%-10s\t%s\n", + X509_PURPOSE *ptmp = X509_PURPOSE_get0(i); + + BIO_printf(bio_err, " %-15s %s\n", X509_PURPOSE_get0_sname(ptmp), X509_PURPOSE_get0_name(ptmp)); } - BIO_printf(bio_err, "Recognized verify names:\n"); + BIO_printf(bio_err, "Recognized certificate policy names:\n"); for (i = 0; i < X509_VERIFY_PARAM_get_count(); i++) { - const X509_VERIFY_PARAM *vptmp; - vptmp = X509_VERIFY_PARAM_get0(i); - BIO_printf(bio_err, "\t%-10s\n", + const X509_VERIFY_PARAM *vptmp = X509_VERIFY_PARAM_get0(i); + + BIO_printf(bio_err, " %s\n", X509_VERIFY_PARAM_get0_name(vptmp)); } ret = 0; |