diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-03-05 18:19:12 +0100 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-03-09 02:12:07 +0100 |
commit | 889ad4ef8181093d5c088d5518c7b353ddb48455 (patch) | |
tree | ec7536defb174110348332ccded46b6e4c56dad6 | |
parent | apps/pkcs12: Detect missing PKCS12KDF support on import (diff) | |
download | openssl-889ad4ef8181093d5c088d5518c7b353ddb48455.tar.xz openssl-889ad4ef8181093d5c088d5518c7b353ddb48455.zip |
apps/pkcs12: Allow continuing on absent mac
Just print a warning in that case.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14445)
-rw-r--r-- | apps/pkcs12.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c index c729ab5d67..bd87fd4920 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -756,6 +756,14 @@ int pkcs12_main(int argc, char **argv) */ unsigned char *utmp; int utmplen; + unsigned long err = ERR_peek_error(); + + if (ERR_GET_LIB(err) == ERR_LIB_PKCS12 + && ERR_GET_REASON(err) == PKCS12_R_MAC_ABSENT) { + BIO_printf(bio_err, "Warning: MAC is absent!\n"); + goto dump; + } + utmp = OPENSSL_asc2uni(mpass, -1, NULL, &utmplen); if (utmp == NULL) goto end; @@ -773,6 +781,7 @@ int pkcs12_main(int argc, char **argv) } } + dump: assert(private); if (!dump_certs_keys_p12(out, p12, cpass, -1, options, passout, enc)) { BIO_printf(bio_err, "Error outputting keys and certificates\n"); |