diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-11-26 08:35:26 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-03-04 08:54:09 +0100 |
commit | 39a61e69b88252dca8aa7d61146b0b2397d1710c (patch) | |
tree | 7e5137a219778990498fd3c1aa20610ce82c9e07 /crypto/pkcs12 | |
parent | crypto: rename error flags in internal structures (diff) | |
download | openssl-39a61e69b88252dca8aa7d61146b0b2397d1710c.tar.xz openssl-39a61e69b88252dca8aa7d61146b0b2397d1710c.zip |
OSSL_STORE: restore diagnostics on decrypt error; provide password hints
Fixes #13493
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13525)
Diffstat (limited to 'crypto/pkcs12')
-rw-r--r-- | crypto/pkcs12/p12_decr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/pkcs12/p12_decr.c b/crypto/pkcs12/p12_decr.c index 3571ac571a..0f1c00aaca 100644 --- a/crypto/pkcs12/p12_decr.c +++ b/crypto/pkcs12/p12_decr.c @@ -81,7 +81,9 @@ unsigned char *PKCS12_pbe_crypt(const X509_ALGOR *algor, if (!EVP_CipherFinal_ex(ctx, out + i, &i)) { OPENSSL_free(out); out = NULL; - ERR_raise(ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR); + ERR_raise_data(ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR, + passlen == 0 ? "empty password" + : "maybe wrong password"); goto err; } outlen += i; |