All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marko Mäkelä" <marko.makela@iki.fi>
To: Raymond Mao <raymondmaoca@gmail.com>
Cc: Philippe Reynes <philippe.reynes@softathome.com>,
	jonny.green@keytechinc.com, trini@konsulko.com,
	simon.glass@canonical.com, u-boot@lists.denx.de
Subject: Re: [PATCH v5 01/15] ecdsa: fix support of secp521r1
Date: Sat, 16 May 2026 20:09:09 +0300	[thread overview]
Message-ID: <agiktUnWJV5WzXFD@kehys.lan> (raw)
In-Reply-To: <CAMDkj5xSEbEkHPrsJ2ZnRZ56BsiZXTKV6RxoWrJn-oZfZBi_cg@mail.gmail.com>

Hi Philippe, Raymond, all,

Wed, Apr 22, 2026 at 02:32:22PM -0400, Raymond Mao wrote:
>Hi Philippe,
>
>On Tue, Apr 21, 2026 at 5:10 PM Philippe Reynes
><philippe.reynes@softathome.com> wrote:
>>
>> Current implementation of ecdsa only supports key len aligned on
>> 8 bits. But the curve secp521r1 uses a key of 521 bits which is not
>> aligned on 8 bits. In this commit, we update the keys management
>> for ecdsa to support keys that are not aligned on 8 bits.
>>
>> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>

[snip]

>> +static void fdt_free_key(struct ecdsa_public_key *key)
>> +{
>> +       if (!key)
>> +               return;
>> +       free((char *)key->x);
>
>It is safer to be:
>if (key->x)
>     free((char *)key->x);
>
>> +       free((char *)key->y);
>
>Ditto.

Sorry, did I understand correctly that you are requesting to add 
redundant checks to prevent invocations of free() on a NULL pointer?

The C standard specifies that free(NULL) has no effect. The
implementation fREe_impl() in common/dlmalloc.c documents this as well.  
I think that we should aim for minimal code size.

With best regards,

	Marko

  reply	other threads:[~2026-05-16 17:09 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 21:09 [PATCH v5 00/15] add software ecdsa support Philippe Reynes
2026-04-21 21:09 ` [PATCH v5 01/15] ecdsa: fix support of secp521r1 Philippe Reynes
2026-04-22  0:11   ` Simon Glass
2026-04-22 18:32   ` Raymond Mao
2026-05-16 17:09     ` Marko Mäkelä [this message]
2026-05-20 23:04       ` Simon Glass
2026-04-21 21:09 ` [PATCH v5 02/15] mbedtls: enable support of ecc Philippe Reynes
2026-04-22  0:10   ` Simon Glass
2026-04-22 18:15   ` Raymond Mao
2026-04-21 21:09 ` [PATCH v5 03/15] ecdsa: initial support of ecdsa using mbedtls Philippe Reynes
2026-04-22  0:10   ` Simon Glass
2026-04-22 18:17   ` Raymond Mao
2026-04-21 21:09 ` [PATCH v5 04/15] test: lib: ecdsa: add initial test Philippe Reynes
2026-04-21 21:09 ` [PATCH v5 05/15] drivers: crypto: add software ecdsa support Philippe Reynes
2026-04-22  0:12   ` Simon Glass
2026-04-21 21:09 ` [PATCH v5 06/15] test: dm: ecdsa.c: clean this test as software ecdsa is now implemented Philippe Reynes
2026-04-22  0:12   ` Simon Glass
2026-04-21 21:09 ` [PATCH v5 07/15] test: py: vboot: prepare integration test for ecdsa Philippe Reynes
2026-04-21 21:09 ` [PATCH v5 08/15] test: vboot: add " Philippe Reynes
2026-04-21 21:09 ` [PATCH v5 09/15] tools: fit_image_setup_sig: set required_keynode to -1 Philippe Reynes
2026-04-22  0:13   ` Simon Glass
2026-04-21 21:09 ` [PATCH v5 10/15] tools: mkimage: pre-load: add support of ecdsa Philippe Reynes
2026-04-21 21:09 ` [PATCH v5 11/15] tools: binman: " Philippe Reynes
2026-04-21 21:09 ` [PATCH v5 12/15] boot: " Philippe Reynes
2026-04-21 21:09 ` [PATCH v5 13/15] tools: preload_check_sign: " Philippe Reynes
2026-04-21 21:09 ` [PATCH v5 14/15] test: py: vboot: prepare test for global signature with ecdsa Philippe Reynes
2026-04-21 21:09 ` [PATCH v5 15/15] test: py: vboot: add " Philippe Reynes
2026-04-22 14:54 ` [PATCH v5 00/15] add software ecdsa support Raymond Mao
2026-05-16 17:22 ` Marko Mäkelä

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=agiktUnWJV5WzXFD@kehys.lan \
    --to=marko.makela@iki.fi \
    --cc=jonny.green@keytechinc.com \
    --cc=philippe.reynes@softathome.com \
    --cc=raymondmaoca@gmail.com \
    --cc=simon.glass@canonical.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.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.