refactor(quote): move TCB level logic to a dedicated module

- Extracted `TcbLevel` functionality from `sgx` module to `quote::tcblevel`.
- Updated all references to import `TcbLevel` and related utilities from `quote::tcblevel`.
- Updated copyright headers to reflect the new year range.

Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
Harald Hoyer 2025-04-02 15:37:33 +02:00
parent 2ba5c45d31
commit 1e853f653a
Signed by: harald
GPG key ID: F519A1143B3FBE32
13 changed files with 35 additions and 31 deletions

View file

@ -2,9 +2,7 @@
// Copyright (c) 2023-2025 Matter Labs
//! Create a private key and a signed and self-signed certificates
use crate::quote::{error::QuoteContext, get_quote};
pub use crate::sgx::{parse_tcb_levels, sgx_ql_qv_result_t, EnumSet, TcbLevel};
use anyhow::{Context, Result};
use const_oid::{
db::rfc5280::{ID_KP_CLIENT_AUTH, ID_KP_SERVER_AUTH},

View file

@ -3,11 +3,11 @@
//! Common attestation API for all TEEs
use crate::{
quote::{
error::QuoteContext, get_quote, verify_quote_with_collateral, QuoteVerificationResult,
},
sgx::{Collateral, EnumSet, TcbLevel},
use crate::quote::{
error::QuoteContext,
get_quote,
tcblevel::{EnumSet, TcbLevel},
verify_quote_with_collateral, Collateral, QuoteVerificationResult,
};
use anyhow::{bail, Context, Result};
use intel_tee_quote_verification_rs::tee_qv_get_collateral;

View file

@ -8,6 +8,7 @@
pub mod attestation;
pub mod error;
pub mod tcblevel;
use crate::{
quote::error::{QuoteContext as _, QuoteError},

View file

@ -1,12 +1,15 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2023-2024 Matter Labs
// Copyright (c) 2023-2025 Matter Labs
//! Intel SGX Enclave TCB level wrapper
use enumset::EnumSetType;
use intel_tee_quote_verification_rs::sgx_ql_qv_result_t;
use std::fmt::{Display, Formatter};
use std::str::FromStr;
use serde::{Deserialize, Serialize};
use std::{
fmt::{Display, Formatter},
str::FromStr,
};
pub use enumset::EnumSet;

View file

@ -1,12 +1,11 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2023-2024 Matter Labs
// Copyright (c) 2023-2025 Matter Labs
// Copyright (c) The Enarx Project Developers https://github.com/enarx/sgx
//! Intel SGX Enclave report structures.
pub mod sign;
pub mod tcblevel;
use crate::quote::error::QuoteContext;
pub use crate::quote::error::QuoteError;
@ -17,7 +16,6 @@ use std::{
io::{Read, Write},
mem,
};
pub use tcblevel::{parse_tcb_levels, EnumSet, TcbLevel};
/// Structure of a quote
#[derive(Copy, Clone, Debug, AnyBitPattern)]

View file

@ -1,11 +1,10 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2023-2024 Matter Labs
// Copyright (c) 2023-2025 Matter Labs
//! Intel TDX helper functions.
pub mod rtmr;
pub use crate::sgx::tcblevel::{parse_tcb_levels, EnumSet, TcbLevel};
use crate::sgx::QuoteError;
pub use intel_tee_quote_verification_rs::Collateral;
use tdx_attest_rs::{tdx_att_get_quote, tdx_attest_error_t, tdx_report_data_t};