Skip to content

binman: Fix preload signing with encrypted FIT

Yan WANG u-boot 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest3 patches 4 repliesIn review
  2. v63 patches 3 repliesSuperseded
  3. v13 patches 1 replySuperseded

Changes in v7 from the cover letter

- use mark_build_done() to recursively mark child entries

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3binman: Generate preload header and sign data only oncetools/binman/etype/pre_load.py+3 -61 reply
2/3binman: collection: Set build_done on referenced entriestools/binman/etype/collection.py tools/binman/etype/section.py+10 -41 reply
3/3tools: binman: Test signing an encrypted FIT with a preload headertools/binman/ftest.py tools/binman/test/security/pre_load_fit_encrypted.dts+84 -01 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchSimon Glass
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/3] binman: Fix preload signing with encrypted FIT

This series improves the reliability and efficiency of binman preload header generation and test it against an encrypted FIT image signed with a preload header.

When a preload header references other entries (e.g. an encrypted FIT) through the collection etype, the referenced entries may be rebuilt multiple times during binman processing. This becomes problematic when the referenced entry produces non-deterministic output, such as FIT encryption using random IVs or timestamps, since rebuilding the entry changes the data.

This series ensures that referenced entries are built only once and that preload signing is performed after all data is collected. It also avoids unnecessary repacking or repeated signing operations by the preload.

The changes include:
* generate preload header placeholders in ObtainContents() and sign data only once in ProcessContentsUpdate()
* mark referenced entries as build_done in the collection etype to avoid rebuilding data
* add a functional test for signing an encrypted FIT with a preload header

Changes in v7:
- use mark_build_done() to recursively mark child entries

Paul HENRYS (2):
binman: Generate preload header and sign data only once
tools: binman: Test signing an encrypted FIT with a preload header

yan wang (1):
binman: collection: Set build_done on referenced entries

 tools/binman/etype/collection.py              |  9 ++-
 tools/binman/etype/pre_load.py                |  9 +--
 tools/binman/etype/section.py                 |  5 +-
 tools/binman/ftest.py                         | 21 +++++++
 .../test/security/pre_load_fit_encrypted.dts  | 63 +++++++++++++++++++
 5 files changed, 97 insertions(+), 10 deletions(-)
 create mode 100644 tools/binman/test/security/pre_load_fit_encrypted.dts
Signature · 1 line
2.25.1