mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-22 07:12:39 +00:00
ieee1275/tcg2: Refactor grub_ieee1275_tpm_init()
Move tpm_get_tpm_version() into grub_ieee1275_tpm_init() and invalidate grub_ieee1275_tpm_ihandle in case no TPM 2 could be detected. Try the initialization only once so that grub_tpm_present() will always return the same result. Use the grub_ieee1275_tpm_ihandle as indicator for an available TPM instead of grub_ieee1275_tpm_version, which can now be removed. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
8c0b5f2003
commit
72092a8641
3 files changed
+18
-25
No files matched your search
@@ -100,7 +100,7 @@ grub_tpm_measure (unsigned char *buf, grub_size_t size, grub_uint8_t pcr,
|
||||
grub_dprintf ("tpm", "log_event, pcr = %d, size = 0x%" PRIxGRUB_SIZE ", %s\n",
|
||||
pcr, size, description);
|
||||
|
||||
if (grub_ieee1275_tpm_version == 2)
|
||||
if (grub_ieee1275_tpm_ihandle != GRUB_IEEE1275_IHANDLE_INVALID)
|
||||
return tpm2_log_event (buf, size, pcr, description);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
|
||||
Reference in new issue
Block a user