U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <foss+uboot@0leil.net>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>,
	Aristo Chen <jj251510319013@gmail.com>,
	 Rasmus Villemoes <ravi@prevas.dk>,
	 Marek Vasut <marek.vasut+renesas@mailbox.org>,
	 Simon Glass <sjg@chromium.org>,
	 Paul HENRYS <paul.henrys_ext@softathome.com>,
	 Heinrich Schuchardt <xypron.glpk@gmx.de>,
	 Shiji Yang <yangshiji66@outlook.com>,
	 Anton Moryakov <ant.v.moryakov@gmail.com>,
	 Alper Nebi Yasak <alpernebiyasak@gmail.com>,
	Alice Guo <alice.guo@nxp.com>,  Bryan Brattlof <bb@ti.com>,
	Quentin Schulz <quentin.schulz@cherry.de>
Subject: [PATCH 0/3] fit: allow signing with only an engine_id
Date: Fri, 31 Oct 2025 16:22:57 +0100	[thread overview]
Message-ID: <20251031-binman-engine-v1-0-c13c1b5dac43@cherry.de> (raw)

I have a couple of products whose U-Boot FIT is signed via a proprietary
OpenSSL engine which only expects the name of a "slot" to select the key
to sign data with.

Currently mkimage fit support expects either a key-dir (-k) or a
key-file (-G) as a toggle for signing, however this doesn't apply to our
usecase because we use an OpenSSL engine (so no key-file to provide)
which doesn't mimic a directory layout like key-dir implies. Moreover,
binman really expects private keys (.key extension) to be available in
this key-dir directory, which we of course cannot provide.

This series allows to sign a FIT image with mkimage (and binman) with
only an OpenSSL engine and no key-dir. mkimage will read the
key-name-hint property and pass that verbatim to the OpenSSL engine API
via the key_id argument.

Note that the public key (.crt extension) still needs to be available if
one wants to embed it for signature verification (which is probably what
one wants to do :) ).

One issue though is that since binman resolves key paths absolutely and
that I don't believe an OpenSSL engine would happen to have the exact
same key_id value than a local absolute path, fit,encrypt and
fit,sign-engine cannot cohabit. An issue for the next person who wants
an OpenSSL engine AND encrypt the same FIT image, I don't.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
Quentin Schulz (3):
      fit: support signing with only an engine_id
      tools: binman: mkimage: add support for passing the engine
      tools: binman: fit: add support for OpenSSL engines

 tools/binman/btool/mkimage.py |  5 ++++-
 tools/binman/entries.rst      | 22 +++++++++++++++++++---
 tools/binman/etype/fit.py     | 41 +++++++++++++++++++++++++++++++++++++----
 tools/fit_image.c             |  3 ++-
 tools/image-host.c            |  4 ++--
 5 files changed, 64 insertions(+), 11 deletions(-)
---
base-commit: 0dad93a72ec59b21cedeab365a28fcaa11a58384
change-id: 20251030-binman-engine-e349b02696d0

Best regards,
-- 
Quentin Schulz <quentin.schulz@cherry.de>


             reply	other threads:[~2025-10-31 15:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-31 15:22 Quentin Schulz [this message]
2025-10-31 15:22 ` [PATCH 1/3] fit: support signing with only an engine_id Quentin Schulz
2025-11-02 19:53   ` Simon Glass
2025-11-11 10:10   ` Wolfgang Wallner
2025-10-31 15:22 ` [PATCH 2/3] tools: binman: mkimage: add support for passing the engine Quentin Schulz
2025-11-02 19:53   ` Simon Glass
2025-11-03 12:13     ` Quentin Schulz
2025-11-03 14:17       ` Tom Rini
2025-11-03 14:21         ` Quentin Schulz
2025-11-03 14:52       ` Simon Glass
2025-11-11 10:11   ` Wolfgang Wallner
2025-10-31 15:23 ` [PATCH 3/3] tools: binman: fit: add support for OpenSSL engines Quentin Schulz
2025-11-02 19:53   ` Simon Glass
2025-11-03 16:21   ` Peter Robinson
2025-11-03 16:47     ` Quentin Schulz
2025-11-11 10:14     ` Wolfgang Wallner
2025-11-17 15:18       ` Peter Robinson
2025-11-17 15:38         ` Tom Rini
2025-11-17 16:09           ` Quentin Schulz
2025-11-11 10:12   ` Wolfgang Wallner
2025-11-11 10:10 ` [PATCH 0/3] fit: allow signing with only an engine_id Wolfgang Wallner
2025-11-11 11:22   ` Quentin Schulz
2025-11-11 14:49     ` Wolfgang Wallner

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=20251031-binman-engine-v1-0-c13c1b5dac43@cherry.de \
    --to=foss+uboot@0leil.net \
    --cc=alice.guo@nxp.com \
    --cc=alpernebiyasak@gmail.com \
    --cc=ant.v.moryakov@gmail.com \
    --cc=bb@ti.com \
    --cc=jj251510319013@gmail.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=paul.henrys_ext@softathome.com \
    --cc=quentin.schulz@cherry.de \
    --cc=ravi@prevas.dk \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    --cc=yangshiji66@outlook.com \
    /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