summaryrefslogtreecommitdiffstats
path: root/apps/genpkey.c
diff options
context:
space:
mode:
authorViktor Dukhovni <openssl-users@dukhovni.org>2024-01-12 19:22:17 -0500
committerTomas Mraz <tomas@openssl.org>2024-01-16 11:40:01 +0100
commit7698f80ab17190be8d6950d8836222a375245ed8 (patch)
treec872e3c745f1e7eb3092bdea5246c7be5e7da578 /apps/genpkey.c
parentaac531e5daa2edec5d47e702a7f115cf77fe07f9 (diff)
Add missing genpkey -rand support
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23294)
Diffstat (limited to 'apps/genpkey.c')
-rw-r--r--apps/genpkey.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/genpkey.c b/apps/genpkey.c
index 66f0e1eaf0..341d2cd6fc 100644
--- a/apps/genpkey.c
+++ b/apps/genpkey.c
@@ -24,7 +24,7 @@ typedef enum OPTION_choice {
OPT_ENGINE, OPT_OUTFORM, OPT_OUT, OPT_PASS, OPT_PARAMFILE,
OPT_ALGORITHM, OPT_PKEYOPT, OPT_GENPARAM, OPT_TEXT, OPT_CIPHER,
OPT_VERBOSE, OPT_QUIET, OPT_CONFIG, OPT_OUTPUBKEY,
- OPT_PROV_ENUM
+ OPT_PROV_ENUM, OPT_R_ENUM
} OPTION_CHOICE;
const OPTIONS genpkey_options[] = {
@@ -51,6 +51,7 @@ const OPTIONS genpkey_options[] = {
{"", OPT_CIPHER, '-', "Cipher to use to encrypt the key"},
OPT_PROV_OPTIONS,
+ OPT_R_OPTIONS,
/* This is deliberately last. */
{OPT_HELP_STR, 1, 1,
@@ -188,6 +189,10 @@ int genpkey_main(int argc, char **argv)
if (!opt_provider(o))
goto end;
break;
+ case OPT_R_CASES:
+ if (!opt_rand(o))
+ goto end;
+ break;
}
}
@@ -195,6 +200,9 @@ int genpkey_main(int argc, char **argv)
if (!opt_check_rest_arg(NULL))
goto opthelp;
+ if (!app_RAND_load())
+ goto end;
+
/* Fetch cipher, etc. */
if (paramfile != NULL) {
if (!init_keygen_file(&ctx, paramfile, e, libctx, app_get0_propq()))