| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
/* The various TPM PCRs we measure into from sd-stub and sd-boot. */ |
| 5 |
|
| 6 |
enum { |
| 7 |
/* The following names for PCRs 0…7 are based on the names in the "TCG PC Client Specific Platform |
| 8 |
* Firmware Profile Specification" |
| 9 |
* (https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/) */ |
| 10 |
TPM2_PCR_PLATFORM_CODE = 0, |
| 11 |
TPM2_PCR_PLATFORM_CONFIG = 1, |
| 12 |
TPM2_PCR_EXTERNAL_CODE = 2, |
| 13 |
TPM2_PCR_EXTERNAL_CONFIG = 3, |
| 14 |
TPM2_PCR_BOOT_LOADER_CODE = 4, |
| 15 |
TPM2_PCR_BOOT_LOADER_CONFIG = 5, |
| 16 |
TPM2_PCR_HOST_PLATFORM = 6, |
| 17 |
TPM2_PCR_SECURE_BOOT_POLICY = 7, |
| 18 |
|
| 19 |
/* The following names for PCRs 9…15 are based on the "Linux TPM PCR Registry" |
| 20 |
(https://uapi-group.org/specifications/specs/linux_tpm_pcr_registry/) */ |
| 21 |
TPM2_PCR_KERNEL_INITRD = 9, |
| 22 |
TPM2_PCR_IMA = 10, |
| 23 |
|
| 24 |
/* systemd: This TPM PCR is where we extend the sd-stub "payloads" into, before using them. i.e. the kernel |
| 25 |
* ELF image, embedded initrd, and so on. In contrast to PCR 4 (which also contains this data, given |
| 26 |
* the whole surrounding PE image is measured into it) this should be reasonably pre-calculatable, |
| 27 |
* because it *only* consists of static data from the kernel PE image. */ |
| 28 |
TPM2_PCR_KERNEL_BOOT = 11, |
| 29 |
|
| 30 |
/* systemd: This TPM PCR is where sd-stub extends the kernel command line and any passed credentials into. */ |
| 31 |
TPM2_PCR_KERNEL_CONFIG = 12, |
| 32 |
|
| 33 |
/* systemd: This TPM PCR is where we extend the initrd sysext images into which we pass to the booted kernel */ |
| 34 |
TPM2_PCR_SYSEXTS = 13, |
| 35 |
TPM2_PCR_SHIM_POLICY = 14, |
| 36 |
|
| 37 |
/* systemd: This TPM PCR is where we measure the root fs volume key (and maybe /var/'s) if it is split off */ |
| 38 |
TPM2_PCR_SYSTEM_IDENTITY = 15, |
| 39 |
|
| 40 |
/* As per "TCG PC Client Specific Platform Firmware Profile Specification" again, see above */ |
| 41 |
TPM2_PCR_DEBUG = 16, |
| 42 |
TPM2_PCR_APPLICATION_SUPPORT = 23, |
| 43 |
}; |
| 44 |
|
| 45 |
/* The tag used for EV_EVENT_TAG event log records covering the boot loader config */ |
| 46 |
#define LOADER_CONF_EVENT_TAG_ID UINT32_C(0xf5bc582a) |
| 47 |
|
| 48 |
/* The tag used for EV_EVENT_TAG event log records covering DeviceTree blobs */ |
| 49 |
#define DEVICETREE_ADDON_EVENT_TAG_ID UINT32_C(0x6c46f751) |
| 50 |
|
| 51 |
/* The tag used for EV_EVENT_TAG event log records covering initrd addons */ |
| 52 |
#define INITRD_ADDON_EVENT_TAG_ID UINT32_C(0x49dffe0f) |
| 53 |
|
| 54 |
/* The tag used for EV_EVENT_TAG event log records covering ucode addons (effectively initrds) */ |
| 55 |
#define UCODE_ADDON_EVENT_TAG_ID UINT32_C(0xdac08e1a) |
| 56 |
|
| 57 |
/* The tag used for EV_EVENT_TAG event log records covering the selected UKI profile */ |
| 58 |
#define UKI_PROFILE_EVENT_TAG_ID UINT32_C(0x13aed6db) |
| 59 |
|
| 60 |
/* The tag used for EV_EVENT_TAG event log records covering the SMBIOS type 1 (system information) structure */ |
| 61 |
#define SMBIOS_TYPE1_EVENT_TAG_ID UINT32_C(0xd5cb7cbc) |
| 62 |
|
| 63 |
/* The tag used for EV_EVENT_TAG event log records covering the SMBIOS type 2 (baseboard information) structure */ |
| 64 |
#define SMBIOS_TYPE2_EVENT_TAG_ID UINT32_C(0xe0d47bc8) |
| 65 |
|
| 66 |
/* The tag used for EV_EVENT_TAG event log records covering SMBIOS type 11 (OEM strings) structures */ |
| 67 |
#define SMBIOS_TYPE11_EVENT_TAG_ID UINT32_C(0xc0b3bd23) |