Skip to content
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

Make use of tpm2.TPMDevice interface and linux.DefaultTPM2Device API #356

Closed
chrisccoulson opened this issue Dec 13, 2024 · 1 comment
Closed

Comments

@chrisccoulson
Copy link
Collaborator

Secboot currently accesses the default TPM using the /dev/tpm0 path directly, which it uses to open an implementation of tpm2.Transport which is then passed to the deprecated tpm2.NewTPMContext API.

It should be ported to make use of the tpm2.TPMDevice interface which represents a device and is passed to the newer tpm2.OpenTPMDevice API. The github.com/canonical/go-tpm2/linux package has methods for iterating devices or accessing the default device, and its implementation of tpm2.TPMDevice provides methods to access the in-kernel resource manager and the physical presence interface (using the ppi.PPI interface) exposed via sysfs. This removes the need for secboot to pass around paths like /dev/tpm0or/dev/tpmrm0`.

Whilst the github.com/canonical/go-tpm2/testutil package has been updated to work with tpm2.TPMDevice, and it will be relatively trivial to port secboot to using it, the largest amount of work in secboot will be updating the test harness components to be compatible with it (those in internal/tpm2test).

@chrisccoulson
Copy link
Collaborator Author

This is fixed with #357

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

No branches or pull requests

1 participant