Skip to content

Commit

Permalink
fixup! feat: minimal poc for tpm measurements
Browse files Browse the repository at this point in the history
  • Loading branch information
RaitoBezarius committed Apr 30, 2023
1 parent 767b77b commit be929f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rust/stub/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use measure::measure_image;
use pe_loader::Image;
use pe_section::{pe_section, pe_section_as_string};
use sha2::{Digest, Sha256};
use tpm::tpm_available;
use uefi::{
prelude::*,
proto::{
Expand Down Expand Up @@ -242,6 +243,10 @@ fn main(handle: Handle, mut system_table: SystemTable<Boot>) -> Status {
warn!("Hash mismatch for initrd!");
}

if tpm_available(system_table.boot_services()) {
debug!("TPM available, will proceed to measurements.");
}

if let Ok(features) = get_loader_features(system_table.runtime_services()) {
if features.contains(SystemdLoaderFeatures::RandomSeed) {
// FIXME: process random seed then on the disk.
Expand Down

0 comments on commit be929f1

Please sign in to comment.