U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takahiro Akashi <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [PATCH v6 1/3] lib: fix build error for secure boot and capsule authentication
Date: Thu, 13 May 2021 16:52:21 +0900	[thread overview]
Message-ID: <20210513075221.GL16848@laputa> (raw)
In-Reply-To: <20210513071831.9969-2-masahisa.kojima@linaro.org>

On Thu, May 13, 2021 at 04:18:29PM +0900, Masahisa Kojima wrote:
> Build error occurs when CONFIG_EFI_SECURE_BOOT or
> CONFIG_EFI_CAPSULE_AUTHENTICATE is enabled,
> because hash-checksum.c is not compiled.
> 
> This commit adds hash-checksum.c as a compilation target
> if CONFIG_EFI_SECURE_BOOT or CONFIG_EFI_CAPSULE_AUTHENTICATE
> is enabled.
> 
> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> ---
> 
> Changes in v6:
> - update lib/Makefile to compile hash-checksum.c, instead of
>   selecting FIT_SIGNATURE in secure boot and capsule authentication.
> 
> Changes in v5:
> - Missing option for EFI_TCG2_PROTOROL already added in different commit.
>   This commit adds FIT_SIGNATURE only.
> 
> Changes in v4:
> - newly added in this patch series, due to rebasing
>   the base code.
> 
>  lib/Makefile | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/Makefile b/lib/Makefile
> index 6825671955..bd022dd5d3 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -61,7 +61,10 @@ endif
>  obj-$(CONFIG_$(SPL_)ACPIGEN) += acpi/
>  obj-$(CONFIG_$(SPL_)MD5) += md5.o
>  obj-$(CONFIG_$(SPL_)RSA) += rsa/
> -obj-$(CONFIG_FIT_SIGNATURE) += hash-checksum.o
> +ifneq (,$(filter y,$(CONFIG_FIT_SIGNATURE)$(CONFIG_EFI_SECURE_BOOT)\
> +$(CONFIG_EFI_CAPSULE_AUTHENTICATE)))
> +obj-y += hash-checksum.o
> +endif

Why not create a new kconfig option here?
There is a good reason to do so if there are more than one users.

Otherwise, every new user of hash_calculate() needs
to modify generic Makefile.


-Takahiro Akashi


>  obj-$(CONFIG_SHA1) += sha1.o
>  obj-$(CONFIG_SHA256) += sha256.o
>  obj-$(CONFIG_SHA512_ALGO) += sha512.o
> -- 
> 2.17.1
> 

  reply	other threads:[~2021-05-13  7:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13  7:18 [PATCH v6 0/3] PE/COFF measurement support Masahisa Kojima
2021-05-13  7:18 ` [PATCH v6 1/3] lib: fix build error for secure boot and capsule authentication Masahisa Kojima
2021-05-13  7:52   ` Takahiro Akashi [this message]
2021-05-13 13:51     ` Masahisa Kojima
2021-05-13  7:18 ` [PATCH v6 2/3] efi_loader: expose efi_image_parse() even if UEFI Secure Boot is disabled Masahisa Kojima
2021-05-13  7:18 ` [PATCH v6 3/3] efi_loader: add PE/COFF image measurement Masahisa Kojima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210513075221.GL16848@laputa \
    --to=takahiro.akashi@linaro.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox