Skip to content

Normalize NS350 chip state at entry/exit of nations SPDM tests#489

Merged
dgarske merged 1 commit into
wolfSSL:masterfrom
aidangarske:fix-nations-spdm-test
Apr 21, 2026
Merged

Normalize NS350 chip state at entry/exit of nations SPDM tests#489
dgarske merged 1 commit into
wolfSSL:masterfrom
aidangarske:fix-nations-spdm-test

Conversation

@aidangarske
Copy link
Copy Markdown
Member

NS350 had persistent states that where getting messed up due to canceled runs and failed runs. Added a way to clear psk key after reset to make sure the states are consistent for each run.

  NS350's Nations_IdentityKeySet returns TPM_RC_VALUE when asked to set
  the identity key to its current value. The nations test assumed the
  chip always started at identity-key=1, but self-hosted CI runners
  carry persistent NV state across runs — any prior failure left the
  chip in a state the next run could not recover from. GPIO reset
  clears volatile state but does not reset NV-persistent identity-key
  or PSK provisioning.

  Add normalize_nations_chip(): GPIO reset + idempotent --psk-clear +
  idempotent --identity-key-set. Call at entry of both nations and
  nations-psk blocks, and wire to trap EXIT so the chip is always
  cleaned up on success, failure, or set -e early exit.

  Validated on Pi hardware across five scenarios (identity-key=1,
  identity-key=0, PSK-provisioned, nations-psk clean, nations-psk
  PSK-stuck): all runs now pass and leave the chip at canonical
  identity-key=1.
@dgarske dgarske merged commit ba8dcee into wolfSSL:master Apr 21, 2026
126 of 127 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.

2 participants