| diff --git a/apps/verify.c b/apps/verify.c |
| index 20cc9e3..19dfb85 100644 |
| --- a/apps/verify.c |
| +++ b/apps/verify.c |
| @@ -90,6 +90,7 @@ int MAIN(int argc, char **argv) |
| #ifndef OPENSSL_NO_ENGINE |
| char *engine=NULL; |
| #endif |
| + int anyfailed = 0; |
| |
| cert_ctx=X509_STORE_new(); |
| if (cert_ctx == NULL) goto end; |
| @@ -208,11 +209,12 @@ int MAIN(int argc, char **argv) |
| } |
| } |
| |
| - if (argc < 1) check(cert_ctx, NULL, untrusted, trusted, purpose, e); |
| + if (argc < 1) |
| + anyfailed = check(cert_ctx, NULL, untrusted, trusted, purpose, e); |
| else |
| for (i=0; i<argc; i++) |
| - check(cert_ctx,argv[i], untrusted, trusted, purpose, e); |
| - ret=0; |
| + anyfailed |= !check(cert_ctx,argv[i], untrusted, trusted, purpose, e); |
| + ret = anyfailed ? 2 : 0; |
| end: |
| if (ret == 1) { |
| BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]"); |
| @@ -272,7 +274,10 @@ end: |
| ret=1; |
| } |
| else |
| + { |
| + fprintf(stdout, "Error\n"); |
| ERR_print_errors(bio_err); |
| + } |
| if (x != NULL) X509_free(x); |
| |
| return(ret); |