-
Notifications
You must be signed in to change notification settings - Fork 73
wolfTPM Support For Das U-Boot Bootloader #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
83c517d to
f319296
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for U-Boot in wolfTPM by implementing new IO callbacks and wrapper functions for TPM operations while also updating documentation for clarity. Key changes include:
- Introducing new U-Boot–specific IO implementation (tpm_io_uboot.c) and corresponding header adjustments.
- Refactoring TPM reset and shutdown functions, including renaming wolfTPM2_Shutdown to wolfTPM2_Reset and adding dedicated wrappers.
- Enhancing documentation for TPM API wrappers to clarify functionality and usage.
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wolftpm/tpm2_wrap.h | Added documentation for TPM reset and hierarchy auth change with minor spelling fixes. |
| wolftpm/tpm2_types.h | Updated include conditionals and removed redundant includes. |
| wolftpm/tpm2_packet.h | Added guard macros for endian helper definitions. |
| wolftpm/tpm2.h | Introduced TPM2_GetAlgId and TPM2_GetHierarchyDesc functions. |
| src/tpm2_wrap.c | Renamed and refactored TPM shutdown/reset functions and updated logging. |
| src/tpm2_linux.c | Added U-Boot branch to support new IO callbacks. |
| src/tpm2.c | Implemented TPM2_GetAlgId function. |
| hal/tpm_io_uboot.c | Added U-Boot specific IO callback implementation. |
| hal/tpm_io.h and hal/tpm_io.c | Updated IO callback header and source to include UBOOT branch. |
| examples/wrap/*.c and examples/u-boot/README.md | Updated API calls to use the new reset function and added U-Boot documentation. |
Files not reviewed (1)
- hal/include.am: Language not supported
Comments suppressed due to low confidence (1)
src/tpm2_wrap.c:5793
- The error message in wolfTPM2_ChangeHierarchyAuth prints the error string and hierarchy description in a confusing order. Swap the parameters so that the hierarchy description (desc) appears immediately after the error code and the error string from TPM2_GetRCString(rc) is shown last.
printf("Error %d setting %s auth! %s\n", rc, wolfTPM2_GetRCString(rc), desc);
Description
Support for u-boot with wolfTPM.
__linux__utilizes the existing tpm interface throughtpm2_linux.c__UBOOT__directly talks to TPM with SPI throughtpm_io_uboot.cU-Boot TPM commands to be added:
Tested in QEMU with SWTPM
manifest_addr manifest_sz firmware_addr firmware_sz
Testing
Refer to readme - tested caps with qemu and swtpm simulator
Documentation
examples/u-boot/README.md