Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Serial timeout and baud defects, unsafe certificate rendering, and incorrect SPDM success reporting can break or misrepresent core demonstrations.
Review effort: Balanced
Findings: 3
Open (14)
Factory target does not track signing key generation · New Dispatcher invokes TPM operations after initialization failure · New Certificate SAN values are vulnerable to HTML injection · New Discovery-only results are falsely reported as secured sessions · New SPDM timeout is too short for the full handshake · New OnboardReader defaults to the wrong baud rate · New CLI default baud rate mismatches the firmware · New Benchmark reports PASS after incomplete iterations · New SPDM build hash is not reproducible across responder keys · New Command table omits the SPDM d command · New Documentation incorrectly describes two off-silicon acts · New Main claim incorrectly says every tab uses fitted silicon · New Sign act is mislabeled as host verification · New Transport is incorrectly documented as SPI · New
What changed in this PR
Adds a complete PSoC Control C3 firmware and host interface for driving an attached TPM over I2C, including ML-DSA, sealing, PCR, endorsement, and SPDM demonstrations.
Changes:
- Adds MCU firmware, TPM transport, cryptographic acts, diagnostics, and wolfBoot packaging.
- Adds a browser UI and serial command-line tooling.
- Documents building, flashing, operation, and measured performance.
| File | Description |
|---|---|
README.md |
Links and summarizes the demo. |
.../.gitignore |
Excludes generated artifacts. |
.../BUILD.md |
Documents build and flashing. |
.../Makefile |
Builds, signs, and assembles firmware. |
.../README.md |
Documents firmware acts and benchmarks. |
.../act_sign.c |
Implements ML-DSA signing and verification. |
.../act_sign.h |
Declares the signing act. |
.../act_spdm.c |
Implements the SPDM act. |
.../act_spdm.h |
Declares the SPDM act. |
.../console_write.c |
Routes diagnostic output to UART. |
.../demo_acts.c |
Dispatches console-selected TPM acts. |
.../demo_util.c |
Provides board, timing, and output utilities. |
.../demo_util.h |
Declares shared utilities. |
.../fault_report.c |
Reports MCU faults over UART. |
.../firmware/reset-board.jlink |
Resets the MCU and TPM. |
.../heap.c |
Provides a fixed embedded heap. |
.../i2c_trace.c |
Records TPM I2C transfers. |
.../i2c_trace.h |
Declares optional I2C tracing. |
.../mldsa_bench.c |
Benchmarks ML-DSA verification. |
.../mldsa_onboard.c |
Runs the standalone signing demonstration. |
.../rng_seed.c |
Seeds wolfCrypt from the TPM RNG. |
.../tpm_identity.c |
Reads TPM identity on-device. |
.../tpm_io_i2c_c3.c |
Implements wolfTPM I2C transport. |
.../user_settings.h |
Configures ML-DSA verification. |
.../user_settings_tpm.h |
Configures wolfTPM and SPDM support. |
.../wolfboot-demo.config |
Defines the enlarged wolfBoot layout. |
.../host/README.md |
Documents host operation. |
.../host/capture-tabs.sh |
Automates UI screenshots. |
.../host/onboard.py |
Drives firmware over serial. |
.../host/requirements.txt |
Lists host dependencies. |
.../host/shot.py |
Captures headless browser screenshots. |
.../host/sse_probe.py |
Probes streamed demo events. |
.../host/templates/index.html |
Implements the browser interface. |
.../host/x509_lite.py |
Parses displayed certificate fields. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
dgarske
force-pushed
the
psoc_c3_onboard_demo
branch
6 times, most recently
from
October 6, 2026 21:21
60f1d76 to
729124e
Compare
dgarske
force-pushed
the
psoc_c3_onboard_demo
branch
from
October 13, 2026 23:49
729124e to
9363e40
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved input-framing, timeout, recovery-ordering, heap-boundary, build-reproducibility, and network-exposure issues affect reliability and security.
8 open findings
Validate lower bound in _sbrk negative increments · New Bind unauthenticated control server to loopback · New Restore device before emitting terminal result · New Drain UART input after malformed hex requests · New Honor WOLFSSL_REV for existing wolfSSL trees · New Enforce process timeout while streaming stdout · New Restrict process termination to this demo · New Correct outdated wolfBoot PR support description · New
14 resolved since last review
Certificate SAN values are vulnerable to HTML injection Dispatcher invokes TPM operations after initialization failure Factory target does not track signing key generation Benchmark reports PASS after incomplete iterations CLI default baud rate mismatches the firmware OnboardReader defaults to the wrong baud rate SPDM timeout is too short for the full handshake Discovery-only results are falsely reported as secured sessions Transport is incorrectly documented as SPI Sign act is mislabeled as host verification Main claim incorrectly says every tab uses fitted silicon Documentation incorrectly describes two off-silicon acts Command table omits the SPDM d command SPDM build hash is not reproducible across responder keys
🧠 Review effort: Balanced
Comment on lines
+42
to
+49
| char *prev = brk; | ||
|
|
||
| if ((brk + incr) > (heap + sizeof(heap))) { | ||
| errno = ENOMEM; | ||
| return (void *)-1; | ||
| } | ||
| brk += incr; | ||
| return prev; |
| threading.Thread(target=startup_probe, daemon=True).start() | ||
| threading.Thread(target=attract_loop, daemon=True).start() | ||
| # threaded=True so SSE streams do not block the run endpoint. | ||
| APP.run(host="0.0.0.0", port=HTTP_PORT, threaded=True, debug=False) |
Comment on lines
+343
to
+346
| restore: | ||
| /* Back to the plain device the other acts expect. */ | ||
| wolfTPM2_Cleanup(dev); | ||
| rc = wolfTPM2_Init(dev, TPM2_IoCb, NULL); |
Comment on lines
+153
to
+155
| if (hi < 0) { | ||
| tls_sign_end(0, "hex"); | ||
| return; |
Comment on lines
+88
to
+97
| if [ ! -d "$WOLFSSL" ]; then | ||
| say "fetching wolfssl (section 1)" | ||
| # A full wolfssl clone is over a gigabyte and most of it is history | ||
| # this never reads. A blobless clone fetches file contents on demand, | ||
| # which for one checkout is a small fraction of that. | ||
| git clone --filter=blob:none https://github.com/wolfSSL/wolfssl.git \ | ||
| "$WOLFSSL" || die "could not clone wolfssl" | ||
| git -C "$WOLFSSL" checkout --quiet "$WOLFSSL_REV" \ | ||
| || die "no such wolfssl revision: $WOLFSSL_REV" | ||
| fi |
|
|
||
| lines = 0 | ||
| wedged = False | ||
| for line in proc.stdout: |
| REM show never appears. | ||
| set TPM_RESET_CMD=powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0..\firmware\reset-board.ps1" | ||
|
|
||
| powershell -NoProfile -Command "Get-CimInstance Win32_Process -Filter \"Name='python.exe'\" | Where-Object { $_.CommandLine -like '*server.py*' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }" |
|
|
||
| Runs the whole demonstration on the microcontroller: the MCU drives a TPM 2.0 over I2C and performs post-quantum signing, a sealed secret bound to a measurement, PCR and endorsement certificate reads, and an SPDM session, with no host involved in any of it. A browser front end in [host](/Infineon/PSoC_Control_C3_Onboard_Demo/host) renders what the board reports. | ||
|
|
||
| Needs the wolfBoot PSOC Control C3 target: https://github.com/wolfSSL/wolfBoot/pull/915 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Runs the whole demonstration on the microcontroller: post-quantum signing, a sealed secret bound to a measurement, PCR and endorsement certificate reads, an SPDM session, and the signature authenticating a post-quantum TLS 1.3 handshake. No host takes part in the cryptography; it supplies a screen.
What it adds
Infineon/PSoC_Control_C3_Onboard_Demo/- one firmware image whose acts are selected by a command byte on the console, emitting newline-delimited JSONtpm_io_i2c_c3.c,rng_seed.c- TPM IO over wolfBoot's I2C driver, and a DRBG seeded from the TPMact_tls_sign.c,host/tls/board_tls.c- a Hash-ML-DSA key derived in the TPM, and a TLS 1.3 peer whose signing is delegated to the board through a wolfCrypt crypto callbackhost/- browser front end, a command-line driver for the same acts, andtest_host.pywolfboot-demo.config,Makefile,patches/,BUILD.md- partitions for this image, a build that works against either wolfTPM SPDM layout, the wolfSSL patch the TLS tab needs, and the build commandswolfBoot signs and verifies the application;
make factoryproduces one flashable image. wolfTPM is unmodified. Needs wolfSSL/wolfBoot#915Testing
Validated end to end on a PSOC Control C3 (C3M6) EVK with an Infineon SLB9678 on mikroBUS, firmware 45.91, and rebuilt from nothing on a clean Windows 11 machine.
The TLS tab needs the patch in
patches/, which adds an RFC 8446 private-use signature algorithm for the pre-hash ML-DSA this firmware signs, so it is not interoperable with an unpatched peer.BUILD.mdpins the wolfSSL revision: current master enforces FIPS 204 section 5.4 and rejects the SHA-256 pre-hash, which is the only one this part will sign with.patches/carries the opt-in that lifts it, proposed as wolfSSL/wolfssl#11736. The endorsement tab verifies the key match for the P-256 certificate only.