mirror of
https://github.com/google/go-attestation.git
synced 2024-12-18 20:47:57 +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 {
|
||||
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{
|
||||
{
|
||||
Public: &rsa.PublicKey{
|
||||
E: int(pub.RSAParameters.Exponent()),
|
||||
N: pub.RSAParameters.Modulus(),
|
||||
},
|
||||
handle: commonRSAEkEquivalentHandle,
|
||||
Public: ekPub,
|
||||
CertificateURL: certificateURL,
|
||||
handle: commonRSAEkEquivalentHandle,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user