Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@josephlr
Copy link
Member

This allows users to easily to "the right thing" on Linux, which is to try to open /dev/tpmrm0 and then fall back to /dev/tpm0 if the RM doesn't exist. This is what tpm2-tss does.

Signed-off-by: Joe Richey [email protected]

switch len(path) {
case 0:
tpm, err = tpmutil.OpenTPM("/dev/tpmrm0")
if os.IsNotExist(err) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use errors.Is(err, os.ErrNotExist) https://golang.org/src/os/error.go?s=3221:3252#L82

@alexmwu
Copy link
Contributor

alexmwu commented Jul 1, 2021

This PR is technically a breaking change, if anyone depends on the signature of OpenTPM on non Windows GOOSes. See https://blog.golang.org/module-compatibility#TOC_2. We may want to update the minor version.

This is a _breaking_ change.

Signed-off-by: Joe Richey <[email protected]>
@josephlr josephlr merged commit b3942ee into google:master Jul 27, 2021
@josephlr josephlr deleted the open branch July 27, 2021 05:53
@josephlr
Copy link
Member Author

Discussed offline w/ Alex and Maintainers, we will have a minor breaking release of go-tpm to include this and other changes.

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