Hi there, I have been working myself into TPM topics during the past week. I would love to explain our...
Hi there,
I have been working myself into TPM topics during the past week. I would love to explain our usecase and how I've come to using TPM, and maybe someone may be able to point out where I took a wrong turn :-)
We are currently working on secure industrial PC (IPC) onboarding, and as our previous appraoch has been found to have security issues, We are planning to replace it. My Idea was to use TPM as a central module.
So onboarding has 2 stages: Base installation on our side and the actual onboarding to the system (S). The installation is thought to be a very simple process, so we thought it should be enough to exchange pubkeys, meaning the Pubkey_S is stored on the IPC (likely in the TPM's NV) and the IPCs uniquely identifying Pubkey ist transferred to S. As this one should be identifying the device, we thought to use the EK's Pubkey.
This way, the data exchange should be straightforward to perform by encrypting secrets with the recipient's Pubkey and decrypt with the Privkey. As for the EK it is clear that RSA decryption can only be performed with the rsa_decrypt (0x159) command. But if I do, the response code 0x2f shows (afaik) that my EK is not allowed to perform the decryption.
So, as you know the usecase: Is this the wrong way to approach the problem? I read many times to create PKI pairs to do en-/decryption, but as they may be deleted, this is not matching my usecase perfectly. Do you have any suggestions? Or am I just missing any kind of privilege shifting on my EK?
More in depth, I am using go-tpm and basically using code similar to https://github.com/google/go-tpm/blob/d3310770bfec97b19d08524b63c458c3487d0d93/examples/tpm2-ekcert/main.go
My problem starts at usage of tpm2.RSADecrypt(tpmConnection, ekPrimary, "", encryptedBytes, nil, "") (No password, no scheme, no label)
Any suggestions would be highly appreciated :-)
👍
1❤️
👍
💡
👏
😂
Explore More Posts
The latest tpm2-tools 5.8 release addresses three GitHub security advisories. One is a heap overflow in tpm2_getekcertificate, and the other is an out-of-bounds write that happens when too many sessions are in use. I don’t have information on the third advisory. Beyond the fixes, 5.8 extends EK certificate handling. It adds the option to read EK certificates from NV RAM, introduces new EK templates and supports a marshaled quote format. https://github.com/tpm2-software/tpm2-tools/releases/tag/5.8
Sneak-peak at our #TPMDEV2026 Conference. One slide from each main talk. Expect the recordings soon as we are migrating to Youtube. The news from today is that we are resuming our monthly calls and we will have in-person #TPMDEV2027! Check TPM.dev for more info.
Earlier today we released tpm2-tss 4.2.2 and 4.1.6 with additional security fixes and compatibility improvements. https://github.com/tpm2-software/tpm2-tss/releases This is the third patch release for 4.1.x this year. I am happy we are picking up speed for faster security patches while sharing knowledge on the tpm2-tss release process among the maintainers.





Comments
Start the Conversation
The standard EK templates do not allow free usage of the key as you have found, the motivation for this is privacy concerns.
But you can create a key on the TPM and …more
Welcome Mathias Haimerl to our developers community and thank you for sharing your project. I think Erik Larsson already gave the best possible solution. There is also TPM2 CertifyCreation and TPM2 Certify.
Thank you very much for the warm welcome and the to-the-point answers. I think I will try to follow the make + activate credential workflow. As the keys are structured hierarchically, this means we are only one level descendent from the EK with this …more
Hello Mathias and wellcome,
If you are doing the base installation on a controller environment, when you realize the make + activate credential workflow (Verifying that you have a …more