mirror of
https://github.com/google/go-attestation.git
synced 2024-12-25 15:41:11 +00:00
Improve error messages on windows
This commit is contained in:
parent
b128fd7448
commit
24ccdf576a
@ -54,13 +54,13 @@ func probeSystemTPMs() ([]probedTPM, error) {
|
|||||||
|
|
||||||
info, err := pcp.TPMInfo()
|
info, err := pcp.TPMInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("TPMInfo() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var out probedTPM
|
var out probedTPM
|
||||||
out.Version, err = tbsConvertVersion(info.TBSInfo)
|
out.Version, err = tbsConvertVersion(info.TBSInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("tbsConvertVersion(%v) failed: %v", info.TBSInfo.TPMVersion, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return []probedTPM{out}, nil
|
return []probedTPM{out}, nil
|
||||||
@ -80,16 +80,16 @@ func tbsConvertVersion(info tbsDeviceInfo) (TPMVersion, error) {
|
|||||||
func openTPM(tpm probedTPM) (*TPM, error) {
|
func openTPM(tpm probedTPM) (*TPM, error) {
|
||||||
pcp, err := openPCP()
|
pcp, err := openPCP()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("openPCP() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
info, err := pcp.TPMInfo()
|
info, err := pcp.TPMInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("TPMInfo() failed: %v", err)
|
||||||
}
|
}
|
||||||
vers, err := tbsConvertVersion(info.TBSInfo)
|
vers, err := tbsConvertVersion(info.TBSInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("tbsConvertVersion(%v) failed: %v", info.TBSInfo.TPMVersion, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &TPM{
|
return &TPM{
|
||||||
|
Loading…
Reference in New Issue
Block a user