[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Mon Jan 8 18:17:13 UTC 2018


The branch master has been updated
       via  fd6a0f5e525d187d7f1cd030e56d8aba9cafcbbf (commit)
      from  9d828b53978f4cbe24e190795fef86188b5116eb (commit)


- Log -----------------------------------------------------------------
commit fd6a0f5e525d187d7f1cd030e56d8aba9cafcbbf
Author: Jacob Hoffman-Andrews <github at hoffman-andrews.com>
Date:   Fri Dec 22 16:18:22 2017 -0800

    Clarify error for unrecognized arguments.
    
    Many of the sub-commands under apps/ accept cipher or digest arguments like
    "-sha256". These are implemented using a catchall flag that runs the result
    through opt_md() or opt_cipher(). That means any unrecognized flag, including
    typos, gets sent to those two functions, producing confusing error messages like
    below:
    
        $ ./apps/openssl req -x590
        req: Unrecognized digest x590
        req: Use -help for summary.
    
    This change switches these two functions to say "Unrecognized flag X" instead.
    The new message deliberately leaves off the "-" from the flag name, because
    there are some cases where opt_md() and opt_cipher() are passed a flag value
    instead (for instance, openssl ca -md). I think the new message is generic
    enough that it can serve both cases with improved clarity.
    
    CLA: trivial
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4972)

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

Summary of changes:
 apps/opt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/opt.c b/apps/opt.c
index fcd01c0..6f566a7 100644
--- a/apps/opt.c
+++ b/apps/opt.c
@@ -278,7 +278,7 @@ int opt_cipher(const char *name, const EVP_CIPHER **cipherp)
     *cipherp = EVP_get_cipherbyname(name);
     if (*cipherp != NULL)
         return 1;
-    BIO_printf(bio_err, "%s: Unknown cipher %s\n", prog, name);
+    BIO_printf(bio_err, "%s: Unrecognized flag %s\n", prog, name);
     return 0;
 }
 
@@ -290,7 +290,7 @@ int opt_md(const char *name, const EVP_MD **mdp)
     *mdp = EVP_get_digestbyname(name);
     if (*mdp != NULL)
         return 1;
-    BIO_printf(bio_err, "%s: Unknown digest %s\n", prog, name);
+    BIO_printf(bio_err, "%s: Unrecognized flag %s\n", prog, name);
     return 0;
 }
 


More information about the openssl-commits mailing list