mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-05-30 14:32:16 +00:00
Fix check logic for SetupMode variable.
After going back and inspecting this further, the logic for "SetupMode" being present at all was incorrect. Also initialize our state earlier so it's sure to always be set. Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
acac338094
commit
0948ac0971
13
shim.c
13
shim.c
@ -471,11 +471,9 @@ static BOOLEAN secure_mode (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = get_variable(L"SetupMode", &Data, &len, global_var);
|
status = get_variable(L"SetupMode", &Data, &len, global_var);
|
||||||
if (status == EFI_SUCCESS) {
|
if (status != EFI_SUCCESS)
|
||||||
if (verbose)
|
return TRUE;
|
||||||
console_notify(L"Platform is in setup mode\n");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
setupmode = *Data;
|
setupmode = *Data;
|
||||||
FreePool(Data);
|
FreePool(Data);
|
||||||
|
|
||||||
@ -1509,14 +1507,15 @@ static EFI_STATUS check_mok_sb (void)
|
|||||||
UINTN MokSBStateSize = 0;
|
UINTN MokSBStateSize = 0;
|
||||||
UINT32 attributes;
|
UINT32 attributes;
|
||||||
|
|
||||||
|
insecure_mode = 0;
|
||||||
|
ignore_db = 0;
|
||||||
|
|
||||||
status = get_variable_attr(L"MokSBState", &MokSBState, &MokSBStateSize,
|
status = get_variable_attr(L"MokSBState", &MokSBState, &MokSBStateSize,
|
||||||
shim_lock_guid, &attributes);
|
shim_lock_guid, &attributes);
|
||||||
|
|
||||||
if (status != EFI_SUCCESS)
|
if (status != EFI_SUCCESS)
|
||||||
return EFI_ACCESS_DENIED;
|
return EFI_ACCESS_DENIED;
|
||||||
|
|
||||||
insecure_mode = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Delete and ignore the variable if it's been set from or could be
|
* Delete and ignore the variable if it's been set from or could be
|
||||||
* modified by the OS
|
* modified by the OS
|
||||||
|
Loading…
Reference in New Issue
Block a user