mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-06-13 02:00:47 +00:00
Fall-back TPM2 measurement if it fails with PE_COFF_IMAGE flag
Signed-off-by: Tamas K Lengyel <lengyelt@ainfosec.com>
This commit is contained in:
parent
ba06a4362d
commit
571bfc95a6
7
tpm.c
7
tpm.c
@ -195,12 +195,15 @@ static EFI_STATUS tpm_log_event_raw(EFI_PHYSICAL_ADDRESS buf, UINTN size,
|
||||
CopyMem(event->Event, (VOID *)log, logsize);
|
||||
if (hash) {
|
||||
/* TPM 2 systems will generate the appropriate hash
|
||||
themselves if we pass PE_COFF_IMAGE
|
||||
themselves if we pass PE_COFF_IMAGE. In case that
|
||||
fails we fall back to measuring without it.
|
||||
*/
|
||||
status = uefi_call_wrapper(tpm2->hash_log_extend_event,
|
||||
5, tpm2, PE_COFF_IMAGE, buf,
|
||||
(UINT64) size, event);
|
||||
} else {
|
||||
}
|
||||
|
||||
if (!hash || EFI_ERROR(status)) {
|
||||
status = uefi_call_wrapper(tpm2->hash_log_extend_event,
|
||||
5, tpm2, 0, buf,
|
||||
(UINT64) size, event);
|
||||
|
Loading…
Reference in New Issue
Block a user