Skip to content

Harden wolfTPM transport handling - #634

Open
aidangarske wants to merge 13 commits into
wolfSSL:masterfrom
aidangarske:fenrir-fixes-14027-15771
Open

aidangarske wants to merge 13 commits into
wolfSSL:masterfrom
aidangarske:fenrir-fixes-14027-15771

Conversation

@aidangarske

Copy link
Copy Markdown
Member

F-14027 - 8e1385c - NV state deletion failures are now returned instead of being treated as successful cleanup.

F-14091 - 5c7381b - Rejected I2C reads now clear the caller's output buffer.

F-14214 - 9043cef - Writes to the read-only TIS burst-count registers are now ignored.

F-14684 - 177d4e7 - The MSSIM transport now rejects unsupported hash-data framing.

F-15711 - c71a3c7 - The Espressif HAL now honors configured transfer and device overrides.

F-15713 - 1e56d44 - Atmel SPI status polling now has a finite retry bound.

F-15714 - 2afeab0 - HAL initialization now returns SPI setup failures.

F-15730 - a992186 - Semaphore comments now accurately document their trust boundary.

F-15734 - 69dd9ed - The TIS wait helper documentation now states its actual return contract.

F-15735 - 89b1014 - Transport API documentation now describes the implemented return values.

F-15737 - ebdd6ba - Socket HAL documentation now matches its actual error handling.

F-15770 - 08f429f - Espressif I2C timing guards now use microseconds consistently.

F-15771 - 3bf899e - Infineon I2C timing guards now account for the accessed register.

@aidangarske aidangarske self-assigned this Oct 14, 2026
@aidangarske
aidangarske force-pushed the fenrir-fixes-14027-15771 branch from 3bf899e to 3565eec Compare October 14, 2026 21:22

@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 #634

Scan targets checked: wolftpm-src, wolftpm-bugs
Coverage: 7 of 14 in-scope changed file(s) opened by the reviewer; not opened: hal/tpm_io_fwtpm.c, src/fwtpm/fwtpm_main.c, tests/fwtpm_io_test_adapter.c, tests/fwtpm_unit_tests.c, wolftpm/fwtpm/fwtpm.h, wolftpm/fwtpm/fwtpm_io.h, wolftpm/fwtpm/fwtpm_tis.h

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

Comment thread docs/fwtpm/hal-and-porting.md
Comment thread wolftpm/fwtpm/fwtpm.h Outdated
int cmdPort; /* Command port (default 2321) */
int platPort; /* Platform port (default 2322) */
FWTPM_IO_HAL ioHal; /* IO transport HAL callbacks */
FWTPM_IO_HAL ioHal; /* Reserved IO transport callbacks */

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.

Fix comment alignment while you are in this code. ioHal should be functional, so please double check.

Comment thread wolftpm/fwtpm/fwtpm.h Outdated

/* IO transport HAL callbacks — socket transport only (not used in TIS mode) */
/* Reserved IO transport callbacks. The built-in socket server stores this
* structure but does not currently invoke it (not available in TIS mode). */

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.

Again, let's fix it.

@dgarske dgarske removed their assignment Oct 15, 2026
@aidangarske
aidangarske force-pushed the fenrir-fixes-14027-15771 branch from 3565eec to f331d0e Compare October 15, 2026 23:24

FWTPM_Init(&ctx);

/* Set custom IO transport after FWTPM_Init, which does not preserve the IO HAL */

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.

Do we still need to remove this code example?


FWTPM_Init(&ctx);

/* Set custom IO transport after FWTPM_Init, which does not preserve the IO HAL */

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.

Same here..

Comment thread hal/tpm_io_espressif.c

/* For read we always need this guard time.
* (success wake or real read) */
XSLEEP_MS(WRITE_TO_READ_GUARD_TIME); /* guard time - should be min 250us */

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.

Are we not able to map XSLEEP_MS -> esp_rom_delay_us (ms * 1000)?

@aidangarske
aidangarske force-pushed the fenrir-fixes-14027-15771 branch from f331d0e to 613e325 Compare October 16, 2026 16:57
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