Skip to content

Commit 50fd83d

Browse files
shjalaeriknordmark
authored andcommitted
Revert "Add null key verfication to detect TPM reset attacks"
This reverts commit 9c11d07. Signed-off-by: Shahriyar Jalayeri <shahriyar@posteo.de>
1 parent d944fb4 commit 50fd83d

File tree

3 files changed

+0
-187
lines changed

3 files changed

+0
-187
lines changed

pkg/pillar/cmd/tpmmgr/tpmmgr.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,6 @@ func getQuote(nonce []byte) ([]byte, []byte, []types.PCRValue, error) {
314314
return nil, nil, nil, fmt.Errorf("invalid nonce length %d", len(nonce))
315315
}
316316

317-
// First make sure TPM is somewhat trustworthy
318-
if err := etpm.ValidateKernelNullPrimary(log); err != nil {
319-
return nil, nil, nil, fmt.Errorf("failed to verify null primary, possibly due to a tpm reset attack: %v", err)
320-
}
321-
322317
rw, err := tpm2.OpenTPM(etpm.TpmDevicePath)
323318
if err != nil {
324319
return nil, nil, nil, fmt.Errorf("unable to open TPM device handle (%v), returning empty quote/PCRs", err)

pkg/pillar/evetpm/null_key.go

Lines changed: 0 additions & 146 deletions
This file was deleted.

pkg/pillar/evetpm/tpm.go

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -231,32 +231,6 @@ var (
231231
CurveID: tpm2.CurveNISTP256,
232232
},
233233
}
234-
// NullKeyTemplate is used for detecting TPM reset attacks
235-
NullKeyTemplate = tpm2.Public{
236-
Type: tpm2.AlgECC, // TPM_ALG_ECC
237-
NameAlg: tpm2.AlgSHA256, // TPM_ALG_SHA256
238-
Attributes: tpm2.FlagFixedTPM | tpm2.FlagFixedParent | tpm2.FlagSensitiveDataOrigin |
239-
tpm2.FlagUserWithAuth | tpm2.FlagNoDA | tpm2.FlagRestricted | tpm2.FlagDecrypt, // TPM2_OA_NULL_KEY
240-
AuthPolicy: []byte{}, // Empty auth policy
241-
ECCParameters: &tpm2.ECCParams{
242-
Symmetric: &tpm2.SymScheme{
243-
Alg: tpm2.AlgAES, // TPM_ALG_AES
244-
KeyBits: 128, // AES_KEY_BITS (128)
245-
Mode: tpm2.AlgCFB, // TPM_ALG_CFB
246-
},
247-
Sign: &tpm2.SigScheme{
248-
Alg: tpm2.AlgNull, // TPM_ALG_NULL
249-
},
250-
CurveID: tpm2.CurveNISTP256, // TPM2_ECC_NIST_P256
251-
KDF: &tpm2.KDFScheme{
252-
Alg: tpm2.AlgNull, // TPM_ALG_NULL
253-
},
254-
Point: tpm2.ECPoint{
255-
XRaw: []byte{}, // Zero size X point
256-
YRaw: []byte{}, // Zero size Y point
257-
},
258-
},
259-
}
260234
)
261235

262236
// GetTpmLogFileNames returns paths to saved TPM logs
@@ -772,11 +746,6 @@ func FetchSealedVaultKey(log *base.LogObject) ([]byte, error) {
772746

773747
// SealDiskKey seals key into TPM2.0, with provided PCRs
774748
func SealDiskKey(log *base.LogObject, key []byte, pcrSel tpm2.PCRSelection) error {
775-
// First make sure TPM is somewhat trustworthy
776-
if err := ValidateKernelNullPrimary(log); err != nil {
777-
return fmt.Errorf("failed to verify null primary, possibly due to a tpm reset attack: %v", err)
778-
}
779-
780749
rw, err := tpm2.OpenTPM(TpmDevicePath)
781750
if err != nil {
782751
return err
@@ -904,11 +873,6 @@ func isLegacyKeyPresent() bool {
904873

905874
// UnsealDiskKey unseals key from TPM2.0
906875
func UnsealDiskKey(pcrSel tpm2.PCRSelection) ([]byte, error) {
907-
// First make sure TPM is somewhat trustworthy
908-
if err := ValidateKernelNullPrimary(nil); err != nil {
909-
return nil, fmt.Errorf("failed to verify null primary, possibly due to a tpm reset attack: %v", err)
910-
}
911-
912876
rw, err := tpm2.OpenTPM(TpmDevicePath)
913877
if err != nil {
914878
return nil, err

0 commit comments

Comments
 (0)