Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initdata: add initdata hash in ibmse evidence #616

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion attestation-agent/attester/src/se/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ use pv::{
use serde::{Deserialize, Serialize};
use serde_json;
use serde_with::{base64::Base64, serde_as};
use std::fs;

const DIGEST_FILE: &str = "/run/peerpod/initdata.digest";

pub fn detect_platform() -> bool {
misc::pv_guest_bit_set()
Expand Down Expand Up @@ -71,7 +74,10 @@ impl Attester for SeAttester {
encr_request_nonce,
image_hdr_tags,
} = request;
let user_data = vec![0];
let mut user_data = vec![0];
if fs::metadata(DIGEST_FILE).is_ok() {
user_data = fs::read(DIGEST_FILE)?;
}
let mut uvc: AttestationCmd = AttestationCmd::new_request(
request_blob.into(),
Some(user_data.to_vec()),
Expand Down
Loading