mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 21:00:20 +00:00
feat(tpm): initial tpm support code, we just tell systemd about the pcr banks right now
This commit is contained in:
@@ -148,4 +148,16 @@ impl BootloaderInterface {
|
||||
VariableClass::BootAndRuntimeTemporary,
|
||||
)
|
||||
}
|
||||
|
||||
/// Tell the system what the number of active PCR banks is.
|
||||
/// If this is zero, that is okay.
|
||||
pub fn set_tpm2_active_pcr_banks(value: u32) -> Result<()> {
|
||||
// Format the value into the specification format.
|
||||
let value = format!("0x{:08x}", value);
|
||||
Self::VENDOR.set_cstr16(
|
||||
"LoaderTpm2ActivePcrBanks",
|
||||
&value,
|
||||
VariableClass::BootAndRuntimeTemporary,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user