mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-21 23:23:57 +02:00
feat(teepot): add Quote::tee_type
method for TEE type determination
- Introduced `tee_type` method to extract TEE type from the quote header. Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
parent
1536e00d63
commit
6379e9aa9e
1 changed files with 16 additions and 0 deletions
|
@ -575,6 +575,22 @@ impl Quote {
|
||||||
Ok(quote)
|
Ok(quote)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the TEE type of this quote.
|
||||||
|
///
|
||||||
|
/// The TEE type is extracted from the quote header and can be either SGX or TDX for now.
|
||||||
|
/// Due to validation during quote parsing, this is guaranteed to return only
|
||||||
|
/// valid TEE types.
|
||||||
|
pub fn tee_type(&self) -> TEEType {
|
||||||
|
match self.header.tee_type {
|
||||||
|
TEE_TYPE_SGX => TEEType::SGX,
|
||||||
|
TEE_TYPE_TDX => TEEType::TDX,
|
||||||
|
// Creating `Self` via `parse()`,
|
||||||
|
// should guarantee that the TEE type
|
||||||
|
// is nothing else than SGX or TDX
|
||||||
|
_ => unreachable!(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Get the raw certificate chain from the quote.
|
/// Get the raw certificate chain from the quote.
|
||||||
pub fn raw_cert_chain(&self) -> Result<&[u8], QuoteError> {
|
pub fn raw_cert_chain(&self) -> Result<&[u8], QuoteError> {
|
||||||
let cert_data = match &self.auth_data {
|
let cert_data = match &self.auth_data {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue