fix(shim): avoid masking the underlying error when shim verify fails

This commit is contained in:
2025-11-02 00:27:45 -04:00
parent 3b4a66879f
commit 1a6ed0af99
2 changed files with 3 additions and 3 deletions

View File

@@ -111,7 +111,7 @@ impl<'a> ShimInput<'a> {
/// to actually boot. /// to actually boot.
pub enum ShimVerificationOutput { pub enum ShimVerificationOutput {
/// The verification failed. /// The verification failed.
VerificationFailed, VerificationFailed(Status),
/// The data provided to the verifier was already a buffer. /// The data provided to the verifier was already a buffer.
VerifiedDataNotLoaded, VerifiedDataNotLoaded,
/// Verifying the data resulted in loading the data from the source. /// Verifying the data resulted in loading the data from the source.
@@ -206,7 +206,7 @@ impl ShimSupport {
// If the verification failed, return the verification failure output. // If the verification failed, return the verification failure output.
if !status.is_success() { if !status.is_success() {
return Ok(ShimVerificationOutput::VerificationFailed); return Ok(ShimVerificationOutput::VerificationFailed(status));
} }
// If verification succeeded, return the validation output, // If verification succeeded, return the validation output,

View File

@@ -58,7 +58,7 @@ impl SecurityHook {
match ShimSupport::verify(input) { match ShimSupport::verify(input) {
Ok(output) => match output { Ok(output) => match output {
// If the verification failed, return the access-denied status. // If the verification failed, return the access-denied status.
ShimVerificationOutput::VerificationFailed => Status::ACCESS_DENIED, ShimVerificationOutput::VerificationFailed(status) => status,
// If the verification succeeded, return the success status. // If the verification succeeded, return the success status.
ShimVerificationOutput::VerifiedDataNotLoaded => Status::SUCCESS, ShimVerificationOutput::VerifiedDataNotLoaded => Status::SUCCESS,
ShimVerificationOutput::VerifiedDataBuffer(_) => Status::SUCCESS, ShimVerificationOutput::VerifiedDataBuffer(_) => Status::SUCCESS,