summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2012-10-02 11:55:44 +0800
committerGary Ching-Pang Lin <glin@suse.com>2012-10-02 11:55:44 +0800
commitf3104a73140791cfe85a6e441881cba8410ddc83 (patch)
treee7df4c784d773e65cd75694b28883a853623cfb5
parentaa8e90679dc9bedb498db44b045af19766e79c83 (diff)
downloadefi-boot-shim-f3104a73140791cfe85a6e441881cba8410ddc83.tar.gz
efi-boot-shim-f3104a73140791cfe85a6e441881cba8410ddc83.zip
Use LibDeleteVariable in gnu-efi
-rw-r--r--MokManager.c14
-rw-r--r--shim.c12
2 files changed, 3 insertions, 23 deletions
diff --git a/MokManager.c b/MokManager.c
index 89c0967e..8a2ec215 100644
--- a/MokManager.c
+++ b/MokManager.c
@@ -39,16 +39,6 @@ static EFI_STATUS get_variable (CHAR16 *name, EFI_GUID guid, UINT32 *attributes,
return efi_status;
}
-static EFI_STATUS delete_variable (CHAR16 *name, EFI_GUID guid)
-{
- EFI_STATUS efi_status;
-
- efi_status = uefi_call_wrapper(RT->SetVariable, 5, name, &guid,
- 0, 0, (UINT8 *)NULL);
-
- return efi_status;
-}
-
static EFI_INPUT_KEY get_keystroke (void)
{
EFI_INPUT_KEY key;
@@ -671,12 +661,12 @@ static EFI_STATUS check_mok_request(EFI_HANDLE image_handle)
}
error:
if (MokNew) {
- if (delete_variable(L"MokNew", shim_lock_guid) != EFI_SUCCESS) {
+ if (LibDeleteVariable(L"MokNew", &shim_lock_guid) != EFI_SUCCESS) {
Print(L"Failed to delete MokNew\n");
}
FreePool (MokNew);
}
- delete_variable(L"MokAuth", shim_lock_guid);
+ LibDeleteVariable(L"MokAuth", &shim_lock_guid);
return EFI_SUCCESS;
}
diff --git a/shim.c b/shim.c
index 95c3e544..479007b2 100644
--- a/shim.c
+++ b/shim.c
@@ -92,16 +92,6 @@ static EFI_STATUS get_variable (CHAR16 *name, EFI_GUID guid, UINT32 *attributes,
return efi_status;
}
-static EFI_STATUS delete_variable (CHAR16 *name, EFI_GUID guid)
-{
- EFI_STATUS efi_status;
-
- efi_status = uefi_call_wrapper(RT->SetVariable, 5, name, &guid,
- 0, 0, (UINT8 *)NULL);
-
- return efi_status;
-}
-
static MokListNode *build_mok_list(UINT32 num, void *Data, UINTN DataSize) {
MokListNode *list;
int i, remain = DataSize;
@@ -612,7 +602,7 @@ static EFI_STATUS verify_buffer (char *data, int datasize,
if (attributes & EFI_VARIABLE_RUNTIME_ACCESS) {
Print(L"MokList is compromised!\nErase all keys in MokList!\n");
- if (delete_variable(L"MokList", shim_lock_guid) != EFI_SUCCESS) {
+ if (LibDeleteVariable(L"MokList", &shim_lock_guid) != EFI_SUCCESS) {
Print(L"Failed to erase MokList\n");
}
status = EFI_ACCESS_DENIED;