]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lib: introduce HASH_CALCULATE option
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Thu, 13 May 2021 14:48:08 +0000 (23:48 +0900)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 18 May 2021 10:36:13 +0000 (12:36 +0200)
Build error occurs when CONFIG_EFI_SECURE_BOOT or
CONFIG_EFI_CAPSULE_AUTHENTICATE is enabled,
because hash-checksum.c is not compiled.

Since hash_calculate() implemented in hash-checksum.c can be
commonly used aside from FIT image signature verification,
this commit itroduces HASH_CALCULATE option to decide
if hash-checksum.c shall be compiled.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
common/Kconfig.boot
lib/Kconfig
lib/Makefile
lib/efi_loader/Kconfig

index 5a18d62d78007db39cbb96de442ec16b61f6d3b0..56608226cc684e08e126f42a7ac75019ec2ed8fa 100644 (file)
@@ -80,6 +80,7 @@ config FIT_SIGNATURE
        select RSA_VERIFY
        select IMAGE_SIGN_INFO
        select FIT_FULL_CHECK
+       select HASH_CALCULATE
        help
          This option enables signature verification of FIT uImages,
          using a hash signed and verified using RSA. If
index 1c19a332bec1f8a17ce76c2b8bd5b0885cffa67b..b057b9d73bc208a86dad6eb68bb5096716dba79f 100644 (file)
@@ -439,6 +439,9 @@ config CRC32C
 config XXHASH
        bool
 
+config HASH_CALCULATE
+       bool
+
 endmenu
 
 menu "Compression Support"
index 682567195554123574d6f24a63b48a98cf535dd2..0835ea292cd359d307a92292a4638e8448e2d29a 100644 (file)
@@ -61,7 +61,7 @@ endif
 obj-$(CONFIG_$(SPL_)ACPIGEN) += acpi/
 obj-$(CONFIG_$(SPL_)MD5) += md5.o
 obj-$(CONFIG_$(SPL_)RSA) += rsa/
-obj-$(CONFIG_FIT_SIGNATURE) += hash-checksum.o
+obj-$(CONFIG_HASH_CALCULATE) += hash-checksum.o
 obj-$(CONFIG_SHA1) += sha1.o
 obj-$(CONFIG_SHA256) += sha256.o
 obj-$(CONFIG_SHA512_ALGO) += sha512.o
index c259abe03338f336f62b1cfd387e8743d055f890..eb5c4d6f294436daa13befb79efb600946786980 100644 (file)
@@ -174,6 +174,7 @@ config EFI_CAPSULE_AUTHENTICATE
        select PKCS7_MESSAGE_PARSER
        select PKCS7_VERIFY
        select IMAGE_SIGN_INFO
+       select HASH_CALCULATE
        default n
        help
          Select this option if you want to enable capsule
@@ -342,6 +343,7 @@ config EFI_SECURE_BOOT
        select X509_CERTIFICATE_PARSER
        select PKCS7_MESSAGE_PARSER
        select PKCS7_VERIFY
+       select HASH_CALCULATE
        default n
        help
          Select this option to enable EFI secure boot support.