From 24ccdf576aff7c395609b96f84270a706aa4b84b Mon Sep 17 00:00:00 2001 From: Tom D'Netto Date: Thu, 11 Apr 2019 10:20:46 -0700 Subject: [PATCH] Improve error messages on windows --- attest/tpm_windows.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/attest/tpm_windows.go b/attest/tpm_windows.go index 03c7e06..14b42bf 100644 --- a/attest/tpm_windows.go +++ b/attest/tpm_windows.go @@ -54,13 +54,13 @@ func probeSystemTPMs() ([]probedTPM, error) { info, err := pcp.TPMInfo() if err != nil { - return nil, err + return nil, fmt.Errorf("TPMInfo() failed: %v", err) } var out probedTPM out.Version, err = tbsConvertVersion(info.TBSInfo) if err != nil { - return nil, err + return nil, fmt.Errorf("tbsConvertVersion(%v) failed: %v", info.TBSInfo.TPMVersion, err) } return []probedTPM{out}, nil @@ -80,16 +80,16 @@ func tbsConvertVersion(info tbsDeviceInfo) (TPMVersion, error) { func openTPM(tpm probedTPM) (*TPM, error) { pcp, err := openPCP() if err != nil { - return nil, err + return nil, fmt.Errorf("openPCP() failed: %v", err) } info, err := pcp.TPMInfo() if err != nil { - return nil, err + return nil, fmt.Errorf("TPMInfo() failed: %v", err) } vers, err := tbsConvertVersion(info.TBSInfo) if err != nil { - return nil, err + return nil, fmt.Errorf("tbsConvertVersion(%v) failed: %v", info.TBSInfo.TPMVersion, err) } return &TPM{