diff options
author | Ben Laurie <ben@openssl.org> | 2012-12-13 15:49:15 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2012-12-13 15:49:15 +0000 |
commit | 5f4cf088647598ca57f66ef12a1c2c80e36237e6 (patch) | |
tree | b35878cbc31ffc6e8dd4ccee92dfdc663d10cb70 /apps/verify.c | |
parent | 2a2e537983dad1a76de93fa1da03e478528bb081 (diff) |
Make verify return errors.
Diffstat (limited to 'apps/verify.c')
-rw-r--r-- | apps/verify.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/verify.c b/apps/verify.c index 0f34b865ad..893670ff41 100644 --- a/apps/verify.c +++ b/apps/verify.c @@ -222,11 +222,19 @@ int MAIN(int argc, char **argv) goto end; } - if (argc < 1) check(cert_ctx, NULL, untrusted, trusted, crls, e); + ret = 0; + if (argc < 1) + { + if (1 != check(cert_ctx, NULL, untrusted, trusted, crls, e)) + ret = -1; + } else + { for (i=0; i<argc; i++) - check(cert_ctx,argv[i], untrusted, trusted, crls, e); - ret=0; + if (1 != check(cert_ctx,argv[i], untrusted, trusted, crls, e)) + ret = -1; + } + end: if (ret == 1) { BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]"); @@ -252,7 +260,7 @@ end: sk_X509_pop_free(trusted, X509_free); sk_X509_CRL_pop_free(crls, X509_CRL_free); apps_shutdown(); - OPENSSL_EXIT(ret); + OPENSSL_EXIT(ret < 0 ? 2 : ret); } static int check(X509_STORE *ctx, char *file, |