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,12 +212,23 @@ 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")
|
||||||
}
|
}
|
||||||
return []EK{
|
|
||||||
{
|
i, err := t.info()
|
||||||
Public: &rsa.PublicKey{
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("Retrieving TPM info failed: %v", err)
|
||||||
|
}
|
||||||
|
ekPub := &rsa.PublicKey{
|
||||||
E: int(pub.RSAParameters.Exponent()),
|
E: int(pub.RSAParameters.Exponent()),
|
||||||
N: pub.RSAParameters.Modulus(),
|
N: pub.RSAParameters.Modulus(),
|
||||||
},
|
}
|
||||||
|
var certificateURL string
|
||||||
|
if i.Manufacturer.String() == manufacturerIntel {
|
||||||
|
certificateURL = intelEKURL(ekPub)
|
||||||
|
}
|
||||||
|
return []EK{
|
||||||
|
{
|
||||||
|
Public: ekPub,
|
||||||
|
CertificateURL: certificateURL,
|
||||||
handle: commonRSAEkEquivalentHandle,
|
handle: commonRSAEkEquivalentHandle,
|
||||||
},
|
},
|
||||||
}, nil
|
}, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user