Skip to content

IDevID: allow using pre-computed auth values#803

Open
rizlik wants to merge 8 commits into
wolfSSL:masterfrom
rizlik:tpm_mfg_auth_value
Open

IDevID: allow using pre-computed auth values#803
rizlik wants to merge 8 commits into
wolfSSL:masterfrom
rizlik:tpm_mfg_auth_value

Conversation

@rizlik

@rizlik rizlik commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

ZD#21988

Copilot AI review requested due to automatic review settings June 17, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a build-time option to support TPM manufacturing identity (IAK/IDevID) authorization using precomputed per-device authValues (default) instead of always deriving authValues on-device from a shared master secret.

Changes:

  • Introduces WOLFBOOT_TPM_MFG_AUTH_DERIVE make/config option and plumbs it through build configuration.
  • Updates TPM MFG identity paths to either derive authValues on-device (existing behavior) or set precomputed authValues directly into TPM handles.
  • Documents the two modes and adds an STM32H5 TZ example config enabling derive mode for sample TPM usage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/config.mk Adds WOLFBOOT_TPM_MFG_AUTH_DERIVE default and exports it via CONFIG_VARS.
options.mk Adds -DWOLFBOOT_TPM_MFG_AUTH_DERIVE when the option is enabled.
src/tpm.c Implements derive vs precomputed authValue handling for AIK and EH authorization.
include/tpm.h Adds MFG identity auth provisioning macros and documentation for both modes.
docs/TPM.md Documents the new option and explains precomputed vs derive provisioning modes.
config/examples/stm32h5-tz-tpm-mfgid.config New example enabling TPM MFG identity on STM32H5, with derive mode for sample devices.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/tpm.h Outdated
Comment thread docs/TPM.md Outdated
rizlik added 2 commits June 17, 2026 15:46
Allow to either use a master different that the sample one or to
directly use the pre-computed per-device auth values for EH and AIK.
Using the per-device value is preferred as it doesn't expose the auth
value of the sibling devices in the same fleet.
@rizlik rizlik force-pushed the tpm_mfg_auth_value branch from 9dd326b to dd4387e Compare June 17, 2026 15:02
@rizlik rizlik requested a review from dgarske June 17, 2026 15:02

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skoll Multi-Scan Review

Modes: review + review-securityOverall recommendation: COMMENT
Findings: 8 total — 7 posted, 1 skipped
5 finding(s) posted as inline comments (see file-level comments below)

Posted findings

  • [Medium] [review] New default (precomputed) authValue path has no build/CI coveragesrc/tpm.c:1372-1385
  • [Medium] [review] masterPassword parameter has overloaded semantics based on a compile-time macrosrc/tpm.c:1348-1388
  • [Low] [review-security] Master secret on stack not zeroized after use in derive modesrc/tpm.c:1394-1418
  • [Low] [review+review-security] Typo 'wolfBott_tpm2_get_aik' in new header commentinclude/tpm.h:70
  • [Low] [review] Trailing whitespace on added linesinclude/tpm.h:69, docs/TPM.md:35, docs/TPM.md:40
  • [Low] [review] Duplicated authValue-into-handle copy; EH bounds check is a compile-time constantsrc/tpm.c:1380-1384, src/tpm.c:1421-1426
  • [Info] [review-security] Default MFG identity mode change: builds relying on the sample master now fail TPM auth until provisionedsrc/tpm.c:1363-1387

Skipped findings

  • [Low] Derive mode embeds a reel-wide shared master secret in firmware (enabled by the new example config)

Review generated by Skoll

Comment thread src/tpm.c
Comment thread src/tpm.c
Comment thread src/tpm.c
Comment thread include/tpm.h Outdated
Comment thread src/tpm.c

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rizlik rizlik removed their assignment Jun 18, 2026
@rizlik rizlik requested a review from dgarske June 18, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants