Skip to content

Support for PUF in LPC55S69 - #787

Merged
aidangarske merged 25 commits into
wolfSSL:masterfrom
twcook86:lpc55s69_hwpuf
Oct 26, 2026
Merged

aidangarske merged 25 commits into
wolfSSL:masterfrom
twcook86:lpc55s69_hwpuf

Conversation

@twcook86

@twcook86 twcook86 commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

This adds a new device attestation example config (lpc55s69-tz-psa.config) to wolfBoot, to demonstrate and test the new lpc55s69 hw puf support added in wolfSSL/wolfssl#11700

@dgarske
dgarske self-requested a review June 3, 2026 15:57
@danielinux danielinux changed the title Initial implementation Support for PUF in LMC55S69 Jun 8, 2026

@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.

I see this enabling the wolfCrypt HW PUF options, but I don't see anywhere it actually gets used in wolfBoot? Or even called in wolfCrypt. How's this supposed to work end to end?

@twcook86 twcook86 changed the title Support for PUF in LMC55S69 Support for PUF in LPC55S69 Jun 11, 2026
@dgarske
dgarske self-requested a review June 11, 2026 22:02
@danielinux
danielinux self-requested a review June 15, 2026 04:18

@danielinux danielinux 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.

This adds the useful build plumbing for LPC55 PUF support, but it does not yet connect the HW PUF to the attestation identity.

What we actually need here is the HW PUF to become the UID/UDS source for the boot attestation demo. Today the attestation stack gets its identity through hal_uds_derive_key() / hal_attestation_get_ueid() in dice.c.

This PR still needs:

  • a new LPC55 attestation config enabling PSA attestation demo options
  • LPC55 hal support that rebuilds identity from PUF exposing it via hal_uds_derive_key / get_ueid. Check existing generic software managed internal flash PUF support in STM32H5 existing support for HW PUF in mcxn.c via those API for how to implement
  • The test app showing that the PSA attestation token is actually produced from the PUF-derived identity wired inside wolfBoot.

@twcook86 twcook86 removed their assignment Jun 26, 2026
@twcook86

Copy link
Copy Markdown
Contributor Author

I see this enabling the wolfCrypt HW PUF options, but I don't see anywhere it actually gets used in wolfBoot? Or even called in wolfCrypt. How's this supposed to work end to end?

lpc55s69-hwpuf.config will compile in wolfssl test.c, which tests the hwpuf. But, you have to turn on HWPUF=1 in that config file, and point your wolfssl to wolfSSL/wolfssl#10584

@danielinux danielinux added the Later It won't be fixed in the upcoming release label Jul 2, 2026
@danielinux

Copy link
Copy Markdown
Member

Depends on wolfSSL/wolfssl#10584

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #787

Scan targets checked: wolfboot-src, wolfboot-bugs

Findings: 2
2 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Comment thread hal/lpc55s69.c Outdated
Comment thread hal/lpc55s69.c Outdated
@twcook86
twcook86 requested a review from danielinux September 21, 2026 00:50
@danielinux danielinux removed the Later It won't be fixed in the upcoming release label Sep 21, 2026
@danielinux

danielinux commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

This is now properly demonstrating HW PUF on LPC55S69 in DICE.

LGTM after wolfSSL/wolfssl#10584 is merged.

@danielinux danielinux self-assigned this Sep 22, 2026
@dgarske dgarske assigned dgarske and unassigned danielinux Oct 1, 2026

@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.

danielinux
danielinux previously approved these changes Oct 20, 2026

@danielinux danielinux 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.

Verified support for hw puf by adding tests including TZEN and attestation on this target. Off to @dgarske for final review / merge.

Comment thread hal/lpc55s69.c Outdated
Comment thread hal/lpc55s69.c Outdated
Comment thread hal/lpc55s69.c Outdated
Comment thread hal/lpc55s69.c Outdated
@dgarske dgarske assigned twcook86 and unassigned dgarske Oct 20, 2026

@aidangarske aidangarske 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-security

Overall recommendation: REQUEST_CHANGES
Findings: 16 total — 16 posted, 0 skipped
16 finding(s) posted as inline comments (see file-level comments below)

Posted findings

  • [High] [review+review-security] A cut-short PUF provisioning write is accepted as valid, so attestation can be broken for good — hal/lpc55s69.c:115-133
  • [High] [review] PUF peripheral clock is never enabled although driver clock control is disabled — hal/lpc55s69.c:468-470
  • [Medium] [review+review-security] Under TZEN, the non-secure world can reach the HW PUF, which is now the root of attestation trust — hal/lpc55s69.c:411
  • [Medium] [review] HWPUF emulator test runs a single boot, so the stored-record path and identity persistence are never exercised — .github/workflows/trustzone-emulator-tests.yml:194-211
  • [Medium] [review] lpc55s69-hwpuf.config ships with HWPUF disabled and, even when enabled, does not exercise the PUF — config/examples/lpc55s69-hwpuf.config:34-44
  • [Medium] [review] hal_attestation_get_ueid duplicates dice.c, adds an extra PUF cycle per token, and can mismatch the UDS in FORTEST builds — hal/lpc55s69.c:230-260
  • [Medium] [review+review-security] Hard-coded PUF record address 0x80000 is not checked against the partition layout — hal/lpc55s69.c:95-96
  • [Low] [review-security] With HWPUF=1, FORTEST still wins: UDS comes from the public UID while UEID comes from the PUF — hal/lpc55s69.c:364-375
  • [Low] [review-security] hal_attestation_get_ueid leaves the UDS-derived secret in the SHA-256 state on the stack — hal/lpc55s69.c:232-259
  • [Low] [review+review-security] Static PUF activation/key code buffer is not cleared on several return paths — hal/lpc55s69.c:146-149
  • [Low] [review+review-security] uds_from_uid leaves the derived UDS digest on the stack on success — hal/lpc55s69.c:349
  • [Low] [review] Comments describe a UDS fallback that does not exist — hal/lpc55s69.c:363
  • [Info] [review] cryptocb.o linked and cryptocb.h included with no WOLF_CRYPTO_CB user — arch.mk:2156-2162
  • [Info] [review] AHBSC programmed through magic offsets on the non-secure alias — hal/lpc55s69.c:384-392
  • [Info] [review] wolfCrypt_Init() now runs in hal_init for every lpc55s69 wolfBoot build, return value ignored — hal/lpc55s69.c:482-484
  • [Info] [review] Unrelated whitespace change in update_flash.c — src/update_flash.c:1783

Review generated by Skoll

Comment thread hal/lpc55s69.c Outdated
Comment thread hal/lpc55s69.c
Comment thread hal/lpc55s69.c Outdated
Comment thread .github/workflows/trustzone-emulator-tests.yml
Comment thread config/examples/lpc55s69-hwpuf.config Outdated
Comment thread hal/lpc55s69.c Outdated
Comment thread arch.mk
Comment thread hal/lpc55s69.c Outdated
Comment thread hal/lpc55s69.c Outdated
Comment thread src/update_flash.c
@twcook86 twcook86 removed their assignment Oct 22, 2026
@twcook86
twcook86 requested a review from dgarske October 22, 2026 22:36

@aidangarske aidangarske 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.

Still some things to address

Comment thread hal/lpc55s69.c Outdated
Comment thread hal/lpc55s69.c
Comment thread config/examples/lpc55s69-tz-psa.config
Comment thread hal/lpc55s69.c Outdated
Comment thread hal/lpc55s69.c Outdated
@aidangarske aidangarske assigned twcook86 and unassigned wolfSSL-Bot Oct 22, 2026
@dgarske
dgarske requested a review from aidangarske October 23, 2026 19:10
@dgarske dgarske assigned wolfSSL-Bot and aidangarske and unassigned twcook86 Oct 23, 2026

@aidangarske aidangarske 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.

A few suggestions since this overlaps with work I already did. we can merge as is and I can take it from here also.

Comment thread hal/lpc55s69.c
Comment thread hal/lpc55s69.c
Comment thread hal/lpc55s69.c
Comment thread hal/lpc55s69.c
Comment thread hal/lpc55s69.c
Comment thread hal/lpc55s69.c
Comment thread .github/workflows/trustzone-emulator-tests.yml

@aidangarske aidangarske 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-security

Overall recommendation: COMMENT
Findings: 4 total — 3 posted, 1 skipped
3 finding(s) posted as inline comments (see file-level comments below)

Posted findings

  • [Medium] [review-security] PUF provisioning record lacks required word alignment — hal/lpc55s69.c:145
  • [Medium] [review+review-security] PUF persisted-record path and identity stability are not tested — .github/workflows/trustzone-emulator-tests.yml:207-221
  • [Medium] [review] Build the new non-TrustZone HWPUF branch in CI — .github/workflows/test-configs.yml:181-193

Skipped findings

  • [Low] Benchmark build lost the declaration for CLOCK_GetCoreSysClkFreq

Review generated by Skoll

Comment thread hal/lpc55s69.c
Comment thread .github/workflows/trustzone-emulator-tests.yml
Comment thread .github/workflows/test-configs.yml
@aidangarske
aidangarske dismissed stale reviews from wolfSSL-Fenrir-bot and themself October 26, 2026 15:27

stale

@aidangarske
aidangarske merged commit 051a2a4 into wolfSSL:master Oct 26, 2026
494 checks passed
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.

7 participants