MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / get_quote

Function get_quote

tdx-attest/src/linux.rs:166–180  ·  view source on GitHub ↗

Get a TDX quote for the given report data. Tries multiple methods in order: 1. ConfigFS (Linux 6.7+) 2. VSock to QGS service

(report_data: &TdxReportData)

Source from the content-addressed store, hash-verified

164/// 1. ConfigFS (Linux 6.7+)
165/// 2. VSock to QGS service
166pub fn get_quote(report_data: &TdxReportData) -> Result<Vec<u8>> {
167 let _guard = TDX_LOCK.lock().map_err(|_| TdxAttestError::Busy)?;
168
169 if is_configfs_available() {
170 return get_quote_via_configfs(report_data);
171 }
172
173 if is_vsock_available() {
174 return get_quote_via_vsock(report_data);
175 }
176
177 Err(TdxAttestError::NotSupported(
178 "no quote method available (configfs not mounted, no vsock port configured)".to_string(),
179 ))
180}
181
182fn is_configfs_available() -> bool {
183 Path::new(CONFIGFS_DEFAULT).is_dir() || Path::new(CONFIGFS_BASE).is_dir()

Callers 5

quote_with_app_idMethod · 0.50
cmd_quoteFunction · 0.50
get_sealing_keyMethod · 0.50
read_mr_config_idFunction · 0.50
mainFunction · 0.50

Calls 5

is_configfs_availableFunction · 0.85
get_quote_via_configfsFunction · 0.85
is_vsock_availableFunction · 0.85
get_quote_via_vsockFunction · 0.85
lockMethod · 0.45

Tested by 2

quote_with_app_idMethod · 0.40
mainFunction · 0.40