]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Complain if -twopass is used incorrectly
authorMatt Caswell <matt@openssl.org>
Tue, 29 Jan 2019 15:04:38 +0000 (15:04 +0000)
committerMatt Caswell <matt@openssl.org>
Wed, 30 Jan 2019 15:36:13 +0000 (15:36 +0000)
The option -twopass to the pkcs12 app is ignored if -passin, -passout
or -password is used. We should complain if an attempt is made to use
it in combination with those options.

Fixes #8107

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8114)

apps/pkcs12.c
doc/man1/pkcs12.pod

index 94d6661c3f27bc63bd4bfeaa4cdff05aaaf098ea..bf22aeb48dd2d23757d457826ee214d783ee0a2b 100644 (file)
@@ -311,6 +311,13 @@ int pkcs12_main(int argc, char **argv)
     if (cpass != NULL) {
         mpass = cpass;
         noprompt = 1;
+        if (twopass) {
+            if (export_cert)
+                BIO_printf(bio_err, "Option -twopass cannot be used with -passout or -password\n");
+            else
+                BIO_printf(bio_err, "Option -twopass cannot be used with -passin or -password\n");
+            goto end;
+        }
     } else {
         cpass = pass;
         mpass = macpass;
index 67adaa1e153686862b932a70eb59e9e1f7159892..b1b688449e9a847df665f8d07f605f6305fa01cd 100644 (file)
@@ -154,7 +154,8 @@ Don't attempt to verify the integrity MAC before reading the file.
 
 Prompt for separate integrity and encryption passwords: most software
 always assumes these are the same so this option will render such
-PKCS#12 files unreadable.
+PKCS#12 files unreadable. Cannot be used in combination with the options
+-password, -passin (if importing) or -passout (if exporting).
 
 =back