Skip to content

Commit

Permalink
pcr0tool: Minor improvements
Browse files Browse the repository at this point in the history
* List commands alphabetically.
* Use log.Fatalf instead of panic
  • Loading branch information
xaionaro committed Jan 29, 2024
1 parent 2482898 commit 2e0822a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/pcr0tool/commands/pcrread/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pcr0tool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
}

Expand Down

0 comments on commit 2e0822a

Please sign in to comment.