[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Richard Levitte levitte at openssl.org
Sat May 21 01:57:51 UTC 2016


The branch OpenSSL_1_0_2-stable has been updated
       via  d384bf39b17fa879dd91138d08105114b5a25370 (commit)
      from  a5319447964570ce1e9d2ad34c75d5ded429d857 (commit)


- Log -----------------------------------------------------------------
commit d384bf39b17fa879dd91138d08105114b5a25370
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri May 20 16:57:35 2016 +0200

    openssl verify: only display the command usage on usage errors
    
    All other errors should only display the error message.
    
    RT#1866
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 apps/verify.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/apps/verify.c b/apps/verify.c
index 78e729f..b5ae6b3 100644
--- a/apps/verify.c
+++ b/apps/verify.c
@@ -115,43 +115,43 @@ int MAIN(int argc, char **argv)
         if (argc >= 1) {
             if (strcmp(*argv, "-CApath") == 0) {
                 if (argc-- < 1)
-                    goto end;
+                    goto usage;
                 CApath = *(++argv);
             } else if (strcmp(*argv, "-CAfile") == 0) {
                 if (argc-- < 1)
-                    goto end;
+                    goto usage;
                 CAfile = *(++argv);
             } else if (args_verify(&argv, &argc, &badarg, bio_err, &vpm)) {
                 if (badarg)
-                    goto end;
+                    goto usage;
                 continue;
             } else if (strcmp(*argv, "-untrusted") == 0) {
                 if (argc-- < 1)
-                    goto end;
+                    goto usage;
                 untfile = *(++argv);
             } else if (strcmp(*argv, "-trusted") == 0) {
                 if (argc-- < 1)
-                    goto end;
+                    goto usage;
                 trustfile = *(++argv);
             } else if (strcmp(*argv, "-CRLfile") == 0) {
                 if (argc-- < 1)
-                    goto end;
+                    goto usage;
                 crlfile = *(++argv);
             } else if (strcmp(*argv, "-crl_download") == 0)
                 crl_download = 1;
 #ifndef OPENSSL_NO_ENGINE
             else if (strcmp(*argv, "-engine") == 0) {
                 if (--argc < 1)
-                    goto end;
+                    goto usage;
                 engine = *(++argv);
             }
 #endif
             else if (strcmp(*argv, "-help") == 0)
-                goto end;
+                goto usage;
             else if (strcmp(*argv, "-verbose") == 0)
                 v_verbose = 1;
             else if (argv[0][0] == '-')
-                goto end;
+                goto usage;
             else
                 break;
             argc--;
@@ -228,7 +228,7 @@ int MAIN(int argc, char **argv)
                 ret = -1;
     }
 
- end:
+ usage:
     if (ret == 1) {
         BIO_printf(bio_err,
                    "usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]");
@@ -247,6 +247,7 @@ int MAIN(int argc, char **argv)
                        X509_PURPOSE_get0_name(ptmp));
         }
     }
+ end:
     if (vpm)
         X509_VERIFY_PARAM_free(vpm);
     if (cert_ctx != NULL)


More information about the openssl-commits mailing list