summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2012-09-19 14:54:35 +0800
committerGary Ching-Pang Lin <glin@suse.com>2012-09-19 14:54:35 +0800
commit5d4b6ba037014fc9d4b390bb607c678bdf965015 (patch)
tree0952c00fcbeef4ec54ae9b748571f3fa2478efc5
parented2ecf86550655d83d73bbc56a5874f36d2eeb3f (diff)
downloadefi-boot-shim-5d4b6ba037014fc9d4b390bb607c678bdf965015.tar.gz
efi-boot-shim-5d4b6ba037014fc9d4b390bb607c678bdf965015.zip
Abandon the variable, MokMgmt
-rw-r--r--shim.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/shim.c b/shim.c
index 2d034141..d91005c1 100644
--- a/shim.c
+++ b/shim.c
@@ -1064,17 +1064,18 @@ EFI_STATUS check_mok_request(EFI_HANDLE image_handle)
{
EFI_GUID shim_lock_guid = SHIM_LOCK_GUID;
EFI_STATUS efi_status;
- UINTN uint8size = sizeof(UINT8);
- UINT8 MokMgmt = 0;
+ UINTN size = sizeof(UINT32);
+ UINT32 MokNew;
UINT32 attributes;
if (!secure_mode())
return EFI_SUCCESS;
- efi_status = get_variable(L"MokMgmt", shim_lock_guid, &attributes,
- &uint8size, (void *)&MokMgmt);
+ efi_status = uefi_call_wrapper(RT->GetVariable, 5, L"MokNew",
+ &shim_lock_guid, &attributes,
+ &size, (void *)&MokNew);
- if (efi_status != EFI_SUCCESS || MokMgmt == 0)
+ if (efi_status != EFI_SUCCESS && efi_status != EFI_BUFFER_TOO_SMALL)
goto done;
efi_status = start_image(image_handle, MOK_MANAGER);
@@ -1083,13 +1084,8 @@ EFI_STATUS check_mok_request(EFI_HANDLE image_handle)
Print(L"Failed to start MokManager\n");
goto done;
}
-done:
- if (MokMgmt == 1) {
- if (delete_variable(L"MokMgmt", shim_lock_guid) != EFI_SUCCESS) {
- Print(L"Failed to delete MokMgmt\n");
- }
- }
+done:
return efi_status;
}