diff options
author | Matt Caswell <matt@openssl.org> | 2019-01-29 15:04:38 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-01-30 15:36:13 +0000 |
commit | 40b64553f577716cb4898895f5fd4530a6266c75 (patch) | |
tree | 0d048e71dc3bf3857d4254fc48182c74fe3bc8fd /apps/pkcs12.c | |
parent | 522b11e969cbdc82eca369512275f227080a86fa (diff) |
Complain if -twopass is used incorrectly
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)
Diffstat (limited to 'apps/pkcs12.c')
-rw-r--r-- | apps/pkcs12.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c index 94d6661c3f..bf22aeb48d 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; |