diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-06-09 10:21:58 +0200 |
---|---|---|
committer | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-05-25 15:16:54 +0200 |
commit | a7e4ca5b4e1932cb91ea21047403c87a033e524a (patch) | |
tree | 1ad41d1f12e8ed09486ca48cf570cff42962ec73 /apps/dsaparam.c | |
parent | 8d67621de16990132c13f6a11bcc18ce8e9cdd47 (diff) |
Add warning to key/param generating apps on potential delay due to missing entropy
This also introduces app_keygen() and app_paramgen() and cleans up err reporting.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12095)
Diffstat (limited to 'apps/dsaparam.c')
-rw-r--r-- | apps/dsaparam.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/apps/dsaparam.c b/apps/dsaparam.c index d7fb736b98..df98532459 100644 --- a/apps/dsaparam.c +++ b/apps/dsaparam.c @@ -11,6 +11,7 @@ #include <stdio.h> #include <stdlib.h> +#include "apps.h" #include <time.h> #include <string.h> #include "apps.h" @@ -176,10 +177,7 @@ int dsaparam_main(int argc, char **argv) "Error, DSA key generation setting bit length failed\n"); goto end; } - if (EVP_PKEY_paramgen(ctx, ¶ms) <= 0) { - BIO_printf(bio_err, "Error, DSA key generation failed\n"); - goto end; - } + params = app_paramgen(ctx, "DSA"); } else { params = load_keyparams(infile, informat, 1, "DSA", "DSA parameters"); } @@ -218,10 +216,7 @@ int dsaparam_main(int argc, char **argv) "Error, unable to initialise for key generation\n"); goto end; } - if (!EVP_PKEY_keygen(ctx, &pkey)) { - BIO_printf(bio_err, "Error, unable to generate key\n"); - goto end; - } + pkey = app_keygen(ctx, "DSA", numbits, verbose); assert(private); if (outformat == FORMAT_ASN1) i = i2d_PrivateKey_bio(out, pkey); |