1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum AtlsVerificationError {
8 #[error("I/O error: {0}")]
10 Io(String),
11
12 #[error("quote verification failed: {0}")]
14 Quote(String),
15
16 #[error("bootchain mismatch: {field} expected {expected}, got {actual}")]
18 BootchainMismatch {
19 field: String,
20 expected: String,
21 actual: String,
22 },
23
24 #[error("RTMR{index} mismatch: expected {expected}, got {actual}")]
26 RtmrMismatch {
27 index: u8,
28 expected: String,
29 actual: String,
30 },
31
32 #[error("certificate not in event log")]
34 CertificateNotInEventLog,
35
36 #[error("failed to parse event log: {0}")]
38 EventLogParse(String),
39
40 #[error("TEE type mismatch: {0}")]
42 TeeTypeMismatch(String),
43
44 #[error("app compose hash mismatch: expected {expected}, got {actual}")]
46 AppComposeHashMismatch { expected: String, actual: String },
47
48 #[error("OS image hash mismatch: expected {expected}, got {actual:?}")]
50 OsImageHashMismatch {
51 expected: String,
52 actual: Option<String>,
53 },
54
55 #[error("TCB status {status} not allowed (allowed: {allowed:?})")]
57 TcbStatusNotAllowed { status: String, allowed: Vec<String> },
58
59 #[error("report data mismatch: expected {expected}, got {actual}. Possible replay/relay attack.")]
61 ReportDataMismatch { expected: String, actual: String },
62
63 #[error("configuration error: {0}")]
65 Configuration(String),
66
67 #[error("TLS handshake failed: {0}")]
69 TlsHandshake(String),
70
71 #[error("invalid server name: {0}")]
73 InvalidServerName(String),
74
75 #[error("missing server certificate")]
77 MissingCertificate,
78
79 #[error("{0}")]
81 Other(#[from] anyhow::Error),
82}