Trait sbat::RevocationSbat
source · pub trait RevocationSbat<'a>: Default {
// Required methods
fn date(&self) -> Option<&AsciiStr>;
fn set_date(&mut self, date: Option<&'a AsciiStr>);
fn revoked_components(&self) -> &[Component<'a>];
fn try_push(&mut self, component: Component<'a>) -> Result<(), PushError>;
// Provided methods
fn parse(input: &'a [u8]) -> Result<Self, ParseError> { ... }
fn validate_image<I: ImageSbat<'a>>(
&self,
image_sbat: &I
) -> ValidationResult<'a> { ... }
fn is_component_revoked(&self, input: &Component<'_>) -> bool { ... }
}Expand description
Trait for revocation SBAT.
Typically this data comes from a UEFI variable such as SbatLevel.
Required Methods§
sourcefn date(&self) -> Option<&AsciiStr>
fn date(&self) -> Option<&AsciiStr>
Date when the data was last updated. This is optional metadata in the first entry and may not be present.
sourcefn set_date(&mut self, date: Option<&'a AsciiStr>)
fn set_date(&mut self, date: Option<&'a AsciiStr>)
Set the date when the data was last updated.
sourcefn revoked_components(&self) -> &[Component<'a>]
fn revoked_components(&self) -> &[Component<'a>]
Get the revoked components as a slice. The component version indicates the lowest allowed version of this component; all lower versions are considered revoked.
Provided Methods§
sourcefn parse(input: &'a [u8]) -> Result<Self, ParseError>
fn parse(input: &'a [u8]) -> Result<Self, ParseError>
Parse SBAT data from raw CSV. This data typically comes from a
UEFI variable. Each record is parsed as a Component.
Any existing data is cleared before parsing.
sourcefn validate_image<I: ImageSbat<'a>>(
&self,
image_sbat: &I
) -> ValidationResult<'a>
fn validate_image<I: ImageSbat<'a>>( &self, image_sbat: &I ) -> ValidationResult<'a>
Check if any component in image_sbat is revoked.
Each component in the image metadata is checked against the revocation entries. If the name matches, and if the component’s version is less than the version in the corresponding revocation entry, the component is considered revoked and the image will not pass validation. If a component is not in the revocation list then it is implicitly allowed.
sourcefn is_component_revoked(&self, input: &Component<'_>) -> bool
fn is_component_revoked(&self, input: &Component<'_>) -> bool
Check if the input Component is revoked.
The input is checked against each revocation component. If the
names match, and if the input’s version is less than the
version in the corresponding revocation component, the input
is considered revoked and the image will not pass validation. If
the input is not in the revocation list then it is implicitly
allowed.