From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/5] scripts: allow user to build rsatoc if COMPILE_HOST_TOOLS
Date: Thu, 21 Sep 2023 12:23:07 +0200 [thread overview]
Message-ID: <20230921102310.1108543-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230921102310.1108543-1-a.fatoum@pengutronix.de>
rsatoc is automatically built if CONFIG_CRYPTO_RSA_BUILTIN_KEYS=y.
For testing, it can be useful to build the tool standalone, so add an
option to do just that.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
crypto/Kconfig | 1 +
scripts/Kconfig | 7 +++++++
scripts/Makefile | 2 +-
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/crypto/Kconfig b/crypto/Kconfig
index 04e5ef43705b..4ad7bd844fa1 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -121,6 +121,7 @@ config CRYPTO_RSA
config CRYPTO_RSA_BUILTIN_KEYS
bool
default y if CRYPTO_RSA_KEY != ""
+ select RSATOC
config CRYPTO_RSA_KEY
depends on CRYPTO_RSA
diff --git a/scripts/Kconfig b/scripts/Kconfig
index 26c6a3c19806..9be04fa7c8bf 100644
--- a/scripts/Kconfig
+++ b/scripts/Kconfig
@@ -110,6 +110,13 @@ config QOICONV
help
This enable converting png to qoi images to generate boot logo.
+config RSATOC
+ bool "RSA to C converter" if COMPILE_HOST_TOOLS
+ help
+ This utility converts RSA keys in PEM format to either C or
+ device tree snippets. This requires OpenSSL on the build host
+ and will be selected by the build system if required.
+
endmenu
menu "Target Tools"
diff --git a/scripts/Makefile b/scripts/Makefile
index 75dc5926c057..0a56401fac52 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -11,7 +11,7 @@ hostprogs-always-y += bareboxenv
hostprogs-always-y += bareboxcrc32
hostprogs-always-y += kernel-install
hostprogs-always-$(CONFIG_QOICONV) += qoiconv
-hostprogs-always-$(CONFIG_CRYPTO_RSA_BUILTIN_KEYS) += rsatoc
+hostprogs-always-$(CONFIG_RSATOC) += rsatoc
HOSTCFLAGS_rsatoc.o = `$(PKG_CONFIG) --cflags openssl`
HOSTLDLIBS_rsatoc = `$(PKG_CONFIG) --libs openssl`
hostprogs-always-$(CONFIG_IMD) += bareboximd
--
2.39.2
next prev parent reply other threads:[~2023-09-21 10:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-21 10:23 [PATCH 0/5] rsatoc: make useful for standalone RSA keys Ahmad Fatoum
2023-09-21 10:23 ` [PATCH 1/5] rsa: escape pkcs11 string passed to RSA command Ahmad Fatoum
2023-09-21 10:23 ` Ahmad Fatoum [this message]
2023-09-21 10:23 ` [PATCH 3/5] rsatoc: support extracting RSA public key from X.509 SPKI format Ahmad Fatoum
2023-09-21 10:23 ` [PATCH 4/5] rsa: fix typos and missing type definitions Ahmad Fatoum
2023-09-21 10:23 ` [PATCH 5/5] rsatoc: support generating standalone keys unreferenced by FIT keyring Ahmad Fatoum
2023-09-21 12:32 ` [PATCH 0/5] rsatoc: make useful for standalone RSA keys Sascha Hauer
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=20230921102310.1108543-3-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox