"Das U-Boot" Source Tree

lib: rsa: fix compilation error without openssl

The symbol TOOLS_IMAGE_PRE_LOAD doesn't depend on TOOLS_LIBCRYPTO.
If we choose to build tools without openssl, rsa_verify_openssl()
will attempt to call the unavailable openssl library functions.

Fixes: 942c8c8e6697 ("rsa: Add rsa_verify_openssl() to use openssl for host builds")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>

authored by

Shiji Yang and committed by
Tom Rini
961e260c 31e215fd

+4 -4
+1 -1
include/image.h
··· 1688 1688 */ 1689 1689 int image_pre_load(ulong addr); 1690 1690 1691 - #if defined(USE_HOSTCC) 1691 + #if defined(USE_HOSTCC) && CONFIG_IS_ENABLED(LIBCRYPTO) 1692 1692 /** 1693 1693 * rsa_verify_openssl() - Verify a signature against some data with openssl API 1694 1694 *
+1 -1
lib/rsa/rsa-verify.c
··· 570 570 uint8_t hash[info->crypto->key_len]; 571 571 int ret; 572 572 573 - #ifdef USE_HOSTCC 573 + #if defined(USE_HOSTCC) && CONFIG_IS_ENABLED(LIBCRYPTO) 574 574 if (!info->fdt_blob) 575 575 return rsa_verify_openssl(info, region, region_count, sig, sig_len); 576 576 #endif
+2 -2
tools/image-host.c
··· 19 19 #include <openssl/evp.h> 20 20 #endif 21 21 22 - #if CONFIG_IS_ENABLED(IMAGE_PRE_LOAD) 22 + #if CONFIG_IS_ENABLED(IMAGE_PRE_LOAD) && CONFIG_IS_ENABLED(LIBCRYPTO) 23 23 #include <openssl/rsa.h> 24 24 #include <openssl/err.h> 25 25 #endif ··· 1416 1416 } 1417 1417 #endif 1418 1418 1419 - #if CONFIG_IS_ENABLED(IMAGE_PRE_LOAD) 1419 + #if CONFIG_IS_ENABLED(IMAGE_PRE_LOAD) && CONFIG_IS_ENABLED(LIBCRYPTO) 1420 1420 /** 1421 1421 * rsa_verify_openssl() - Verify a signature against some data with openssl API 1422 1422 *