46 lines
2.0 KiB
Diff
46 lines
2.0 KiB
Diff
From c26a4b5db3eb5ff5d558b9d14f962e3df4147dca Mon Sep 17 00:00:00 2001
|
|
From: houmingyong <houmingyong@huawei.com>
|
|
Date: Thu, 17 Oct 2024 18:58:00 +0800
|
|
Subject: [PATCH] add ima detail result in token
|
|
|
|
Conflict: remove service/attestation/attestation-agent/c_header/example.c
|
|
---
|
|
service/attestation/attestation-agent/agent/src/lib.rs | 6 +-----
|
|
service/attestation/attestation-service/service/src/lib.rs | 3 +++
|
|
2 files changed, 4 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/service/attestation/attestation-agent/agent/src/lib.rs b/service/attestation/attestation-agent/agent/src/lib.rs
|
|
index 1164e2a..93809a2 100644
|
|
--- a/service/attestation/attestation-agent/agent/src/lib.rs
|
|
+++ b/service/attestation/attestation-agent/agent/src/lib.rs
|
|
@@ -280,11 +280,7 @@ impl AttestationAgent {
|
|
match ret {
|
|
Ok(token) => {
|
|
let token_claim: serde_json::Value = serde_json::from_slice(token.claim.as_bytes())?;
|
|
- let tee_claim = json!({
|
|
- "tee": token_claim["tee"].clone(),
|
|
- "payload" : token_claim["tcb_status"].clone(),
|
|
- });
|
|
- Ok(tee_claim as TeeClaim)
|
|
+ Ok(token_claim as TeeClaim)
|
|
},
|
|
Err(e) => {
|
|
log::error!("token to teeclaim failed:{:?}", e);
|
|
diff --git a/service/attestation/attestation-service/service/src/lib.rs b/service/attestation/attestation-service/service/src/lib.rs
|
|
index 1c5c907..dd10b89 100644
|
|
--- a/service/attestation/attestation-service/service/src/lib.rs
|
|
+++ b/service/attestation/attestation-service/service/src/lib.rs
|
|
@@ -152,6 +152,9 @@ impl AttestationService {
|
|
}
|
|
}
|
|
|
|
+ // add ima detail result to report
|
|
+ report.as_object_mut().unwrap().insert("ima".to_string(), claims_evidence["ima"].clone());
|
|
+
|
|
// issue attestation result token
|
|
let evl_report = EvlReport {
|
|
tee: String::from(claims_evidence["tee"].as_str().ok_or(anyhow!("tee type unknown"))?),
|
|
--
|
|
2.33.0
|
|
|