mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH v2 11/19] rsatoc: rename to keytoc
Date: Mon, 5 Aug 2024 12:05:35 +0200	[thread overview]
Message-ID: <68396aa4-8a0d-48ce-9829-9dbb2f60c467@pengutronix.de> (raw)
In-Reply-To: <20240801055737.3190132-12-s.hauer@pengutronix.de>

Hello Sascha,

On 01.08.24 07:57, Sascha Hauer wrote:
> The rsatoc tool will be extended to also handle ecdsa keys, so change
> 'rsa' to a more generic name 'key'.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---
>  crypto/Kconfig                 |  2 +-
>  crypto/Makefile                |  2 +-
>  scripts/.gitignore             |  2 +-
>  scripts/Kconfig                |  4 ++--
>  scripts/Makefile               |  6 +++---
>  scripts/Makefile.lib           | 12 ++++++------
>  scripts/{rsatoc.c => keytoc.c} |  4 ++--
>  test/self/Makefile             |  2 +-
>  8 files changed, 17 insertions(+), 17 deletions(-)
>  rename scripts/{rsatoc.c => keytoc.c} (99%)
> 
> diff --git a/crypto/Kconfig b/crypto/Kconfig
> index d1360a2101..78b499f646 100644
> --- a/crypto/Kconfig
> +++ b/crypto/Kconfig
> @@ -121,7 +121,7 @@ config CRYPTO_RSA
>  config CRYPTO_RSA_BUILTIN_KEYS
>  	bool
>  	default y if CRYPTO_RSA_KEY != ""
> -	select RSATOC
> +	select KEYTOC
>  
>  config CRYPTO_RSA_KEY
>  	depends on CRYPTO_RSA
> diff --git a/crypto/Makefile b/crypto/Makefile
> index cf041dd6b3..e84360a8c7 100644
> --- a/crypto/Makefile
> +++ b/crypto/Makefile
> @@ -34,5 +34,5 @@ RSA_DEP := $(CONFIG_CRYPTO_RSA_KEY)
>  endif
>  
>  $(obj)/rsa-keys.h: $(RSA_DEP) FORCE
> -	$(call cmd,rsa_keys,$(CONFIG_CRYPTO_RSA_KEY_NAME_HINT):$(if $(RSA_DEP),$<,$(CONFIG_CRYPTO_RSA_KEY)))
> +	$(call cmd,public_keys,$(CONFIG_CRYPTO_RSA_KEY_NAME_HINT):$(if $(RSA_DEP),$<,$(CONFIG_CRYPTO_RSA_KEY)))
>  endif
> diff --git a/scripts/.gitignore b/scripts/.gitignore
> index 8c653d184f..6ee81e8998 100644
> --- a/scripts/.gitignore
> +++ b/scripts/.gitignore
> @@ -33,7 +33,7 @@ rk-usb-loader
>  rk-usb-loader-target
>  rkimage
>  mips-relocs
> -rsatoc
> +keytoc
>  stm32image
>  mvebuimg
>  prelink-riscv
> diff --git a/scripts/Kconfig b/scripts/Kconfig
> index 4034f020d0..62bf0298ec 100644
> --- a/scripts/Kconfig
> +++ b/scripts/Kconfig
> @@ -110,10 +110,10 @@ config QOICONV
>  	help
>  	  This enable converting png to qoi images to generate boot logo.
>  
> -config RSATOC
> +config KEYTOC
>  	bool "RSA to C converter" if COMPILE_HOST_TOOLS
>  	help
> -	  This utility converts RSA keys in PEM format to either C or
> +	  This utility converts public 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.
>  
> diff --git a/scripts/Makefile b/scripts/Makefile
> index 20da6fc5e7..a780f05bd9 100644
> --- a/scripts/Makefile
> +++ b/scripts/Makefile
> @@ -10,9 +10,9 @@ hostprogs-always-y					+= bareboxenv
>  hostprogs-always-y					+= bareboxcrc32
>  hostprogs-always-y					+= kernel-install
>  hostprogs-always-$(CONFIG_QOICONV)			+= qoiconv
> -hostprogs-always-$(CONFIG_RSATOC)			+= rsatoc
> -HOSTCFLAGS_rsatoc.o = `$(PKG_CONFIG) --cflags openssl`
> -HOSTLDLIBS_rsatoc = `$(PKG_CONFIG) --libs openssl`
> +hostprogs-always-$(CONFIG_KEYTOC)			+= keytoc
> +HOSTCFLAGS_keytoc.o = `$(PKG_CONFIG) --cflags openssl`
> +HOSTLDLIBS_keytoc = `$(PKG_CONFIG) --libs openssl`
>  hostprogs-always-$(CONFIG_IMD)				+= bareboximd
>  hostprogs-always-$(CONFIG_KALLSYMS)			+= kallsyms
>  hostprogs-always-$(CONFIG_MIPS)				+= mips-relocs
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 6b1f0ccbc0..1881e3c139 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -604,17 +604,17 @@ quiet_cmd_stm32_image = STM32-IMG $@
>  quiet_cmd_b64dec = B64DEC  $@
>        cmd_b64dec = base64 -d $< > $@
>  
> -# rsa_keys
> +# public_keys
>  # ---------------------------------------------------------------------------
>  # Build a header file containing a rsa public key.
>  #
>  # The keys can change without the build system noticing, so we always
> -# have to call rsatoc. To avoid unnecessary rebuilds of barebox compare
> -# its output to the last rsatoc output. Only if it differs overwrite the
> +# have to call keytoc. To avoid unnecessary rebuilds of barebox compare
> +# its output to the last keytoc output. Only if it differs overwrite the
>  # target file.
> -quiet_cmd_rsa_keys = RSAKEY  $@
> -cmd_rsa_keys = \
> -	$(objtree)/scripts/rsatoc -o $@.tmp "$(2)" $(3) &&		\
> +quiet_cmd_public_keys = KEY     $@
> +cmd_public_keys = \
> +	$(objtree)/scripts/keytoc -o $@.tmp "$(2)" $(3) &&		\
>  	if cmp -s $@.tmp $@; then					\
>  		rm $@.tmp;						\
>  	else								\
> diff --git a/scripts/rsatoc.c b/scripts/keytoc.c
> similarity index 99%
> rename from scripts/rsatoc.c
> rename to scripts/keytoc.c
> index 27f0afe61f..891425cecc 100644
> --- a/scripts/rsatoc.c
> +++ b/scripts/keytoc.c
> @@ -1,8 +1,8 @@
>  // SPDX-License-Identifier: GPL-2.0-or-later WITH LicenseRef-OpenSSL-exception
>  /*
> - * rsatoc - utility to convert an RSA key to a C struct
> + * keytoc - utility to convert a public key to a C struct
>   *
> - * This tool converts an RSA key given as file or PKCS#11
> + * This tool converts an public key given as file or PKCS#11
>   * URI to a C struct suitable to compile with barebox.
>   */
>  #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
> diff --git a/test/self/Makefile b/test/self/Makefile
> index fbc1867254..6390c4afd4 100644
> --- a/test/self/Makefile
> +++ b/test/self/Makefile
> @@ -22,7 +22,7 @@ obj-$(CONFIG_SELFTEST_IDR) += idr.o
>  ifdef REGENERATE_RSATOC
>  
>  $(obj)/jwt_test.pem.c_shipped: $(src)/jwt_test.pem FORCE
> -	$(call if_changed,rsa_keys,$(basename $(target-stem)):$<,-s)
> +	$(call if_changed,public_keys,$(basename $(target-stem)):$<,-s)
>  
>  endif
>  

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




  reply	other threads:[~2024-08-05 10:06 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-01  5:57 [PATCH v2 00/19] Add ECDSA support for FIT image verification Sascha Hauer
2024-08-01  5:57 ` [PATCH v2 01/19] errno: include string for EOPNOTSUPP Sascha Hauer
2024-08-05  9:28   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 02/19] rsatoc: disable deprecated function warnings Sascha Hauer
2024-08-05  9:29   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 03/19] rsatoc: remove unnecessary function call Sascha Hauer
2024-08-05  9:29   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 04/19] rsatoc: pass EVP_PKEY around Sascha Hauer
2024-08-05  9:35   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 05/19] rsatoc: rename rsa_err() to openssl_error() Sascha Hauer
2024-08-05  9:37   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 06/19] rsatoc: move engine initialization to engine_get_pub_key() Sascha Hauer
2024-08-05  9:47   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 07/19] rsatoc: cleanup error handling Sascha Hauer
2024-08-05  9:54   ` Ahmad Fatoum
2024-08-05 10:07     ` Sascha Hauer
2024-08-01  5:57 ` [PATCH v2 08/19] rsatoc: remove unnecessary error check Sascha Hauer
2024-08-05  9:56   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 09/19] rsatoc: use non deprecated openssl functions to retrieve RSA params Sascha Hauer
2024-08-05 10:02   ` Ahmad Fatoum
2024-08-05 10:29   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 10/19] rsatoc: check error value of gen_key() Sascha Hauer
2024-08-05 10:03   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 11/19] rsatoc: rename to keytoc Sascha Hauer
2024-08-05 10:05   ` Ahmad Fatoum [this message]
2024-08-01  5:57 ` [PATCH v2 12/19] keytoc: add ecdsa support Sascha Hauer
2024-08-05 11:04   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 13/19] keytoc: Let openssl_error() take a format string Sascha Hauer
2024-08-05 10:22   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 14/19] keytoc: clarify error messages Sascha Hauer
2024-08-05 10:06   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 15/19] malloc: implement free_sensitive() Sascha Hauer
2024-08-05 10:17   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 16/19] Add elliptic curve cryptography (ECC) helper functions Sascha Hauer
2024-08-05 11:32   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 17/19] crypto: add ECDSA support Sascha Hauer
2024-08-05 11:57   ` Ahmad Fatoum
2024-08-05 12:44     ` Sascha Hauer
2024-08-06  9:13       ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 18/19] crypto: make RSA a visible option Sascha Hauer
2024-08-05 10:19   ` Ahmad Fatoum
2024-08-01  5:57 ` [PATCH v2 19/19] fit: Add ecdsa support Sascha Hauer
2024-08-05 12:04   ` Ahmad Fatoum
2024-08-06  6:03 ` [PATCH v2 00/19] Add ECDSA support for FIT image verification Sascha Hauer
2024-08-06  6:07   ` 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=68396aa4-8a0d-48ce-9829-9dbb2f60c467@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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