70 #define PROG verify_main
76 static int v_verbose=0, vflags = 0;
78 int MAIN(
int,
char **);
80 int MAIN(
int argc,
char **argv)
83 int i,ret=1, badarg = 0;
84 char *CApath=NULL,*CAfile=NULL;
85 char *untfile = NULL, *trustfile = NULL, *crlfile = NULL;
91 #ifndef OPENSSL_NO_ENGINE
96 if (cert_ctx == NULL)
goto end;
116 if (strcmp(*argv,
"-CApath") == 0)
118 if (argc-- < 1)
goto end;
121 else if (strcmp(*argv,
"-CAfile") == 0)
123 if (argc-- < 1)
goto end;
133 else if (strcmp(*argv,
"-untrusted") == 0)
135 if (argc-- < 1)
goto end;
138 else if (strcmp(*argv,
"-trusted") == 0)
140 if (argc-- < 1)
goto end;
141 trustfile= *(++argv);
143 else if (strcmp(*argv,
"-CRLfile") == 0)
145 if (argc-- < 1)
goto end;
148 #ifndef OPENSSL_NO_ENGINE
149 else if (strcmp(*argv,
"-engine") == 0)
151 if (--argc < 1)
goto end;
155 else if (strcmp(*argv,
"-help") == 0)
157 else if (strcmp(*argv,
"-verbose") == 0)
159 else if (argv[0][0] ==
'-')
170 #ifndef OPENSSL_NO_ENGINE
178 if (lookup == NULL) abort();
189 if (lookup == NULL) abort();
204 NULL, e,
"untrusted certificates");
212 NULL, e,
"trusted certificates");
220 NULL, e,
"other CRLs");
225 if (argc < 1) check(cert_ctx, NULL, untrusted, trusted, crls, e);
227 for (i=0; i<argc; i++)
228 check(cert_ctx,argv[i], untrusted, trusted, crls, e);
232 BIO_printf(
bio_err,
"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
234 #ifndef OPENSSL_NO_ENGINE
266 fprintf(stdout,
"%s: ",(file == NULL)?
"stdin":file);
290 fprintf(stdout,
"OK\n");
295 if (x != NULL) X509_free(x);
314 printf(
"%serror %d at %d depth lookup:%s\n",