{"C", OPT_C, '-', "Print C code"},
{"2", OPT_2, '-', "Generate parameters using 2 as the generator value"},
{"5", OPT_5, '-', "Generate parameters using 5 as the generator value"},
-# ifndef OPENSSL_NO_ENGINE
- {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"},
-# endif
# ifndef OPENSSL_NO_DSA
{"dsaparam", OPT_DSAPARAM, '-',
"Read or generate DSA parameters, convert to DH"},
+# endif
+# ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"},
# endif
{NULL}
};
argc = opt_num_rest();
argv = opt_rest();
- if (!app_load_modules(NULL))
- goto end;
-
if (argv[0] && (!opt_int(argv[0], &num) || num <= 0))
goto end;
BN_GENCB *cb;
cb = BN_GENCB_new();
- if (!cb) {
+ if (cb == NULL) {
ERR_print_errors(bio_err);
goto end;
}
BIO_printf(bio_err,
"Generating DSA parameters, %d bit long prime\n", num);
- if (!dsa
+ if (dsa == NULL
|| !DSA_generate_parameters_ex(dsa, num, NULL, 0, NULL, NULL,
cb)) {
DSA_free(dsa);
"Generating DH parameters, %d bit long safe prime, generator %d\n",
num, g);
BIO_printf(bio_err, "This is going to take a long time\n");
- if (!dh || !DH_generate_parameters_ex(dh, num, g, cb)) {
+ if (dh == NULL || !DH_generate_parameters_ex(dh, num, g, cb)) {
BN_GENCB_free(cb);
ERR_print_errors(bio_err);
goto end;
app_RAND_write_file(NULL);
} else {
- in = bio_open_default(infile, RB(informat));
+ in = bio_open_default(infile, 'r', informat);
if (in == NULL)
goto end;
/* dh != NULL */
}
- out = bio_open_default(outfile, "w");
+ out = bio_open_default(outfile, 'w', outformat);
if (out == NULL)
goto end;