summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-06-08 12:22:31 +0200
committerRichard Levitte <levitte@openssl.org>2021-06-10 08:34:09 +0200
commit5ac6d7d21b4e896fee2eca0488915faaea196448 (patch)
tree11fb9bb7d01eeb555e529a39fa2e30ebc840ff55 /apps
parentb6298a7f8de45b287bfbad5de282fbceb68abb02 (diff)
APPS: Restore the possibility to combine -pubout with -text
This applies to the 'openssl pkey' command. Fixes #15645 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15658)
Diffstat (limited to 'apps')
-rw-r--r--apps/pkey.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/pkey.c b/apps/pkey.c
index 781f376837..fb3899b08e 100644
--- a/apps/pkey.c
+++ b/apps/pkey.c
@@ -175,15 +175,19 @@ int pkey_main(int argc, char **argv)
if (argc != 0)
goto opthelp;
- if (noout && pubout)
- BIO_printf(bio_err,
- "Warning: The -pubout option is ignored with -noout\n");
if (text && text_pub)
BIO_printf(bio_err,
"Warning: The -text option is ignored with -text_pub\n");
if (traditional && (noout || outformat != FORMAT_PEM))
BIO_printf(bio_err,
"Warning: The -traditional is ignored since there is no PEM output\n");
+
+ /* -pubout and -text is the same as -text_pub */
+ if (!text_pub && pubout && text) {
+ text = 0;
+ text_pub = 1;
+ }
+
private = (!noout && !pubout) || (text && !text_pub);
if (ciphername != NULL) {