diff --git a/Cargo.lock b/Cargo.lock index 309dd1b21..c878f45bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1473,7 +1473,7 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "client" -version = "0.7.0" +version = "0.7.1" dependencies = [ "async-tungstenite 0.25.1", "base64 0.22.1", @@ -1582,7 +1582,7 @@ dependencies = [ [[package]] name = "client_ios" -version = "0.7.0" +version = "0.7.1" dependencies = [ "cargo_metadata", "client", @@ -1596,7 +1596,7 @@ dependencies = [ [[package]] name = "client_wasm" -version = "0.7.0" +version = "0.7.1" dependencies = [ "cargo_metadata", "client", @@ -4175,7 +4175,7 @@ dependencies = [ [[package]] name = "notary" -version = "0.7.0" +version = "0.7.1" dependencies = [ "alloy-primitives", "async-trait", diff --git a/client/Cargo.toml b/client/Cargo.toml index e1730de9f..4de4fa0ec 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -1,6 +1,6 @@ [package] name ="client" -version="0.7.0" +version="0.7.1" edition="2021" build ="build.rs" publish=false diff --git a/client_ios/Cargo.toml b/client_ios/Cargo.toml index b1ddb9b87..39e518c1a 100644 --- a/client_ios/Cargo.toml +++ b/client_ios/Cargo.toml @@ -1,6 +1,6 @@ [package] name ="client_ios" -version="0.7.0" +version="0.7.1" edition="2021" build ="build.rs" publish=false diff --git a/client_wasm/Cargo.toml b/client_wasm/Cargo.toml index 4e8a88140..d99bb5964 100644 --- a/client_wasm/Cargo.toml +++ b/client_wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name ="client_wasm" -version="0.7.0" +version="0.7.1" edition="2021" build ="build.rs" publish=false diff --git a/notary/Cargo.toml b/notary/Cargo.toml index 265ac10da..5b2c54723 100644 --- a/notary/Cargo.toml +++ b/notary/Cargo.toml @@ -1,6 +1,6 @@ [package] name ="notary" -version="0.7.0" +version="0.7.1" edition="2021" build ="build.rs" diff --git a/notary/src/tee.rs b/notary/src/tee.rs index a2aedf1b3..3efdb2fe1 100644 --- a/notary/src/tee.rs +++ b/notary/src/tee.rs @@ -2,7 +2,7 @@ use std::sync::{Arc, OnceLock}; use axum::{ extract::{Query, State}, - response::Response, + response::{self, Response}, }; #[cfg(feature = "tee-google-confidential-space-token-generator")] use caratls_ekm_google_confidential_space_server::GoogleConfidentialSpaceTokenGenerator; @@ -13,7 +13,8 @@ use client::origo::OrigoSecrets; use futures_util::SinkExt; use hyper::{body::Bytes, upgrade::Upgraded}; use hyper_util::rt::TokioIo; -use serde::Deserialize; +use serde::{de::value, Deserialize}; +use serde_json::Value; use tokio::{ io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}, time::{timeout, Duration}, @@ -245,15 +246,14 @@ pub fn create_tee_proof( ) -> Result { validate_notarization_legal(manifest, request, response)?; + let value = response.notary_response_body.clone().json.unwrap(); + let serialized_value = serde_json::to_string(&value).unwrap(); + debug!("value: {:?}", value); let manifest_hash = manifest.to_keccak_digest()?; - let to_sign = VerifyOutput { - // Using manifest hash as a value here since we are not exposing any values extracted - // from the request or response - value: format!("0x{}", hex::encode(manifest_hash)), - manifest: manifest.clone(), - }; + let to_sign = VerifyOutput { value: serialized_value, manifest: manifest.clone() }; let signature = sign_verification(to_sign, State(state)).unwrap(); - let data = TeeProofData { manifest_hash: manifest_hash.to_vec() }; + let data = + TeeProofData { manifest_hash: manifest_hash.to_vec(), value: value.to_string() }; Ok(TeeProof { data, signature }) } diff --git a/web-prover-core/src/proof.rs b/web-prover-core/src/proof.rs index 33d8b5986..12c8ac93d 100644 --- a/web-prover-core/src/proof.rs +++ b/web-prover-core/src/proof.rs @@ -33,5 +33,6 @@ impl TryFrom for Vec { #[derive(Debug, Deserialize, Serialize, Clone)] pub struct TeeProofData { + pub value: String, pub manifest_hash: Vec, }