]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Merge patch series "binman: properly error out if path provided to key-name-hint...
authorTom Rini <trini@konsulko.com>
Tue, 1 Jul 2025 16:52:04 +0000 (10:52 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 1 Jul 2025 16:52:04 +0000 (10:52 -0600)
Quentin Schulz <foss+uboot@0leil.net> says:

I misunderstood the documentation and put the signing key in a keys/
directory while setting key-name-hint property in the signature node and
u-boot-spl-pubkey-dtb to a path.

mkimage doesn't fail if it cannot find the public key when signing a
FIT but returns something on stderr to notify the user it couldn't find
the key. The issue is that bintool currently discards stderr if the
command successfully returns, so the FIT is not signed AND the user
isn't made aware of it unless the image is manually inspected.

mkimage does fail when trying to insert a public key in a DTB if it
isn't found but we can have a better error message.

Link: https://lore.kernel.org/r/20250418-binman-pubkey-dir-v2-0-b6b90a765ffe@cherry.de
1  2 
tools/binman/etype/fit.py
tools/binman/ftest.py

index ed3cac4ee7e9706bc46f1cffc90c41946591ec2f,284b19c4b882a91e4320e1c8267c3e6d935d8a00..db40479d30ef01a35f4e001063b97473bbfa8721
@@@ -562,7 -563,11 +563,9 @@@ class Entry_fit(Entry_section)
              for subnode in node.subnodes:
                  if (subnode.name.startswith('signature') or
                      subnode.name.startswith('cipher')):
 -                    if subnode.props.get('key-name-hint') is None:
 -                        continue
                      hint = subnode.props['key-name-hint'].value
+                     if '/' in hint:
+                         self.Raise(f"'{hint}' is a path not a filename")
                      name = tools.get_input_filename(
                          f"{hint}.key" if subnode.name.startswith('signature')
                          else f"{hint}.bin")
Simple merge