From 39a61e69b88252dca8aa7d61146b0b2397d1710c Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Thu, 26 Nov 2020 08:35:26 +0100 Subject: OSSL_STORE: restore diagnostics on decrypt error; provide password hints Fixes #13493 Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/13525) --- crypto/store/store_result.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crypto/store') 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; } } -- cgit v1.2.3