All of lore.kernel.org
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org
Cc: ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org,
	masami.hiramatsu@linaro.org, u-boot@lists.denx.de,
	AKASHI Takahiro <takahiro.akashi@linaro.org>
Subject: [PATCH v5 11/11] (RFC) efi_loader, dts: add public keys for capsules to device tree
Date: Thu, 28 Oct 2021 15:23:56 +0900	[thread overview]
Message-ID: <20211028062356.98224-12-takahiro.akashi@linaro.org> (raw)
In-Reply-To: <20211028062356.98224-1-takahiro.akashi@linaro.org>

By specifying CONFIG_EFI_CAPSULE_KEY_PATH, the build process will
automatically insert the given key into the device tree.
Otherwise, users are required to do so manually, possibly, with
the utility script, fdtsig.sh.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 doc/develop/uefi/uefi.rst |  4 ++++
 dts/Makefile              | 23 +++++++++++++++++++++--
 lib/efi_loader/Kconfig    |  7 +++++++
 3 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst
index 54fefd76f0f5..7f85b9e5a4a6 100644
--- a/doc/develop/uefi/uefi.rst
+++ b/doc/develop/uefi/uefi.rst
@@ -347,6 +347,7 @@ following config, in addition to the configs listed above for capsule
 update::
 
     CONFIG_EFI_CAPSULE_AUTHENTICATE=y
+    CONFIG_EFI_CAPSULE_KEY_PATH=<path to .esl cert>
 
 The public and private keys used for the signing process are generated
 and used by the steps highlighted below.
@@ -392,6 +393,9 @@ and used by the steps highlighted below.
                 };
         };
 
+   If CONFIG_EFI_CAPSULE_KEY_PATH is specified, the build process will
+   take care of it for you.
+
 Executing the boot manager
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
diff --git a/dts/Makefile b/dts/Makefile
index cb3111382959..6c5486719ecd 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -20,11 +20,30 @@ $(obj)/dt-$(SPL_NAME).dtb: dts/dt.dtb $(objtree)/tools/fdtgrep FORCE
 	mkdir -p $(dir $@)
 	$(call if_changed,fdtgrep)
 
+quiet_cmd_fdtsig = FDTSIG $@
+	cmd_fdtsig = \
+		cat $< > $@; \
+		$(srctree)/tools/fdtsig.sh \
+			$(patsubst "%",%,$(CONFIG_EFI_CAPSULE_KEY_PATH)) $@
+
+ifeq ($(CONFIG_EFI_CAPSULE_AUTHENTICATE),y)
+ifneq ($(patsubst "%",%,$(CONFIG_EFI_CAPSULE_KEY_PATH)),)
+DTB_ov := $(obj)/dt.dtb_ov
+
+$(obj)/dt.dtb_ov: $(DTB) FORCE
+	$(call if_changed,fdtsig)
+else
+DTB_ov := $(DTB)
+endif
+else
+DTB_ov := $(DTB)
+endif
+
 ifeq ($(CONFIG_OF_DTB_PROPS_REMOVE),y)
-$(obj)/dt.dtb: $(DTB) $(objtree)/tools/fdtgrep FORCE
+$(obj)/dt.dtb: $(DTB_ov) $(objtree)/tools/fdtgrep FORCE
 	$(call if_changed,fdt_rm_props)
 else
-$(obj)/dt.dtb: $(DTB) FORCE
+$(obj)/dt.dtb: $(DTB_ov) FORCE
 	$(call if_changed,shipped)
 endif
 
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index 52f71c07c991..d12b1e56ae80 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -208,6 +208,13 @@ config EFI_CAPSULE_AUTHENTICATE
 	  Select this option if you want to enable capsule
 	  authentication
 
+config EFI_CAPSULE_KEY_PATH
+	string "Path to .esl cert for capsule authentication"
+	depends on EFI_CAPSULE_AUTHENTICATE
+	help
+	  Provide the EFI signature list (esl) certificate used for capsule
+	  authentication
+
 config EFI_DEVICE_PATH_TO_TEXT
 	bool "Device path to text protocol"
 	default y
-- 
2.33.0


      parent reply	other threads:[~2021-10-28  6:26 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28  6:23 [PATCH v5 00/11] efi_loader: capsule: improve capsule authentication support AKASHI Takahiro
2021-10-28  6:23 ` [PATCH v5 01/11] efi_loader: capsule: drop __weak from efi_get_public_key_data() AKASHI Takahiro
2021-10-29  3:17   ` Simon Glass
2021-10-28  6:23 ` [PATCH v5 02/11] tools: mkeficapsule: add firmwware image signing AKASHI Takahiro
2021-10-29  3:17   ` Simon Glass
2021-10-29  4:56     ` AKASHI Takahiro
2021-11-02 14:56       ` Simon Glass
2021-11-02 15:13         ` Mark Kettenis
2021-11-04  2:51           ` Simon Glass
2021-11-04 14:31             ` Mark Kettenis
2021-11-04 15:11               ` Simon Glass
2021-11-04 16:51                 ` Mark Kettenis
2021-11-05  2:02                   ` Simon Glass
2021-11-05  8:36                     ` Mark Kettenis
2021-11-05  1:04                 ` AKASHI Takahiro
2021-11-05  2:02                   ` Simon Glass
2021-11-05  2:35                     ` AKASHI Takahiro
2021-11-05  9:35                       ` AKASHI Takahiro
2021-11-08  4:55                         ` AKASHI Takahiro
2021-11-15  7:50                           ` AKASHI Takahiro
2021-11-08  8:46               ` AKASHI Takahiro
2021-11-04  2:59         ` AKASHI Takahiro
2021-10-28  6:23 ` [PATCH v5 03/11] tools: mkeficapsule: add man page AKASHI Takahiro
2021-10-29  3:17   ` Simon Glass
2021-10-28  6:23 ` [PATCH v5 04/11] doc: update UEFI document for usage of mkeficapsule AKASHI Takahiro
2021-10-29  3:17   ` Simon Glass
2021-10-29  5:20     ` AKASHI Takahiro
2021-11-02 14:57       ` Simon Glass
2021-11-04  1:49         ` AKASHI Takahiro
2021-11-04 15:11           ` Simon Glass
2021-11-05  3:15             ` AKASHI Takahiro
2021-11-05 16:12               ` Simon Glass
2021-10-28  6:23 ` [PATCH v5 05/11] test/py: efi_capsule: add image authentication test AKASHI Takahiro
2021-10-29  3:17   ` Simon Glass
2021-10-29  5:25     ` AKASHI Takahiro
2021-11-02 14:58       ` Simon Glass
2021-11-04  2:04         ` AKASHI Takahiro
2021-11-04  2:49           ` Simon Glass
2021-11-05  1:21             ` AKASHI Takahiro
2021-11-05  2:02               ` Simon Glass
2021-11-05  3:24                 ` AKASHI Takahiro
2021-11-05 16:12                   ` Simon Glass
2021-11-08  4:15                     ` AKASHI Takahiro
2021-11-08 15:58                       ` Simon Glass
2021-10-28  6:23 ` [PATCH v5 06/11] tools: mkeficapsule: allow for specifying GUID explicitly AKASHI Takahiro
2021-10-28  6:23 ` [PATCH v5 07/11] test/py: efi_capsule: align with the syntax change of mkeficapsule AKASHI Takahiro
2021-10-28  6:23 ` [PATCH v5 08/11] test/py: efi_capsule: add a test for "--guid" option AKASHI Takahiro
2021-10-28  6:23 ` [PATCH v5 09/11] test/py: efi_capsule: check the results in case of CAPSULE_AUTHENTICATE AKASHI Takahiro
2021-10-28  6:23 ` [PATCH v5 10/11] (RFC) tools: add fdtsig.sh AKASHI Takahiro
2021-10-28  6:23 ` AKASHI Takahiro [this message]

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=20211028062356.98224-12-takahiro.akashi@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=ilias.apalodimas@linaro.org \
    --cc=masami.hiramatsu@linaro.org \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.