X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=apps%2Fpkeyparam.c;h=215611eb347d2a4243d7fd389cd208bc4070a65c;hp=5a5caf56bda8c58e6f4ca39334d84f4e9a6b9bc6;hb=56c1ef05014239f4bfa377946a30fe38c95d25fd;hpb=7e1b7485706c2b11091b5fa897fe496a2faa56cc diff --git a/apps/pkeyparam.c b/apps/pkeyparam.c index 5a5caf56bd..215611eb34 100644 --- a/apps/pkeyparam.c +++ b/apps/pkeyparam.c @@ -85,7 +85,7 @@ int pkeyparam_main(int argc, char **argv) EVP_PKEY *pkey = NULL; int text = 0, noout = 0, ret = 1; OPTION_CHOICE o; - char *infile = NULL, *outfile = NULL, *prog, *engine = NULL; + char *infile = NULL, *outfile = NULL, *prog; prog = opt_init(argc, argv, pkeyparam_options); while ((o = opt_next()) != OPT_EOF) { @@ -105,7 +105,7 @@ int pkeyparam_main(int argc, char **argv) outfile = opt_arg(); break; case OPT_ENGINE: - engine = opt_arg(); + (void)setup_engine(opt_arg(), 0); break; case OPT_TEXT: text = 1; @@ -118,14 +118,13 @@ int pkeyparam_main(int argc, char **argv) argc = opt_num_rest(); argv = opt_rest(); -#ifndef OPENSSL_NO_ENGINE - setup_engine(engine, 0); -#endif + if (!app_load_modules(NULL)) + goto end; - in = bio_open_default(infile, "r"); + in = bio_open_default(infile, 'r', FORMAT_PEM); if (in == NULL) goto end; - out = bio_open_default(outfile, "w"); + out = bio_open_default(outfile, 'w', FORMAT_PEM); if (out == NULL) goto end; pkey = PEM_read_bio_Parameters(in, NULL);