From e1cd94f2dca4056ce042c62b89c468dffc088033 Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Tue, 21 Dec 2021 22:00:38 -0700 Subject: Standardize progress callback for dhparam, dsaparam, etc. Signed-off-by: Philip Prindeville Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/17359) --- apps/req.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'apps/req.c') diff --git a/apps/req.c b/apps/req.c index eaff69faa4..45de46d393 100644 --- a/apps/req.c +++ b/apps/req.c @@ -62,7 +62,6 @@ static int add_attribute_object(X509_REQ *req, char *text, const char *def, static int add_DN_object(X509_NAME *n, char *text, const char *def, char *value, int nid, int n_min, int n_max, unsigned long chtype, int mval); -static int genpkey_cb(EVP_PKEY_CTX *ctx); static int build_data(char *text, const char *def, char *value, int n_min, int n_max, char *buf, const int buf_size, const char *desc1, const char *desc2); @@ -663,7 +662,7 @@ int req_main(int argc, char **argv) } } - EVP_PKEY_CTX_set_cb(genctx, genpkey_cb); + EVP_PKEY_CTX_set_cb(genctx, progress_cb); EVP_PKEY_CTX_set_app_data(genctx, bio_err); pkey = app_keygen(genctx, keyalgstr, newkey_len, verbose); @@ -1649,21 +1648,3 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr, return gctx; } -static int genpkey_cb(EVP_PKEY_CTX *ctx) -{ - char c = '*'; - BIO *b = EVP_PKEY_CTX_get_app_data(ctx); - int p; - p = EVP_PKEY_CTX_get_keygen_info(ctx, 0); - if (p == 0) - c = '.'; - if (p == 1) - c = '+'; - if (p == 2) - c = '*'; - if (p == 3) - c = '\n'; - BIO_write(b, &c, 1); - (void)BIO_flush(b); - return 1; -} -- cgit v1.2.3