pcr0tool: Minor improvements

* List commands alphabetically.
* Use log.Fatalf instead of panic
This commit is contained in:
Dmitrii Okunev 2024-01-29 17:16:07 +00:00
parent 2482898beb
commit 2e0822abc9
2 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ func (cmd Command) Execute(ctx context.Context, args []string) {
}
}
if hashAlgo == tpm2.AlgUnknown {
panic(fmt.Errorf("algo '%s' is unknown", *cmd.hashAlgo))
log.Fatalf("algo '%s' is unknown", *cmd.hashAlgo)
}
pcr, err := tpm.ReadPCRFromTPM(pcr.ID(pcrIndex), hashAlgo)
assertNoError(err)

View File

@ -32,9 +32,9 @@ var knownCommands = map[string]commands.Command{
"display_fwinfo": &displayfwinfo.Command{},
"dump_fit": &dumpfit.Command{},
"dump_registers": &dumpregisters.Command{},
"pcrread": &pcrread.Command{},
"printnodes": &printnodes.Command{},
"validate_security": &validatesecurity.Command{},
"pcrread": &pcrread.Command{},
"sum": &sum.Command{},
}