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

feat(pcr0tool): Add verb pcrread #364

Merged
merged 4 commits into from
Jan 29, 2024
Merged

feat(pcr0tool): Add verb pcrread #364

merged 4 commits into from
Jan 29, 2024

Conversation

xaionaro
Copy link
Collaborator

@xaionaro xaionaro commented Jul 6, 2023

Just a simple tool to read a PCR value from TPM (without using tpm2-tools).

Feel free to reject this PR. I only added this PR for a single one-time investigation to differentiate if the bug is in tpm2-tools or with TPM module (or its kernel driver) itself.

@xaionaro xaionaro marked this pull request as ready for review July 6, 2023 23:04
@ChriMarMe
Copy link
Collaborator

What is the status here @rihter007 @trynity @u1f35c ?

Copy link
Collaborator

@trynity trynity left a comment

Choose a reason for hiding this comment

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

One minor quibble on the panic and a nit, but approving to unblock.

}
}
if hashAlgo == tpm2.AlgUnknown {
panic(fmt.Errorf("algo '%s' is unknown", *cmd.hashAlgo))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really want a panic here? Seems like we'd want just an error.

Copy link
Collaborator Author

@xaionaro xaionaro Jan 29, 2024

Choose a reason for hiding this comment

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

If the CLI tool is executed with invalid arguments, then the execution should be interrupted. And this code is responsible for the CLI experience. Replaced with log.Fatal to be consistent with the rest of the code. Let me know if you'd like another solution.

cmd/pcr0tool/main.go Outdated Show resolved Hide resolved
xaionaro and others added 2 commits January 29, 2024 17:14
* List commands alphabetically.
* Use log.Fatalf instead of panic
@xaionaro xaionaro merged commit ca601e1 into main Jan 29, 2024
6 checks passed
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