Skip to content

Commit 71f0f8a

Browse files
authored
Improve error messages when a user's pcr selection is not available on (#182)
the TPM host.
1 parent e98f2ff commit 71f0f8a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

go-tpm/adapter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func WithAkCertificateUri(uriString string) TpmAdapterOptions {
143143
return func(tca *tpmAdapter) error {
144144
// Azure vTPM does not require an AK certificate -- an empty string is allowed
145145
if uriString == "" {
146-
logrus.Warn("The ak_certificate configuration is not defined will not be included in TPM evidence.")
146+
logrus.Warn("The ak_certificate was not defined in configuration and will not be included in TPM evidence.")
147147
return nil
148148
}
149149

go-tpm/pcrs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func (tpm *trustedPlatformModule) GetPcrs(selection ...PcrSelection) ([]byte, er
2121

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

2727
selectionList, err := pcrValues.SelectionList()

0 commit comments

Comments
 (0)