TPM device support #3286
Replies: 3 comments
-
|
As discussed in the meeting, it is fine to make it OpenSSL-specific for now. Later on we can make the code more generic if needed. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Team, Following up on the earlier message, We now have a draft setup to test where:
Limitation for now...
How to try it out1. Set up a TPM emulatorEither option works:
2. Build spdm-emu with TPM enabledNeed to have following packages installed
Use the updated spdm-emu PR and configure with: Instead of running This script sets up TPM NV indices and handles:
and for now we need to copy After that, just run the requester and responder emulators as usual. Files to review |
Beta Was this translation helpful? Give feedback.
-
|
Steps to Test TPM support in libspdm using spdm-emu TPM-backed support has been implemented and validated in libspdm for the following SPDM flows:
The relevant TPM-specific changes are in:
These changes follow the high-level SPDM + TPM interaction diagram.
Testing with spdm-emuTesting is done using spdm-emu with TPM support enabled via Build configuration: -DDEVICE=tpm -DLIBSPDM_TPM_SUPPORT=ONThe PR also provides Setup stepscd build/bin
../../scripts/setup-tpm.sh --cleanup --start-swtpmThis script provisions the following TPM persistent objects and NV indices: Keys / Contexts Certificates / NV Indices The script also exports the required environment variables for swtpm usage: export TPM2TOOLS_TCTI="swtpm:port=2321"Then start the responder: ./spdm_responder_emuAdditional requirements
Depending on the system, OpenSSL TPM support may need: export OPENSSL_MODULES=/usr/lib/aarch64-linux-gnu/ssl-modulesThis setup allows end-to-end validation of TPM-backed SPDM flows entirely in software, without touching a physical TPM device. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Team,
We’re exploring how to integrate TPM (Trusted Platform Module) capabilities into libspdm.
The goal is to enable libspdm to perform signing, verification, measurement collection, and certificate retrieval directly through a TPM device node.
This work is still experimental — at this stage, we aim to understand how to structure and align TPM-related APIs within libspdm’s architecture.
Current Work
PR - #3285 and DMTF/spdm-emu#436
We’ve introduced a preliminary implementation under:
that can be enabled via CMake option
-D DEVICE=tpmand TPM specific implementation in
This is currently a sample TPM device stub, not a complete implementation.
It serves as a scaffold to evaluate how TPM-backed operations can integrate with libspdm’s existing cryptographic and platform layers.
We are currently assessing where these new APIs should live and how to interface with existing components:
Should TPM API hooks at
crypto_stub.cremain underos_stub/spdm_device_secret_lib_tpmonly, or integrate into:cryptlib_openssl/openssl/or may be
platform_lib/for following TPM APIs implementation
void libspdm_tpm_device_init();bool libspdm_tpm_get_private_key(const char *handle, void **context);bool libspdm_tpm_get_public_key(const char* handle, void **context);bool libspdm_tpm_get_measurement(...);and since openssl APIs for EC are provider aware we can use
contextdirectly with spdm crypto libraries eglibspdm_req_asym_sign_hashlike one implemented inos_stub/spdm_device_secret_lib_tpm/sign.cBeta Was this translation helpful? Give feedback.
All reactions