@@ -17,6 +17,7 @@ import (
1717
1818 "github.com/siderolabs/talos/internal/pkg/secureboot"
1919 tpm2internal "github.com/siderolabs/talos/internal/pkg/secureboot/tpm2"
20+ "github.com/siderolabs/talos/pkg/machinery/constants"
2021)
2122
2223// RSAKey is the input for the CalculateBankData function.
@@ -30,7 +31,7 @@ type RSAKey interface {
3031// This mimics the process happening happening in the TPM when the UKI is being loaded.
3132//
3233//nolint:gocyclo
33- func CalculateBankData (pcrNumber int , alg tpm2.TPMAlgID , sectionData map [secureboot. Section ]string , rsaKey RSAKey ) ([]tpm2internal.BankData , error ) {
34+ func CalculateBankData (pcrNumber int , alg tpm2.TPMAlgID , sectionData map [string ]string , rsaKey RSAKey ) ([]tpm2internal.BankData , error ) {
3435 // get fingerprint of public key
3536 pubKeyFingerprint := sha256 .Sum256 (x509 .MarshalPKCS1PublicKey (rsaKey .PublicRSAKey ()))
3637
@@ -39,7 +40,7 @@ func CalculateBankData(pcrNumber int, alg tpm2.TPMAlgID, sectionData map[secureb
3940 return nil , err
4041 }
4142
42- pcrSelector , err := tpm2internal .CreateSelector ([]int {secureboot .UKIPCR })
43+ pcrSelector , err := tpm2internal .CreateSelector ([]int {constants .UKIPCR })
4344 if err != nil {
4445 return nil , fmt .Errorf ("failed to create PCR selection: %v" , err )
4546 }
@@ -55,7 +56,7 @@ func CalculateBankData(pcrNumber int, alg tpm2.TPMAlgID, sectionData map[secureb
5556
5657 hashData := NewDigest (hashAlg )
5758
58- for _ , section := range secureboot . OrderedSections () {
59+ for _ , section := range OrderedSections () {
5960 if file := sectionData [section ]; file != "" {
6061 hashData .Extend (append ([]byte (section ), 0 ))
6162
0 commit comments