]> git.ipfire.org Git - thirdparty/openssl.git/commit
OSSL_STORE and PKCS#12: Check if there is a MAC to verify before prompting
authorRichard Levitte <levitte@openssl.org>
Tue, 13 Jun 2023 18:06:04 +0000 (20:06 +0200)
committerPauli <pauli@openssl.org>
Sun, 25 Jun 2023 22:01:36 +0000 (08:01 +1000)
commit56925daf6e476cb2ffef9b87ae9b53c5d2af9665
tree69fb1c323a459b8e69e9a4e4800efa6f6157b022
parent50af7294e514a2aba19c5248a4ed612ba3ba4c1b
OSSL_STORE and PKCS#12: Check if there is a MAC to verify before prompting

When a DER object with unknown contents comes all the way to
ossl_store_handle_load_result(), and it attempts to decode them as different
objects, the PKCS#12 decoding attempt would (almost) always prompt for a
passphrase, even if there isn't a MAC to verify it against in the PKCS#12
object.

This change checks if there is a MAC to verify against before attempting to
prompt for a passphrase, leading to less surprising behavior.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21197)

(cherry picked from commit 7a520619c997146639f42ce8595162ac34c2ad41)
crypto/store/store_result.c