sprout: measure xen and dom0 payloads and cmdlines into PCRs 9/11/12

Extend PCR 9 with the initrd, PCR 11 with the dom0 kernel,
and PCR 12 with the Xen options and dom0 cmdline.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
This commit is contained in:
Luca Di Maio
2026-05-18 12:43:41 +02:00
parent 076be95306
commit 2c1c380ab5
2 changed files with 79 additions and 48 deletions

View File

@@ -38,6 +38,15 @@ impl PlatformTpm {
/// The PCR for measuring the bootloader configuration into.
pub const PCR_BOOT_LOADER_CONFIG: PcrIndex = PcrIndex(5);
/// The PCR for measuring the dom0 initrd payload into.
pub const PCR_INITRD: PcrIndex = PcrIndex(9);
/// The PCR for measuring the dom0 kernel payload into.
pub const PCR_KERNEL: PcrIndex = PcrIndex(11);
/// The PCR for measuring kernel command line and xen options into.
pub const PCR_KERNEL_PARAMETERS: PcrIndex = PcrIndex(12);
/// Acquire access to the TPM protocol handle, if possible.
/// Returns None if TPM is not available.
fn protocol() -> Result<Option<TpmProtocolHandle>> {