1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

shim: fix logically dead code

The alternate verification path could never be taken.

Found by coverity.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-11-27 13:31:46 +00:00
parent 1e40b7490a
commit 8d44f5a637

View File

@ -62,10 +62,7 @@ static BOOLEAN shim_validate(VOID *data, UINT32 size) {
if (!shim_lock)
return FALSE;
if (shim_lock->shim_verify(data, size) == EFI_SUCCESS)
return TRUE;
return FALSE;
return shim_lock->shim_verify(data, size) == EFI_SUCCESS;
}
BOOLEAN secure_boot_enabled(void) {
@ -188,12 +185,10 @@ static EFIAPI EFI_STATUS security_policy_authentication (const EFI_SECURITY_PROT
if (shim_validate(file_buffer, file_size))
status = EFI_SUCCESS;
FreePool(file_buffer);
/* Try using the platform's native policy.... */
if (status != EFI_SUCCESS)
else
/* Try using the platform's native policy.... */
status = uefi_call_wrapper(esfas, 3, this, authentication_status, device_path_const);
FreePool(file_buffer);
return status;
}