]> git.ipfire.org Git - thirdparty/u-boot.git/commit
tools: binman: fit: add support for OpenSSL engines
authorQuentin Schulz <quentin.schulz@cherry.de>
Fri, 21 Nov 2025 17:14:59 +0000 (18:14 +0100)
committerTom Rini <trini@konsulko.com>
Sat, 6 Dec 2025 17:43:08 +0000 (11:43 -0600)
commitfc75d216f0162d4a85b60fefa9938b8690480e27
tree1a455e2be7f81e030f778e8dc4fb9bcf0af4bde3
parent9f9de386c1e54e6b009e5510ff335ab339a89a62
tools: binman: fit: add support for OpenSSL engines

This adds support for using an OpenSSL engine for signing a FIT image.
To use it, one should set the fit,engine property at the FIT node level
with the engine to use. This will in turn call mkimage with the -N
option.

The -k argument to mkimage can be specified via fit,engine-keydir. If
not specified, -k is not passed to mkimage. This property is especially
useful for pkcs11 engine to specify slots, token label, etc...

As far as I could tell, mkimage encrypts and signs a FIT in one go, thus
the -k argument applies to both signing and encrypting. Considering we
reuse the -k argument for two different meanings (info to pass to the
engine when using an engine otherwise the directory where keys are
stored), we cannot reasonably encrypt using local keys and signing with
an engine, hence the enforced check. I believe it should be possible to
support encrypting and signing with the same engine (using different
key pairs of course, via different key-name-hint likely), but this is
left for the next person to implement.
This is why the property is named fit,engine and not fit,sign-engine.
Ditto for fit,engine-keydir.

The public key (with .crt extension) is still required if it needs to be
embedded in the SPL DTB for example. We could probably support
retrieving the public key from an engine, but this is a change to make
to fdt_add_pubkey.c.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
tools/binman/entries.rst
tools/binman/etype/fit.py