mirror of
https://github.com/google/go-attestation.git
synced 2024-12-20 05:28:22 +00:00
Fix Intel EK certificate URLs on Linux (#347)
This commit is contained in:
parent
42c11fc152
commit
3d71f101b1
@ -212,13 +212,24 @@ func (t *wrappedTPM20) eks() ([]EK, error) {
|
|||||||
if pub.RSAParameters == nil {
|
if pub.RSAParameters == nil {
|
||||||
return nil, errors.New("ECC EK not yet supported")
|
return nil, errors.New("ECC EK not yet supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i, err := t.info()
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("Retrieving TPM info failed: %v", err)
|
||||||
|
}
|
||||||
|
ekPub := &rsa.PublicKey{
|
||||||
|
E: int(pub.RSAParameters.Exponent()),
|
||||||
|
N: pub.RSAParameters.Modulus(),
|
||||||
|
}
|
||||||
|
var certificateURL string
|
||||||
|
if i.Manufacturer.String() == manufacturerIntel {
|
||||||
|
certificateURL = intelEKURL(ekPub)
|
||||||
|
}
|
||||||
return []EK{
|
return []EK{
|
||||||
{
|
{
|
||||||
Public: &rsa.PublicKey{
|
Public: ekPub,
|
||||||
E: int(pub.RSAParameters.Exponent()),
|
CertificateURL: certificateURL,
|
||||||
N: pub.RSAParameters.Modulus(),
|
handle: commonRSAEkEquivalentHandle,
|
||||||
},
|
|
||||||
handle: commonRSAEkEquivalentHandle,
|
|
||||||
},
|
},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user