Merge pull request #297 from matter-labs/pre-exec-context

fix(tee-key-preexec): add context to file write operations
This commit is contained in:
Harald Hoyer 2025-04-02 16:43:25 +02:00 committed by GitHub
commit 542e3a9fcc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -58,17 +58,17 @@ fn main_with_error() -> Result<()> {
.extend()?;
// save quote to file
std::fs::write(TEE_QUOTE_FILE, quote)?;
std::fs::write(TEE_QUOTE_FILE, quote).context(TEE_QUOTE_FILE)?;
teepot::quote::TEEType::TDX.to_string()
}
Ok((tee_type, quote)) => {
// save quote to file
std::fs::write(TEE_QUOTE_FILE, quote)?;
std::fs::write(TEE_QUOTE_FILE, quote).context(TEE_QUOTE_FILE)?;
tee_type.to_string()
}
Err(e) => {
error!("Failed to get quote: {}", e);
std::fs::write(TEE_QUOTE_FILE, [])?;
std::fs::write(TEE_QUOTE_FILE, []).context(TEE_QUOTE_FILE)?;
"none".to_string()
}
};