common: image_sign_info helper functions in SPL
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 15 Apr 2020 16:46:21 +0000 (18:46 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 24 Apr 2020 14:51:32 +0000 (10:51 -0400)
Do not build image_sign_info helper functions in SPL if not needed.

Fixes: b983cc2da0ba ("lib: rsa: decouple rsa from FIT image verification")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Kconfig
common/Kconfig
common/Makefile

diff --git a/Kconfig b/Kconfig
index 8bae87e3f67ed0272a685fae4fb0ecf1179a9091..83b5b053923ef194d1c1e6e6724c23e403a7a12a 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -447,7 +447,7 @@ config SPL_FIT_SIGNATURE
        select SPL_FIT
        select SPL_RSA
        select SPL_RSA_VERIFY
-       select IMAGE_SIGN_INFO
+       select SPL_IMAGE_SIGN_INFO
 
 config SPL_LOAD_FIT
        bool "Enable SPL loading U-Boot as a FIT (basic fitImage features)"
index ee4f748c32b8bf0136e3f90669915e93d217b1e1..30cba15948b431376ba559006f0ef8bfbc05facc 100644 (file)
@@ -1060,3 +1060,14 @@ config IMAGE_SIGN_INFO
        select SHA256
        help
          Enable image_sign_info helper functions.
+
+if IMAGE_SIGN_INFO
+
+config SPL_IMAGE_SIGN_INFO
+       bool
+       select SHA1
+       select SHA256
+       help
+         Enable image_sign_info helper functions in SPL.
+
+endif
index d84e10ba99d78df994bc31673070aeda8446de09..3471c47be5b9c57faab995abbfd0e273a8d595a6 100644 (file)
@@ -112,7 +112,7 @@ obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o image-android-dt.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += image-fdt.o
 obj-$(CONFIG_$(SPL_TPL_)FIT) += image-fit.o
 obj-$(CONFIG_$(SPL_)MULTI_DTB_FIT) += boot_fit.o common_fit.o
-obj-$(CONFIG_IMAGE_SIGN_INFO) += image-sig.o
+obj-$(CONFIG_$(SPL_TPL_)IMAGE_SIGN_INFO) += image-sig.o
 obj-$(CONFIG_$(SPL_TPL_)FIT_SIGNATURE) += image-fit-sig.o
 obj-$(CONFIG_$(SPL_TPL_)FIT_CIPHER) += image-cipher.o
 obj-$(CONFIG_IO_TRACE) += iotrace.o