[PATCH v4 01/16] keytoc: remove ECDSA dts support

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Sep 25 01:53:07 PDT 2024


On 13.09.24 09:59, Sascha Hauer wrote:
> Generating dts snippets for ECDSA keys does not work properly,
> there are various endianess problems. As we do not need this currently
> for barebox drop the support for now.
> 
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>

Acked-by: Ahmad Fatoum <a.fatoum at pengutronix.de>

> ---
>  scripts/keytoc.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/scripts/keytoc.c b/scripts/keytoc.c
> index 60e177aeee..3ac42bc6d0 100644
> --- a/scripts/keytoc.c
> +++ b/scripts/keytoc.c
> @@ -470,15 +470,8 @@ static int gen_key_ecdsa(EVP_PKEY *key, const char *key_name, const char *key_na
>  		return -EINVAL;
>  
>  	if (dts) {
> -		fprintf(outfilep, "\t\tkey-%s {\n", key_name_c);
> -		fprintf(outfilep, "\t\t\tecdsa,x-point = <");
> -		print_bignum(key_x, bits);
> -		fprintf(outfilep, ">;\n");
> -		fprintf(outfilep, "\t\t\tecdsa,y-point = <");
> -		print_bignum(key_y, bits);
> -		fprintf(outfilep, ">;\n");
> -		fprintf(outfilep, "\t\t\tecdsa,curve = \"%s\";\n", group);
> -		fprintf(outfilep, "\t\t};\n");
> +		fprintf(stderr, "ERROR: generating a dts snippet for ECDSA keys is not yet supported\n");
> +		return -EOPNOTSUPP;
>  	} else {
>  		fprintf(outfilep, "\nstatic uint32_t %s_x[] = {", key_name_c);
>  		print_bignum(key_x, bits);
> @@ -598,6 +591,9 @@ static int gen_key(const char *keyname, const char *path)
>  	}
>  
>  	ret = gen_key_ecdsa(key, keyname, key_name_c);
> +	if (ret == -EOPNOTSUPP)
> +		return ret;
> +
>  	if (ret)
>  		ret = gen_key_rsa(key, keyname, key_name_c);
>  


-- 
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 |



More information about the barebox mailing list