-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathtypes.rs
More file actions
79 lines (70 loc) · 2.07 KB
/
Copy pathtypes.rs
File metadata and controls
79 lines (70 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// SPDX-FileCopyrightText: © 2024-2025 Phala Network <dstack@phala.network>
//
// SPDX-License-Identifier: Apache-2.0
use ra_tls::attestation::AppInfo;
use serde::{Deserialize, Serialize};
use serde_human_bytes as serde_bytes;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VerificationRequest {
#[serde(with = "serde_bytes")]
pub quote: Option<Vec<u8>>,
pub event_log: Option<String>,
pub vm_config: Option<String>,
#[serde(with = "serde_bytes")]
pub attestation: Option<Vec<u8>>,
pub debug: Option<bool>,
}
#[derive(Debug, Clone, Serialize)]
pub struct VerificationResponse {
pub is_valid: bool,
pub details: VerificationDetails,
pub reason: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct VerificationDetails {
pub quote_verified: bool,
pub event_log_verified: bool,
pub os_image_hash_verified: bool,
pub report_data: Option<String>,
pub tcb_status: Option<String>,
pub advisory_ids: Vec<String>,
pub app_info: Option<AppInfo>,
#[serde(skip_serializing_if = "Option::is_none")]
pub acpi_tables: Option<AcpiTables>,
#[serde(skip_serializing_if = "Option::is_none")]
pub rtmr_debug: Option<Vec<RtmrMismatch>>,
}
#[derive(Debug, Clone, Serialize)]
pub struct AcpiTables {
pub tables: String,
pub rsdp: String,
pub loader: String,
}
#[derive(Debug, Clone, Serialize)]
pub struct RtmrMismatch {
pub rtmr: String,
pub expected: String,
pub actual: String,
pub events: Vec<RtmrEventEntry>,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub missing_expected_digests: Vec<String>,
}
#[derive(Debug, Clone, Serialize)]
pub struct RtmrEventEntry {
pub index: usize,
pub event_type: u32,
pub event_name: String,
pub actual_digest: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub expected_digest: Option<String>,
pub payload_len: usize,
pub status: RtmrEventStatus,
}
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum RtmrEventStatus {
Match,
Mismatch,
Extra,
Missing,
}