All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Paul HENRYS <paul.henrys_ext@softathome.com>
Cc: u-boot@lists.u-boot-project.org, alpernebiyasak@gmail.com,
	philippe.reynes@softathome.com
Subject: Re: [PATCH] binman: pre_load: add sign-size parameter for partial image signing
Date: Fri, 20 Nov 2026 09:40:58 -0600	[thread overview]
Message-ID: <20261120154058.GD3176972@bill-the-cat> (raw)
In-Reply-To: <20261120153626.51467-1-paul.henrys_ext@softathome.com>

[-- Attachment #1: Type: text/plain, Size: 2317 bytes --]

On Fri, Nov 20, 2026 at 04:36:26PM +0100, Paul HENRYS wrote:
> Add an optional sign-size property to the pre-load entry type, allowing
> users to sign only a leading portion of the image rather than the whole
> thing. When set, only the first sign-size bytes are hashed and the
> image_size field in the pre-load header is set accordingly.
> 
> This modification is particularly useful when signing FIT images whose
> data are stored externally to the FIT and hashes are already
> calculated and stored in the FIT header.
> 
> Assisted-by: Claude Sonnet 4.6

Our AI policy is currently "Please don't", and I do owe and have been
half drafting a longer write-up on that.

> Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
> ---
>  tools/binman/etype/pre_load.py                | 46 ++++++++++++++++---
>  tools/binman/ftest.py                         | 41 +++++++++++++++++
>  .../pre_load_ecdsa_sign_size_too_large.dts    | 23 ++++++++++
>  .../pre_load_rsa_sign_size_too_large.dts      | 23 ++++++++++
>  .../test/security/pre_load_sign_size.dts      | 23 ++++++++++
>  5 files changed, 150 insertions(+), 6 deletions(-)
>  create mode 100644 tools/binman/test/security/pre_load_ecdsa_sign_size_too_large.dts
>  create mode 100644 tools/binman/test/security/pre_load_rsa_sign_size_too_large.dts
>  create mode 100644 tools/binman/test/security/pre_load_sign_size.dts
> 
> diff --git a/tools/binman/etype/pre_load.py b/tools/binman/etype/pre_load.py
> index 7890c1c62a8..3612307d4ab 100644
> --- a/tools/binman/etype/pre_load.py
> +++ b/tools/binman/etype/pre_load.py
> @@ -53,6 +53,11 @@ class Entry_pre_load(Entry_collection):
>          - key-name: Filename of the private key to sign
>          - header-size: Total size of the header
>          - version: Version of the header
> +        - sign-size: Number of bytes of the image to sign (default: sign the
> +          entire image). When set, only the first sign-size bytes are hashed
> +          and the header image_size field is set to this value. This allows
> +          the runtime verifier to authenticate a leading portion of the image
> +          while ignoring any trailing data.

Why does this comment need to be almost 5x as long as all of the others
for this function? Thanks.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-11-20 15:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 15:36 [PATCH] binman: pre_load: add sign-size parameter for partial image signing Paul HENRYS
2026-11-20 15:40 ` Tom Rini [this message]
2026-11-20 16:00   ` Paul HENRYS
2026-11-20 16:24     ` Tom Rini

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=20261120154058.GD3176972@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=alpernebiyasak@gmail.com \
    --cc=paul.henrys_ext@softathome.com \
    --cc=philippe.reynes@softathome.com \
    --cc=u-boot@lists.u-boot-project.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.