From: Javier Tia <javier.tia@linaro.org>
To: meta-arm@lists.yoctoproject.org
Cc: Mikko Rapeli <mikko.rapeli@linaro.org>,
Ross Burton <Ross.Burton@arm.com>, Jon Mason <jon.mason@arm.com>,
Javier Tia <javier.tia@linaro.org>
Subject: [PATCH v3 03/13] layer.conf: Introduce UEFI_SB_KEYS_DIR
Date: Wed, 21 Aug 2024 19:43:25 -0600 [thread overview]
Message-ID: <20240822014335.3394568-4-javier.tia@linaro.org> (raw)
In-Reply-To: <20240822014335.3394568-1-javier.tia@linaro.org>
UEFI_SB_KEYS_DIR saves UEFI keys path.
To avoid security issues, UEFI keys are not provided and they can be
generated by gen_uefi_keys.sh script.
Signed-off-by: Javier Tia <javier.tia@linaro.org>
---
meta-arm/conf/layer.conf | 2 ++
meta-arm/uefi-sb-keys/gen_uefi_keys.sh | 35 ++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
create mode 100755 meta-arm/uefi-sb-keys/gen_uefi_keys.sh
diff --git a/meta-arm/conf/layer.conf b/meta-arm/conf/layer.conf
index 9e9c9dbd..2854dd69 100644
--- a/meta-arm/conf/layer.conf
+++ b/meta-arm/conf/layer.conf
@@ -21,3 +21,5 @@ HOSTTOOLS_NONFATAL += "telnet"
addpylib ${LAYERDIR}/lib oeqa
WARN_QA:append:layer-meta-arm = " patch-status"
+
+UEFI_SB_KEYS_DIR ??= "${LAYERDIR}/uefi-sb-keys"
\ No newline at end of file
diff --git a/meta-arm/uefi-sb-keys/gen_uefi_keys.sh b/meta-arm/uefi-sb-keys/gen_uefi_keys.sh
new file mode 100755
index 00000000..fc7f25c9
--- /dev/null
+++ b/meta-arm/uefi-sb-keys/gen_uefi_keys.sh
@@ -0,0 +1,35 @@
+#/bin/sh
+
+set -eux
+
+#Create PK
+openssl req -x509 -sha256 -newkey rsa:2048 -subj /CN=Linaro_LEDGE/ -keyout PK.key -out PK.crt -nodes -days 3650
+cert-to-efi-sig-list -g 11111111-2222-3333-4444-123456789abc PK.crt PK.esl
+sign-efi-sig-list -c PK.crt -k PK.key PK PK.esl PK.auth
+
+#Create KEK
+openssl req -x509 -sha256 -newkey rsa:2048 -subj /CN=Linaro_LEDGE/ -keyout KEK.key -out KEK.crt -nodes -days 3650
+cert-to-efi-sig-list -g 11111111-2222-3333-4444-123456789abc KEK.crt KEK.esl
+sign-efi-sig-list -c PK.crt -k PK.key KEK KEK.esl KEK.auth
+
+#Create DB
+openssl req -x509 -sha256 -newkey rsa:2048 -subj /CN=Linaro_LEDGE/ -keyout db.key -out db.crt -nodes -days 3650
+cert-to-efi-sig-list -g 11111111-2222-3333-4444-123456789abc db.crt db.esl
+sign-efi-sig-list -c KEK.crt -k KEK.key db db.esl db.auth
+
+#Create DBX
+openssl req -x509 -sha256 -newkey rsa:2048 -subj /CN=Linaro_LEDGE/ -keyout dbx.key -out dbx.crt -nodes -days 3650
+cert-to-efi-sig-list -g 11111111-2222-3333-4444-123456789abc dbx.crt dbx.esl
+sign-efi-sig-list -c KEK.crt -k KEK.key dbx dbx.esl dbx.auth
+
+#Sign image
+#sbsign --key db.key --cert db.crt Image
+
+#Digest image
+#hash-to-efi-sig-list Image db_Image.hash
+#sign-efi-sig-list -c KEK.crt -k KEK.key db db_Image.hash db_Image.auth
+
+#Empty cert for testing
+touch noPK.esl
+sign-efi-sig-list -c PK.crt -k PK.key PK noPK.esl noPK.auth
+
--
2.46.0
next prev parent reply other threads:[~2024-08-22 1:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 1:43 [PATCH v3 00/13] qemuarm64-secureboot: Add UEFI Secure Boot Javier Tia
2024-08-22 1:43 ` [PATCH v3 01/13] qemuarm64-secureboot: Introduce uefi-secureboot machine feature Javier Tia
2024-08-22 1:43 ` [PATCH v3 02/13] core-image-base: Use UEFI layout disk partitions Javier Tia
2024-08-23 10:26 ` Mikko Rapeli
2024-08-22 1:43 ` Javier Tia [this message]
2024-08-22 1:43 ` [PATCH v3 04/13] uefi-sb-keys.bbclass: Add class to validate UEFI keys Javier Tia
2024-08-22 1:43 ` [PATCH v3 05/13] sbsign.bbclass: Add class to sign binaries Javier Tia
2024-08-22 1:43 ` [PATCH v3 06/13] core-image-base: Inherit uefi-sb-keys Javier Tia
2024-08-22 1:43 ` [PATCH v3 07/13] meta-arm: Introduce gen-uefi-sb-keys.bb recipe Javier Tia
2024-08-22 1:43 ` [PATCH v3 08/13] u-boot: Setup UEFI and Secure Boot Javier Tia
2024-08-22 1:43 ` [PATCH v3 09/13] qemuarm64-secureboot: Add meta-secure-core layer as dependency Javier Tia
2024-08-22 1:43 ` [PATCH v3 10/13] linux-yocto: Setup UEFI and sign kernel image Javier Tia
2024-08-22 1:43 ` [PATCH v3 11/13] systemd: Add UEFI support Javier Tia
2024-08-22 1:43 ` [PATCH v3 12/13] systemd-boot: Use it as bootloader & sign UEFI image Javier Tia
2024-08-22 1:43 ` [PATCH v3 13/13] meta-arm: Add UEFI Secure Boot test Javier Tia
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=20240822014335.3394568-4-javier.tia@linaro.org \
--to=javier.tia@linaro.org \
--cc=Ross.Burton@arm.com \
--cc=jon.mason@arm.com \
--cc=meta-arm@lists.yoctoproject.org \
--cc=mikko.rapeli@linaro.org \
/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.