mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-07-24 15:28:51 +00:00
Boot unsigned binaries if we're not in secure mode
read_header would fail if the binary was unsigned, even if we weren't then going to verify the signature. Move that check to the verify function instead.
This commit is contained in:
parent
cbe214072b
commit
832e5161b5
10
shim.c
10
shim.c
@ -625,6 +625,11 @@ static EFI_STATUS verify_buffer (char *data, int datasize,
|
||||
WIN_CERTIFICATE_EFI_PKCS *cert;
|
||||
unsigned int size = datasize;
|
||||
|
||||
if (context->SecDir->Size == 0) {
|
||||
Print(L"Empty security header\n");
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
cert = ImageAddress (data, size, context->SecDir->VirtualAddress);
|
||||
|
||||
if (!cert) {
|
||||
@ -737,11 +742,6 @@ static EFI_STATUS read_header(void *data, unsigned int datasize,
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (context->SecDir->Size == 0) {
|
||||
Print(L"Empty security header\n");
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user