#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,
if (argc == 1) {
if (!opt_int(argv[0], &num) || num <= 0)
goto opthelp;
- } else if (argc != 0) {
+ } else if (!opt_check_rest_arg(NULL)) {
goto opthelp;
}
if (!app_RAND_load())
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",
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;
-}