Tweak option error messages
authorRich Salz <rsalz@akamai.com>
Tue, 7 Jan 2020 17:44:25 +0000 (12:44 -0500)
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Fri, 10 Jan 2020 23:21:29 +0000 (00:21 +0100)
Better messages for unknown option, unknown cipher, unknown digest.

Fixes #10773

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10774)

apps/lib/opt.c

index 2a80e7ebf4c46b61c90fb9afe6fc2a189ce7427b..767f35f67327c86fb7f3f92a8dcbed5d32a334a9 100644 (file)
@@ -288,7 +288,7 @@ int opt_cipher(const char *name, const EVP_CIPHER **cipherp)
     *cipherp = EVP_get_cipherbyname(name);
     if (*cipherp != NULL)
         return 1;
-    opt_printf_stderr("%s: Unrecognized flag %s\n", prog, name);
+    opt_printf_stderr("%s: Unknown cipher: %s\n", prog, name);
     return 0;
 }
 
@@ -300,7 +300,7 @@ int opt_md(const char *name, const EVP_MD **mdp)
     *mdp = EVP_get_digestbyname(name);
     if (*mdp != NULL)
         return 1;
-    opt_printf_stderr("%s: Unrecognized flag %s\n", prog, name);
+    opt_printf_stderr("%s: Unknown message digest: %s\n", prog, name);
     return 0;
 }
 
@@ -762,7 +762,7 @@ int opt_next(void)
         dunno = p;
         return unknown->retval;
     }
-    opt_printf_stderr("%s: Option unknown option -%s\n", prog, p);
+    opt_printf_stderr("%s: Unknown option: -%s\n", prog, p);
     return -1;
 }