@@ -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
774748func 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
906875func 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