fix(shim): reflect the const pointer-ness of the verifiable data

This commit is contained in:
2025-11-02 02:45:25 -05:00
parent c34462b812
commit d4bcfcd9b1

View File

@@ -124,7 +124,7 @@ pub enum ShimVerificationOutput {
#[unsafe_protocol(ShimSupport::SHIM_LOCK_GUID)] #[unsafe_protocol(ShimSupport::SHIM_LOCK_GUID)]
struct ShimLockProtocol { struct ShimLockProtocol {
/// Verify the data in `buffer` with the size `buffer_size` to determine if it is valid. /// Verify the data in `buffer` with the size `buffer_size` to determine if it is valid.
pub shim_verify: unsafe extern "efiapi" fn(buffer: *mut c_void, buffer_size: u32) -> Status, pub shim_verify: unsafe extern "efiapi" fn(buffer: *const c_void, buffer_size: u32) -> Status,
/// Unused function that is defined by the shim. /// Unused function that is defined by the shim.
_generate_header: *mut c_void, _generate_header: *mut c_void,
/// Unused function that is defined by the shim. /// Unused function that is defined by the shim.
@@ -202,8 +202,9 @@ impl ShimSupport {
// SAFETY: The shim verify function is specified by the shim lock protocol. // SAFETY: The shim verify function is specified by the shim lock protocol.
// Calling this function is considered safe because the shim verify function is // Calling this function is considered safe because the shim verify function is
// guaranteed to be defined by the environment if we are able to acquire the protocol. // guaranteed to be defined by the environment if we are able to acquire the protocol.
let status = let status = unsafe {
unsafe { (protocol.shim_verify)(buffer.as_ptr() as *mut c_void, buffer.len() as u32) }; (protocol.shim_verify)(buffer.as_ptr() as *const c_void, buffer.len() as u32)
};
// 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() {