e_loader_attic.c: Improve result handling of file_load_try_decode()

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/4930)
This commit is contained in:
Dr. David von Oheimb 2020-06-06 13:59:25 +02:00
parent 61dd4168f5
commit 09afbec94b

View File

@ -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;
}