Struct uefi::proto::shim::ShimLock

source ·
#[repr(C)]
pub struct ShimLock { /* private fields */ }
Available on x86 or x86-64 or ARM or AArch64 only.
Expand description

The Shim lock protocol.

This protocol is not part of the UEFI specification, but is installed by the Shim bootloader which is commonly used by Linux distributions to support UEFI Secure Boot. Shim is built with an embedded certificate that is used to validate another EFI application before running it. That application may itself be a bootloader that needs to validate another EFI application before running it, and the shim lock protocol exists to support that.

Implementations§

source§

impl ShimLock

source

pub fn verify(&self, buffer: &[u8]) -> Result

Verify that an EFI application is signed by the certificate embedded in shim.

The buffer’s size must fit in a u32; if that condition is not met then a BAD_BUFFER_SIZE error will be returned and the shim lock protocol will not be called.

source

pub fn hash(&self, buffer: &[u8], hashes: &mut Hashes) -> Result

Compute the Authenticode Hash of the provided EFI application.

The buffer’s size must fit in a u32; if that condition is not met then a BAD_BUFFER_SIZE error will be returned and the shim lock protocol will not be called.

Trait Implementations§

source§

impl Debug for ShimLock

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Identify for ShimLock

source§

const GUID: Guid = _

Unique protocol identifier.
source§

impl Protocol for ShimLock

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<P> ProtocolPointer for P
where P: Protocol,

source§

unsafe fn ptr_from_ffi(ptr: *const c_void) -> *const P

Create a const pointer to a Protocol from a c_void pointer. Read more
source§

unsafe fn mut_ptr_from_ffi(ptr: *mut c_void) -> *mut P

Create a mutable pointer to a Protocol from a c_void pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.