use thiserror::Error;
#[derive(Debug, Error)]
pub enum AtlsVerificationError {
#[error("I/O error: {0}")]
Io(String),
#[error("quote verification failed: {0}")]
Quote(String),
#[error("bootchain mismatch: {field} expected {expected}, got {actual}")]
BootchainMismatch {
field: String,
expected: String,
actual: String,
},
#[error("RTMR{index} mismatch: expected {expected}, got {actual}")]
RtmrMismatch {
index: u8,
expected: String,
actual: String,
},
#[error("certificate not in event log")]
CertificateNotInEventLog,
#[error("failed to parse event log: {0}")]
EventLogParse(String),
#[error("TEE type mismatch: {0}")]
TeeTypeMismatch(String),
#[error("app compose hash mismatch: expected {expected}, got {actual}")]
AppComposeHashMismatch { expected: String, actual: String },
#[error("OS image hash mismatch: expected {expected}, got {actual:?}")]
OsImageHashMismatch {
expected: String,
actual: Option<String>,
},
#[error("TCB status {status} not allowed (allowed: {allowed:?})")]
TcbStatusNotAllowed { status: String, allowed: Vec<String> },
#[error("report data mismatch: expected {expected}, got {actual}. Possible replay/relay attack.")]
ReportDataMismatch { expected: String, actual: String },
#[error("configuration error: {0}")]
Configuration(String),
#[error("TLS handshake failed: {0}")]
TlsHandshake(String),
#[error("invalid server name: {0}")]
InvalidServerName(String),
#[error("missing server certificate")]
MissingCertificate,
#[error("{0}")]
Other(#[from] anyhow::Error),
}