mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 13:50:16 +00:00
fix(shim): avoid masking the underlying error when shim verify fails
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user