openssl cms: add error message if operation option is missing
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Thu, 2 May 2019 12:49:34 +0000 (14:49 +0200)
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Thu, 2 May 2019 21:05:38 +0000 (23:05 +0200)
If the `openssl cms` command is called without specifying an
operation option, it replies with the following laconic error message:

    cms: Use -help for summary.

This commit adds a helpful error message:

    No operation option (-encrypt|-decrypt|-sign|-verify|...) specified.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8861)

apps/cms.c

index b2037b4df2bf4d53f22cf4d0206f938d191f28f6..2863a92eee863bdc5e0fdb31f78f70935861a945 100644 (file)
@@ -640,6 +640,7 @@ int cms_main(int argc, char **argv)
             goto opthelp;
         }
     } else if (!operation) {
+        BIO_printf(bio_err, "No operation option (-encrypt|-decrypt|-sign|-verify|...) specified.\n");
         goto opthelp;
     }