From: Dr. David von Oheimb Date: Sat, 6 Jun 2020 11:59:25 +0000 (+0200) Subject: e_loader_attic.c: Improve result handling of file_load_try_decode() X-Git-Tag: openssl-3.0.0-alpha9~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09afbec94bacac7be9fbeab8fa0a9dfd5cb19b1d;p=thirdparty%2Fopenssl.git e_loader_attic.c: Improve result handling of file_load_try_decode() Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/4930) --- diff --git a/engines/e_loader_attic.c b/engines/e_loader_attic.c index 8a9b86483f4..936faa98b35 100644 --- a/engines/e_loader_attic.c +++ b/engines/e_loader_attic.c @@ -1233,10 +1233,13 @@ static OSSL_STORE_INFO *file_load_try_decode(OSSL_STORE_LOADER_CTX *ctx, } if (result == NULL) result = tmp_result; + if (result == NULL) /* e.g., PKCS#12 file decryption error */ + break; } } - if (*matchcount == 1 && matching_handlers[0]->repeatable) { + if (result != NULL + && *matchcount == 1 && matching_handlers[0]->repeatable) { ctx->_.file.last_handler = matching_handlers[0]; ctx->_.file.last_handler_ctx = handler_ctx; }