mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-21 07:03:56 +02:00
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:
commit
542e3a9fcc
1 changed files with 3 additions and 3 deletions
|
@ -58,17 +58,17 @@ fn main_with_error() -> Result<()> {
|
||||||
.extend()?;
|
.extend()?;
|
||||||
|
|
||||||
// save quote to file
|
// 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()
|
teepot::quote::TEEType::TDX.to_string()
|
||||||
}
|
}
|
||||||
Ok((tee_type, quote)) => {
|
Ok((tee_type, quote)) => {
|
||||||
// save quote to file
|
// 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()
|
tee_type.to_string()
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("Failed to get quote: {}", 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()
|
"none".to_string()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue