summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@google.com>2022-12-16 17:28:48 -0500
committerPeter Jones <pjones@redhat.com>2023-05-02 14:08:17 -0400
commit102a658e176b9e0779ba67618ef72eb69021e00a (patch)
treea5d7a3090dc84c3032bebb3abffe19c86f45ecf9
parent1f38cb30a5e1dcea97b8d48915515b866ec13c32 (diff)
downloadefi-boot-shim-102a658e176b9e0779ba67618ef72eb69021e00a.tar.gz
efi-boot-shim-102a658e176b9e0779ba67618ef72eb69021e00a.zip
Drop invalid calls to `CRYPTO_set_mem_functions`
These calls did not check the return value. If they had, it would have shown that the calls were failing due to passing `NULL` for the `realloc` function pointer. That causes an early return, so the calls weren't actually doing anything. The `malloc`/`realloc`/`free` functions defined in Cryptlib/SysCall/BaseMemAllocation.c are what actually get used, so just drop the explicit call to `CRYPTO_set_mem_functions`. Signed-off-by: Nicholas Bishop <nicholasbishop@google.com>
-rw-r--r--shim.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/shim.c b/shim.c
index e54f6345..b3a4fe6b 100644
--- a/shim.c
+++ b/shim.c
@@ -1275,24 +1275,10 @@ EFI_STATUS set_second_stage (EFI_HANDLE image_handle)
return EFI_SUCCESS;
}
-static void *
-ossl_malloc(size_t num)
-{
- return AllocatePool(num);
-}
-
-static void
-ossl_free(void *addr)
-{
- FreePool(addr);
-}
-
static void
init_openssl(void)
{
- CRYPTO_set_mem_functions(ossl_malloc, NULL, ossl_free);
OPENSSL_init();
- CRYPTO_set_mem_functions(ossl_malloc, NULL, ossl_free);
ERR_load_ERR_strings();
ERR_load_BN_strings();
ERR_load_RSA_strings();