Skip to content

Commit

Permalink
initdata: add initdata hash in ibmse evidence
Browse files Browse the repository at this point in the history
- add initdata hash in ibmse evidence,
- the initdata hash will be checked by AS policy service as a claim field.

Signed-off-by: Qi Feng Huo <[email protected]>
  • Loading branch information
Qi Feng Huo committed Aug 1, 2024
1 parent 3cbdf1b commit e557fb3
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit e557fb3

Please sign in to comment.