From 02863d7746affb0f01d41c8aad49198824753efa Mon Sep 17 00:00:00 2001 From: hu55a1n1 Date: Tue, 27 Feb 2024 11:52:23 -0800 Subject: [PATCH] Add MockAttestor --- enclaves/quartz/src/attestor.rs | 11 +++++++++++ enclaves/quartz/src/main.rs | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/enclaves/quartz/src/attestor.rs b/enclaves/quartz/src/attestor.rs index 2402948..626dbe6 100644 --- a/enclaves/quartz/src/attestor.rs +++ b/enclaves/quartz/src/attestor.rs @@ -25,3 +25,14 @@ impl Attestor for EpidAttestor { read("/dev/attestation/quote") } } + +#[derive(Clone, PartialEq, Debug)] +pub struct MockAttestor; + +impl Attestor for MockAttestor { + type Error = String; + + fn quote(&self, _user_data: impl HasUserData) -> Result, Self::Error> { + Ok(vec![]) + } +} diff --git a/enclaves/quartz/src/main.rs b/enclaves/quartz/src/main.rs index e04df30..be7eba9 100644 --- a/enclaves/quartz/src/main.rs +++ b/enclaves/quartz/src/main.rs @@ -25,7 +25,7 @@ use quartz_cw::state::{Config, LightClientOpts}; use quartz_proto::quartz::core_server::CoreServer; use tonic::transport::Server; -use crate::{attestor::EpidAttestor, cli::Cli, server::CoreService}; +use crate::{attestor::MockAttestor, cli::Cli, server::CoreService}; #[tokio::main(flavor = "current_thread")] async fn main() -> Result<(), Box> { @@ -47,7 +47,7 @@ async fn main() -> Result<(), Box> { ); Server::builder() - .add_service(CoreServer::new(CoreService::new(config, EpidAttestor))) + .add_service(CoreServer::new(CoreService::new(config, MockAttestor))) .serve(args.rpc_addr) .await?;