mirror of
https://github.com/chipsec/chipsec
synced 2026-06-08 13:31:00 +00:00
a53c211f2f
Currently `test_tpm_eventlog_firmware_blob` generates a TPM event with
16 bytes (`struct.pack("QQ",...)`) to check the decoding of
`EFIFirmwareBlob`. But the code expects a "native unsigned long", as
documented in `chipsec/hal/tpm_eventlog.py`:
class EFIFirmwareBlob(TcgPcrEvent):
# Although [4] 9.2.5 mentions UNIT64 for the length, [1] 7.7 uses
# a UINTN. Use a native unsigned long to cover the most general case.
_event_fmt = "@QL"
On Windows, the size of `unsigned long` is 32 bits, and the test fails:
File "d:\a\chipsec\chipsec\chipsec\hal\tpm_eventlog.py", line 115, in __init__
base, length = struct.unpack(self._event_fmt, self.event)
struct.error: unpack requires a buffer of 12 bytes
Use `"QL"` in the test in order to fix this test on Windows.