Skip to content

STM32C5A3ZG: bare-metal wolfIP port + TLS 1.3 mutual auth with a HUK-protected identity key#142

Draft
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:stm32c5a3_wolfip
Draft

STM32C5A3ZG: bare-metal wolfIP port + TLS 1.3 mutual auth with a HUK-protected identity key#142
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:stm32c5a3_wolfip

Conversation

@dgarske

@dgarske dgarske commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

New wolfIP port for the NUCLEO-C5A3ZG (Cortex-M33F, no TrustZone), reusing the shared STM32 DWC GMAC driver (one STM32C5 alias in src/port/stm32/stm32_eth.c). All milestones validated on hardware.

What works (HW-validated)

  • Network: DHCP + ICMP ping + TCP echo.
  • DHUK crypto callback self-test: ECDSA-sign (HW PKA), AES-GCM (SAES), HMAC-SHA256 (HASH), TRNG.
  • TLS 1.3 mutual-auth client: handshake to openssl s_server -Verify 1, TLS_AES_128_GCM_SHA256; peer verifies the device client cert.
  • HUK identity key in TLS: CertificateVerify signed via the DHUK callback (SAES unwrap -> HW PKA); the identity scalar never exists in software. Peer's verify return:1 is the proof.

Build

  • make (network only) / make ENABLE_CB_SELFTEST=1 / make ENABLE_TLS_CLIENT=1 / make ENABLE_TLS_CLIENT=1 ENABLE_DHUK_KEY=1.
  • TLS builds need the wolfSSL STM32 bare-crypto branch (WOLFSSL_ROOT, default ../wolfssl-c5tls).
  • Flash: STM32CubeProgrammer (SWD, mode=UR). Flash 3.0% -> 21.9% across the variants.

Notable fixes in this port

  • _sbrk now uses the linker .heap region (was overlapping the Ethernet DMA buffers -> packet DMA corrupted malloc'd TLS objects).
  • C5 RNG clock-error detector disabled (WC_STM32_RNG_CED_DISABLE / CR.CED; false-trips on the 48 MHz CK48).
  • RMII RXD0/RXD1 use AF12/AF13 (not AF10); MSPLIM wired to the real stack-limit symbol; 64K heap/stack + WOLFSSL_SMALL_STACK.

Scope

Config A: identity key on the callback, ephemeral ECDHE in software. Config B (route ECDHE through the callback to strip software ECC) is a follow-on. Demo identity key is a public NIST CAVP vector; production provisions the wrapped blob off-device.

@dgarske dgarske self-assigned this Jul 9, 2026
Copilot AI review requested due to automatic review settings July 9, 2026 20:39

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@dgarske dgarske force-pushed the stm32c5a3_wolfip branch from fbb17d2 to 9f824fd Compare July 9, 2026 23:14
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