U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anshul Dalal <anshuld@ti.com>
To: Rasmus Villemoes <ravi@prevas.dk>, Anshul Dalal <anshuld@ti.com>
Cc: <u-boot@lists.denx.de>, Neha Malcom Francis <n-francis@ti.com>,
	Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	<francesco.dolcini@toradex.com>, <w.egorov@phytec.de>
Subject: Re: [PATCH 0/6] k3-binman ergonomics
Date: Tue, 14 Jul 2026 11:06:38 +0530	[thread overview]
Message-ID: <DJY1UCTC7ECG.1BANI7JZP5A80@ti.com> (raw)
In-Reply-To: <87wluzrqx9.fsf@rasmusvillemoes.dk>

On Mon Jul 13, 2026 at 6:24 PM IST, Rasmus Villemoes wrote:
> On Mon, Jul 13 2026, "Anshul Dalal" <anshuld@ti.com> wrote:
>
>> On Fri Jul 10, 2026 at 6:06 PM IST, Rasmus Villemoes wrote:
>>> When trying to hook up use of a customer's own signing infrastructure
>>> for some am62x devices, I found it was more difficult than it should
>>> be to point at the right key(s). One has to patch in the keyfile=
>>> property in way too many places, and if you miss just one, the build
>>> succeeds using the generic custMpk.pem for the one you missed, but of
>>> course the resulting artifacts are unbootable.
>>>
>>
>> The default value for keyfile i.e custMpk.pem is generated via binman
>> from the custMpk node in binman (defined in k3-binman.dtsi), modifying
>> the filepath to your custom key should work as a single line change as
>> is.
>>
>
> No, because I don't have and will not have the "key" as an actual
> file. And nobody who really cares about security should expose their
> signing keys to the build environment. So I cannot simply change how the
> custMpk.pem key in the (top-level) build-directory gets generated from
> the one in the source tree.
>
> I'm using a pkcs11:object=... uri as the keyfile property - that
> works just fine out-of-the-box with a suitable OPENSSL_CONF in the
> environment, so that openssl picks up the right pkcs11 provider module
> and gets a signature that way.
>
> So I really need a way for having a single place to set keyfile =
> "pkcs11:object=..." and have that be used in all relevant nodes. Yes, I
> see that I should have emphasized that use case more in the commit log
> for patch 4, using that as example instead of "/path/to/own/key.pem".
>
> [In my concrete case, the signing is done by a remote service, but it
> would really be the same issue if one were using a yubikey or some other
> local HSM].
>

I see the use case now, what we have here makes sense. To add to what
Simon said[1] a small section documenting the use of pkcss11:object
inside the node in the k3.rst doc would be good to see.

[1]: https://lore.kernel.org/u-boot/CAFLszTh=4fWg6L74vnaJz7O9kOxE68XP3BCJEWVnBvc1aopHJg@mail.gmail.com/

>> Perhaps this could be made more clear by the use of a macro instead of
>> hardcoding the string "custMpk.pem" in all the places to make it more
>> obvious.
>
> Sure, we could introduce a macro and do
>
> #ifndef K3_KEYFILE
> #define K3_KEYFILE "custMpk.pem"
> #endif
>
> at the top of k3-binman.dtsi, but since binman already has the template
> mechanism, that seemed a lot more appropriate to use.

That's fair, we wouldn't need a macro if we replace all instances of
custMpk with the template. I can take that up once this is merged.

Thanks for the patch,
Anshul

  reply	other threads:[~2026-07-14  5:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 12:36 [PATCH 0/6] k3-binman ergonomics Rasmus Villemoes
2026-07-10 12:36 ` [PATCH 1/6] binman: openssl: refactor creation of Distinguished Name section from dict Rasmus Villemoes
2026-07-13 12:40   ` Simon Glass
2026-07-14  5:29   ` Neha Malcom Francis
2026-07-10 12:36 ` [PATCH 2/6] binman: x509_cert: allow and parse distinguished-name subnode Rasmus Villemoes
2026-07-13 12:40   ` Simon Glass
2026-07-10 12:36 ` [PATCH 3/6] binman: x509: fix CN emitted for basic x509 certificates Rasmus Villemoes
2026-07-13 12:41   ` Simon Glass
2026-07-10 12:36 ` [PATCH 4/6] k3-binman.dtsi: add keyfile_template node Rasmus Villemoes
2026-07-13 12:41   ` Simon Glass
2026-07-10 12:36 ` [PATCH 5/6] k3-binman.dtsi: add empty distinguished_name_template Rasmus Villemoes
2026-07-13 12:41   ` Simon Glass
2026-07-10 12:36 ` [PATCH 6/6] k3-binman.dtsi: insert keyfile and distinguished name templates in all ti-secure(-rom) nodes Rasmus Villemoes
2026-07-13 12:55   ` Simon Glass
2026-07-13 14:53     ` Rasmus Villemoes
2026-07-13 15:18       ` Simon Glass
2026-07-13 12:19 ` [PATCH 0/6] k3-binman ergonomics Anshul Dalal
2026-07-13 12:54   ` Rasmus Villemoes
2026-07-14  5:36     ` Anshul Dalal [this message]
2026-07-13 12:56 ` [0/6] " Simon Glass

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=DJY1UCTC7ECG.1BANI7JZP5A80@ti.com \
    --to=anshuld@ti.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=n-francis@ti.com \
    --cc=ravi@prevas.dk \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=w.egorov@phytec.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