Skip to content

Commit 365c7b5

Browse files
hslatmanbrandonweeks
authored andcommitted
Fix Intel EK certificate URLs on Linux
1 parent 42c11fc commit 365c7b5

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

attest/wrapped_tpm20.go

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,24 @@ func (t *wrappedTPM20) eks() ([]EK, error) {
212212
if pub.RSAParameters == nil {
213213
return nil, errors.New("ECC EK not yet supported")
214214
}
215+
216+
i, err := t.info()
217+
if err != nil {
218+
return nil, fmt.Errorf("Retrieving TPM info failed: %v", err)
219+
}
220+
ekPub := &rsa.PublicKey{
221+
E: int(pub.RSAParameters.Exponent()),
222+
N: pub.RSAParameters.Modulus(),
223+
}
224+
var certificateURL string
225+
if i.Manufacturer.String() == manufacturerIntel {
226+
certificateURL = intelEKURL(ekPub)
227+
}
215228
return []EK{
216229
{
217-
Public: &rsa.PublicKey{
218-
E: int(pub.RSAParameters.Exponent()),
219-
N: pub.RSAParameters.Modulus(),
220-
},
221-
handle: commonRSAEkEquivalentHandle,
230+
Public: ekPub,
231+
CertificateURL: certificateURL,
232+
handle: commonRSAEkEquivalentHandle,
222233
},
223234
}, nil
224235
}

0 commit comments

Comments
 (0)