diff --git a/apps/pkcs12.c b/apps/pkcs12.c index c8fc452ec6d2e7baa5ac595e62d63c7902971e48..f10f8dabdb9d3a691e07555ebdda8487e9b2505f 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -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; diff --git a/doc/man1/pkcs12.pod b/doc/man1/pkcs12.pod index 3389e595fed7567cc8a3c836f9ca597acfd80a8e..f4c4c41b27c073ed84e673a92a9e810d9dedfbbd 100644 --- a/doc/man1/pkcs12.pod +++ b/doc/man1/pkcs12.pod @@ -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