mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-21 15:13:56 +02:00
feat: attestation test on azure and default dcap
``` ❯ docker run -i --rm --privileged --device /dev/sgx_enclave --net host \ matterlabsrobot/teepot-self-attestation-test-sgx-azure:latest \ | base64 -d --ignore-garbage \ | docker run -i --rm --net host matterlabsrobot/verify-attestation-sgx-azure:latest ``` Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
parent
96f53752f1
commit
97420df006
15 changed files with 355 additions and 28 deletions
|
@ -9,6 +9,7 @@ repository.workspace = true
|
|||
[dependencies]
|
||||
actix-web.workspace = true
|
||||
anyhow.workspace = true
|
||||
base64.workspace = true
|
||||
teepot.workspace = true
|
||||
tracing-log.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright (c) 2023 Matter Labs
|
||||
// Copyright (c) 2023-2024 Matter Labs
|
||||
|
||||
//! Simple TEE self-attestation test
|
||||
|
||||
|
@ -7,8 +7,8 @@
|
|||
#![deny(clippy::all)]
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
use base64::{engine::general_purpose, Engine as _};
|
||||
use teepot::server::attestation::get_quote_and_collateral;
|
||||
use tracing::error;
|
||||
use tracing_log::LogTracer;
|
||||
use tracing_subscriber::{fmt, prelude::*, EnvFilter, Registry};
|
||||
|
||||
|
@ -22,9 +22,11 @@ async fn main() -> Result<()> {
|
|||
tracing::subscriber::set_global_default(subscriber).unwrap();
|
||||
|
||||
let report_data = [0u8; 64];
|
||||
if let Err(e) = get_quote_and_collateral(None, &report_data) {
|
||||
error!("failed to get quote and collateral: {e:?}");
|
||||
return Err(e);
|
||||
}
|
||||
let report = get_quote_and_collateral(None, &report_data)
|
||||
.context("failed to get quote and collateral")?;
|
||||
|
||||
let base64_string = general_purpose::STANDARD.encode(report.quote.as_ref());
|
||||
print!("{}", base64_string);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue