mirror of
https://github.com/google/go-attestation.git
synced 2024-12-19 04:57:59 +00:00
Deepikarajani24 patch 1 (#193)
* tbs.dll to not initialize on start up so that it's not initialized when tpm support is not required Changed author to my google.com user * initialize tbs.dll and proc Tbsi_GetDeviceInfo during probeSystemTPMs initialization is done in probeSystemTPMs as it's called before openTPM which requires support of the dll changed author to my google.com user * tbs.dll to load once Changed the author to my google.com email * Tbsi_GetDeviceInfo check to happen once changed the author of the commit
This commit is contained in:
parent
9632df6f12
commit
2f809d0330
@ -58,8 +58,8 @@ var (
|
||||
crypt32CertEnumCertificatesInStore = crypt32.MustFindProc("CertEnumCertificatesInStore")
|
||||
crypt32CertCloseStore = crypt32.MustFindProc("CertCloseStore")
|
||||
|
||||
tbs = windows.MustLoadDLL("Tbs.dll")
|
||||
tbsGetDeviceInfo = tbs.MustFindProc("Tbsi_GetDeviceInfo")
|
||||
tbs *windows.DLL
|
||||
tbsGetDeviceInfo *windows.Proc
|
||||
)
|
||||
|
||||
// Error codes.
|
||||
|
@ -42,6 +42,12 @@ type windowsTPM struct {
|
||||
func (*windowsTPM) isTPMBase() {}
|
||||
|
||||
func probeSystemTPMs() ([]probedTPM, error) {
|
||||
// Initialize Tbs.dll here so that it's linked only when TPM support is required.
|
||||
if tbs == nil {
|
||||
tbs = windows.MustLoadDLL("Tbs.dll")
|
||||
tbsGetDeviceInfo = tbs.MustFindProc("Tbsi_GetDeviceInfo")
|
||||
}
|
||||
|
||||
// Windows systems appear to only support a single abstracted TPM.
|
||||
// If we fail to initialize the Platform Crypto Provider, we assume
|
||||
// a TPM is not present.
|
||||
|
Loading…
Reference in New Issue
Block a user