summaryrefslogtreecommitdiffstats
path: root/crypto/store
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-11-26 08:35:26 +0100
committerDr. David von Oheimb <dev@ddvo.net>2021-03-04 08:54:09 +0100
commit39a61e69b88252dca8aa7d61146b0b2397d1710c (patch)
tree7e5137a219778990498fd3c1aa20610ce82c9e07 /crypto/store
parente3a2ba75474eebffe14b4bab1a34a1c2012a3888 (diff)
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/store')
-rw-r--r--crypto/store/store_result.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/store/store_result.c b/crypto/store/store_result.c
index 64b0e814b3..d41d7d9b94 100644
--- a/crypto/store/store_result.c
+++ b/crypto/store/store_result.c
@@ -564,8 +564,10 @@ static int try_pkcs12(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,
}
pass = tpass;
if (!PKCS12_verify_mac(p12, pass, strlen(pass))) {
- ERR_raise(ERR_LIB_OSSL_STORE,
- OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC);
+ ERR_raise_data(ERR_LIB_OSSL_STORE,
+ OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC,
+ strlen(pass) == 0 ? "empty password" :
+ "maybe wrong password");
goto p12_end;
}
}