[PATCH 2/3] tools: binman: mkimage: add support for passing the engine

Simon Glass sjg at chromium.org
Sun Nov 2 20:53:56 CET 2025


Hi Quentin,

On Fri, 31 Oct 2025 at 16:23, Quentin Schulz <foss+uboot at 0leil.net> wrote:
>
> From: Quentin Schulz <quentin.schulz at cherry.de>
>
> mkimage has support for OpenSSL engines but binman currently doesn't for
> direct callers of mkimage (e.g. the fit etype). This prepares for adding
> support for OpenSSL engines for signing elements of a FIT image, which
> will done in the next commit.
>
> Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
> ---
>  tools/binman/btool/mkimage.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Please make sure this is tested.

>
> diff --git a/tools/binman/btool/mkimage.py b/tools/binman/btool/mkimage.py
> index 3f84220fb1a..79a8f887795 100644
> --- a/tools/binman/btool/mkimage.py
> +++ b/tools/binman/btool/mkimage.py
> @@ -22,7 +22,7 @@ class Bintoolmkimage(bintool.Bintool):
>
>      # pylint: disable=R0913
>      def run(self, reset_timestamp=False, output_fname=None,
external=False,
> -            pad=None, align=None, keys_dir=None):
> +            pad=None, align=None, keys_dir=None, engine=None):
>          """Run mkimage
>
>          Args:
> @@ -35,6 +35,7 @@ class Bintoolmkimage(bintool.Bintool):
>                  signatures
>              align: Bytes to use for alignment of the FIT and its
external data
>              keys_dir: Path to directory containing private and
encryption keys
> +            engine: Name of the OpenSSL engine to use
>              version: True to get the mkimage version
>          """
>          args = []
> @@ -50,6 +51,8 @@ class Bintoolmkimage(bintool.Bintool):
>              args += ['-k', f'{keys_dir}']
>          if output_fname:
>              args += ['-F', output_fname]
> +        if engine:
> +            args += ['-N', engine]
>          return self.run_cmd(*args)
>
>      def fetch(self, method):
>
> --
> 2.51.0
>

Regards,
Simon


More information about the U-Boot mailing list