-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wrapping container for
Quote3
and TcbInfoRaw
Add a new wrapping container, `Evidence` that takes a `Quote3` and a `TcbInfoRaw`. The `Evidence` can be used with the majority of the `Verifier` implementations. This allows one to compose one verifier and use the `Evidence` in the `verify()` method.
- Loading branch information
1 parent
8413e9c
commit 5b62625
Showing
6 changed files
with
426 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) 2023 The MobileCoin Foundation | ||
|
||
//! Errors that can occur during verification | ||
|
||
use mc_sgx_dcap_types::TcbError; | ||
|
||
pub type Result<T> = core::result::Result<T, Error>; | ||
|
||
/// Error working with quote evidence | ||
#[derive(displaydoc::Display, Debug)] | ||
pub enum Error { | ||
/// Error converting from DER {0} | ||
Der(der::Error), | ||
/// Error parsing TCB(Trusted Computing Base) json info: {0} | ||
Serde(serde_json::Error), | ||
/// Error decoding the signature in the TCB data | ||
SignatureDecodeError, | ||
/// Error verifying the signature | ||
SignatureVerification, | ||
/// TCB info not yet valid | ||
TcbInfoNotYetValid, | ||
/// TCB info expired | ||
TcbInfoExpired, | ||
/// Asking for TCB levels for a different FMSPC | ||
FmspcMismatch, | ||
/// The TCB level reported does not match an entry in the TCB info data. | ||
UnsupportedTcbLevel, | ||
/// Failure to get the TCB info from a quote {0} | ||
Quote3TcbInfo(TcbError), | ||
/// Unsupported quote certification data, should be `PckCertificateChain` | ||
UnsupportedQuoteCertificationData, | ||
} | ||
|
||
impl From<der::Error> for Error { | ||
fn from(e: der::Error) -> Self { | ||
Error::Der(e) | ||
} | ||
} | ||
|
||
impl From<serde_json::Error> for Error { | ||
fn from(e: serde_json::Error) -> Self { | ||
Error::Serde(e) | ||
} | ||
} | ||
|
||
impl From<TcbError> for Error { | ||
fn from(e: TcbError) -> Self { | ||
Error::Quote3TcbInfo(e) | ||
} | ||
} |
Oops, something went wrong.