From f85a9d26be950f2fe621448af154ed01e514ce0f Mon Sep 17 00:00:00 2001 From: Shane Lontis Date: Sat, 29 Aug 2020 12:06:05 +1000 Subject: [PATCH] Add error message to genpkey app for the '-genparam' option The ordering of this option is important so inform the user if they do it incorrectly. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/12745) --- apps/genpkey.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/genpkey.c b/apps/genpkey.c index 9da5b556e8..94453af15c 100644 --- a/apps/genpkey.c +++ b/apps/genpkey.c @@ -125,8 +125,12 @@ int genpkey_main(int argc, char **argv) } break; case OPT_GENPARAM: - if (ctx != NULL) + if (ctx != NULL) { + BIO_printf(bio_err, + "%s: '-genparam' option must be set before" + " the '-algorithm' option.\n", prog); goto opthelp; + } do_param = 1; break; case OPT_TEXT: -- 2.34.1