mok/mok.c
BOOLEAN ShimValidate (VOID *data, UINT32 size)
{
   SHIM_LOCK   *shim_lock;
   EFI_GUID    ShimLockGuid = SHIM_LOCK_GUID;

   if ((data != NULL) && (refit_call3_wrapper(BS->LocateProtocol, &ShimLockGuid, NULL, (VOID**) &shim_lock) == EFI_SUCCESS)) {
      if (!shim_lock)
         return FALSE;

      if (shim_lock->shim_verify(data, size) == EFI_SUCCESS)
         return TRUE;
   }

   return FALSE;
}
// The following is based on the grub_linuxefi_secure_validate() function in Fedora's
// version of GRUB 2.
// Returns TRUE if the specified data is validated by Shim's MOK, FALSE otherwise
The following is based on the grub_linuxefi_secure_validate() function in Fedora's
version of GRUB 2.
Returns TRUE if the specified data is validated by Shim's MOK, FALSE otherwise
The following is based on the grub_linuxefi_secure_validate () function in Fedora ' s version of GRUB 2 . Returns TRUE if the specified data is validated by Shim ' s MOK FALSE otherwise
BOOLEAN ShimValidate (VOID *data, UINT32 size)
{
   SHIM_LOCK   *shim_lock;
   EFI_GUID    ShimLockGuid = SHIM_LOCK_GUID;
   if ((data != NULL) && (refit_call3_wrapper(BS->LocateProtocol, &ShimLockGuid, NULL, (VOID**) &shim_lock) == EFI_SUCCESS)) {
      if (!shim_lock)
         return FALSE;
      if (shim_lock->shim_verify(data, size) == EFI_SUCCESS)
         return TRUE;
   }
   return FALSE;
}
BOOLEAN ShimValidate ( VOID * data , UINT32 size ) { SHIM_LOCK * shim_lock ; EFI_GUID ShimLockGuid = SHIM_LOCK_GUID ; if ( ( data != NULL ) && ( refit_call3_wrapper ( BS -> LocateProtocol , & ShimLockGuid , NULL , ( VOID * * ) & shim_lock ) == EFI_SUCCESS ) ) { if ( ! shim_lock ) return FALSE ; if ( shim_lock -> shim_verify ( data , size ) == EFI_SUCCESS ) return TRUE ; } return FALSE ; }
The following is based on the grub_linuxefi_secure_validate() function in Fedora's
version of GRUB 2.
The following is based on the grub_linuxefi_secure_validate () function in Fedora ' s version of GRUB 2 .