diff options
author | Philip Prindeville <philipp@redfish-solutions.com> | 2021-12-21 22:00:38 -0700 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-01-21 15:44:28 +0100 |
commit | e1cd94f2dca4056ce042c62b89c468dffc088033 (patch) | |
tree | ee3ca7b476be8d96f92109f03c419b9fd0d11b27 /apps/dhparam.c | |
parent | 8c2e588bcf0de61880ec8a956ef57ad6b8a50163 (diff) |
Standardize progress callback for dhparam, dsaparam, etc.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17359)
Diffstat (limited to 'apps/dhparam.c')
-rw-r--r-- | apps/dhparam.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/apps/dhparam.c b/apps/dhparam.c index 9fe0eedfc2..4a67a52d4a 100644 --- a/apps/dhparam.c +++ b/apps/dhparam.c @@ -31,7 +31,6 @@ #define DEFBITS 2048 static EVP_PKEY *dsa_to_dh(EVP_PKEY *dh); -static int gendh_cb(EVP_PKEY_CTX *ctx); typedef enum OPTION_choice { OPT_COMMON, @@ -188,7 +187,7 @@ int dhparam_main(int argc, char **argv) alg); goto end; } - EVP_PKEY_CTX_set_cb(ctx, gendh_cb); + EVP_PKEY_CTX_set_cb(ctx, progress_cb); EVP_PKEY_CTX_set_app_data(ctx, bio_err); BIO_printf(bio_err, "Generating %s parameters, %d bit long %sprime\n", @@ -399,14 +398,3 @@ static EVP_PKEY *dsa_to_dh(EVP_PKEY *dh) return pkey; } -static int gendh_cb(EVP_PKEY_CTX *ctx) -{ - int p = EVP_PKEY_CTX_get_keygen_info(ctx, 0); - BIO *b = EVP_PKEY_CTX_get_app_data(ctx); - static const char symbols[] = ".+*\n"; - char c = (p >= 0 && (size_t)p < sizeof(symbols) - 1) ? symbols[p] : '?'; - - BIO_write(b, &c, 1); - (void)BIO_flush(b); - return 1; -} |