summaryrefslogtreecommitdiffstats
path: root/apps/verify.c
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2017-04-25 12:25:42 -0400
committerRich Salz <rsalz@openssl.org>2017-04-25 12:37:17 -0400
commitb5c4209be9162d4ceafb9aef833ca94ffa1cc5c9 (patch)
tree02dcc8e0d8a5368b0c7aa6780f7998c1d45f5f7d /apps/verify.c
parent645c694d85c8f48c74e7db8730ead874656c781e (diff)
Switch command-line utils to new nameopt API.
The CA names should be printed according to user's decision print_name instead of set of BIO_printf dump_cert_text instead of set of BIO_printf Testing cyrillic output of X509_CRL_print_ex Write and use X509_CRL_print_ex Reduce usage of X509_NAME_online Using X509_REQ_print_ex instead of X509_REQ_print Fix nameopt processing. Make dump_cert_text nameopt-friendly Move nameopt getter/setter to apps/apps.c Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3262)
Diffstat (limited to 'apps/verify.c')
-rw-r--r--apps/verify.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/apps/verify.c b/apps/verify.c
index a4eb465739..c31695c1b9 100644
--- a/apps/verify.c
+++ b/apps/verify.c
@@ -22,7 +22,6 @@ static int check(X509_STORE *ctx, const char *file,
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
STACK_OF(X509_CRL) *crls, int show_chain);
static int v_verbose = 0, vflags = 0;
-static unsigned long nmflag = 0;
typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
@@ -70,7 +69,6 @@ int verify_main(int argc, char **argv)
const char *prog, *CApath = NULL, *CAfile = NULL;
int noCApath = 0, noCAfile = 0;
int vpmtouched = 0, crl_download = 0, show_chain = 0, i = 0, ret = 1;
- char nmflag_set = 0;
OPTION_CHOICE o;
if ((vpm = X509_VERIFY_PARAM_new()) == NULL)
@@ -153,8 +151,7 @@ int verify_main(int argc, char **argv)
show_chain = 1;
break;
case OPT_NAMEOPT:
- nmflag_set = 1;
- if (!set_name_ex(&nmflag, opt_arg()))
+ if (!set_nameopt(opt_arg()))
goto end;
break;
case OPT_VERBOSE:
@@ -171,9 +168,6 @@ int verify_main(int argc, char **argv)
goto end;
}
- if (!nmflag_set)
- nmflag = XN_FLAG_ONELINE;
-
if ((store = setup_verify(CAfile, CApath, noCAfile, noCApath)) == NULL)
goto end;
X509_STORE_set_verify_cb(store, cb);
@@ -253,7 +247,7 @@ static int check(X509_STORE *ctx, const char *file,
printf("depth=%d: ", j);
X509_NAME_print_ex_fp(stdout,
X509_get_subject_name(cert),
- 0, nmflag);
+ 0, get_nameopt());
if (j < num_untrusted)
printf(" (untrusted)");
printf("\n");
@@ -282,7 +276,7 @@ static int cb(int ok, X509_STORE_CTX *ctx)
if (current_cert) {
X509_NAME_print_ex(bio_err,
X509_get_subject_name(current_cert),
- 0, nmflag);
+ 0, get_nameopt());
BIO_printf(bio_err, "\n");
}
BIO_printf(bio_err, "%serror %d at %d depth lookup: %s\n",