aboutsummaryrefslogtreecommitdiff
path: root/apps/pkeyparam.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/pkeyparam.c')
-rw-r--r--apps/pkeyparam.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/pkeyparam.c b/apps/pkeyparam.c
index b02882ccc296..fd8de0e02fe9 100644
--- a/apps/pkeyparam.c
+++ b/apps/pkeyparam.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -91,16 +91,12 @@ int pkeyparam_main(int argc, char **argv)
}
/* No extra arguments. */
- argc = opt_num_rest();
- if (argc != 0)
+ if (!opt_check_rest_arg(NULL))
goto opthelp;
in = bio_open_default(infile, 'r', FORMAT_PEM);
if (in == NULL)
goto end;
- out = bio_open_default(outfile, 'w', FORMAT_PEM);
- if (out == NULL)
- goto end;
pkey = PEM_read_bio_Parameters_ex(in, NULL, app_get0_libctx(),
app_get0_propq());
if (pkey == NULL) {
@@ -108,6 +104,9 @@ int pkeyparam_main(int argc, char **argv)
ERR_print_errors(bio_err);
goto end;
}
+ out = bio_open_default(outfile, 'w', FORMAT_PEM);
+ if (out == NULL)
+ goto end;
if (check) {
if (e == NULL)