Skip to content

Commit

Permalink
Improve error messages when a user's pcr selection is not available o…
Browse files Browse the repository at this point in the history
…n (#182)

the TPM host.
  • Loading branch information
kwtj43 authored Nov 13, 2024
1 parent e98f2ff commit 71f0f8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go-tpm/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func WithAkCertificateUri(uriString string) TpmAdapterOptions {
return func(tca *tpmAdapter) error {
// Azure vTPM does not require an AK certificate -- an empty string is allowed
if uriString == "" {
logrus.Warn("The ak_certificate configuration is not defined will not be included in TPM evidence.")
logrus.Warn("The ak_certificate was not defined in configuration and will not be included in TPM evidence.")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion go-tpm/pcrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (tpm *trustedPlatformModule) GetPcrs(selection ...PcrSelection) ([]byte, er

_, pcrValues, err := tpm.ctx.PCRRead(pcrSelection, nil)
if err != nil {
return nil, err
return nil, errors.Wrapf(err, "Failed to read PCRs with selection %+v", pcrSelection)
}

selectionList, err := pcrValues.SelectionList()
Expand Down

0 comments on commit 71f0f8a

Please sign in to comment.