diff options
| author | Javier Martinez Canillas <javierm@redhat.com> | 2017-06-15 15:16:04 +0200 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2017-06-15 11:30:22 -0400 |
| commit | 9c40fb7c0570430e28c8e5bc34223d6e3a59a929 (patch) | |
| tree | 71461485f8c526555b8c3389ce0bf965d207b720 /tpm.h | |
| parent | 6d4498fb3b66621992ef61f163befd1c8374781b (diff) | |
| download | efi-boot-shim-9c40fb7c0570430e28c8e5bc34223d6e3a59a929.tar.gz efi-boot-shim-9c40fb7c0570430e28c8e5bc34223d6e3a59a929.zip | |
shim/tpm: Remove magic numbers
When measuring data into the TPM and generating events logs, the event
type is set to EV_IPL (0xd), and for TPM1.2 the algorithm will always
be set to SHA-1 (0x4).
So, add some macro-defined constants for these instead of having them
as magic numbers to make the code more readable.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Diffstat (limited to 'tpm.h')
| -rw-r--r-- | tpm.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1,6 +1,9 @@ #define EFI_TPM_GUID {0xf541796d, 0xa62e, 0x4954, {0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd }}; #define EFI_TPM2_GUID {0x607f766c, 0x7455, 0x42be, {0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f }}; +#define TPM_ALG_SHA 0x00000004 +#define EV_IPL 0x0000000d + EFI_STATUS tpm_log_event(EFI_PHYSICAL_ADDRESS buf, UINTN size, UINT8 pcr, const CHAR8 *description); |
