Skip to content

Commit d4bcfcd

Browse files
committed
fix(shim): reflect the const pointer-ness of the verifiable data
1 parent c34462b commit d4bcfcd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/integrations/shim.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub enum ShimVerificationOutput {
124124
#[unsafe_protocol(ShimSupport::SHIM_LOCK_GUID)]
125125
struct ShimLockProtocol {
126126
/// Verify the data in `buffer` with the size `buffer_size` to determine if it is valid.
127-
pub shim_verify: unsafe extern "efiapi" fn(buffer: *mut c_void, buffer_size: u32) -> Status,
127+
pub shim_verify: unsafe extern "efiapi" fn(buffer: *const c_void, buffer_size: u32) -> Status,
128128
/// Unused function that is defined by the shim.
129129
_generate_header: *mut c_void,
130130
/// Unused function that is defined by the shim.
@@ -202,8 +202,9 @@ impl ShimSupport {
202202
// SAFETY: The shim verify function is specified by the shim lock protocol.
203203
// Calling this function is considered safe because the shim verify function is
204204
// guaranteed to be defined by the environment if we are able to acquire the protocol.
205-
let status =
206-
unsafe { (protocol.shim_verify)(buffer.as_ptr() as *mut c_void, buffer.len() as u32) };
205+
let status = unsafe {
206+
(protocol.shim_verify)(buffer.as_ptr() as *const c_void, buffer.len() as u32)
207+
};
207208

208209
// If the verification failed, return the verification failure output.
209210
if !status.is_success() {

0 commit comments

Comments
 (0)