Skip to content

Commit

Permalink
Verify signature before verifying sbat levels
Browse files Browse the repository at this point in the history
Verifying the validity of a files signature can protect from
an attacker creating a file that exploits a potential issue
in the sbat validation. If the signature is not checked first,
an attacker can just create a file with a valid .sbat section
and can still attack the signature validation.

Signed-off-by: Jan Setje-Eilers <[email protected]>
  • Loading branch information
jsetje authored and vathpela committed Jun 27, 2023
1 parent 569270d commit 61e9894
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,11 +753,11 @@ verify_buffer (char *data, int datasize,
{
EFI_STATUS efi_status;

efi_status = verify_buffer_sbat(data, datasize, context);
efi_status = verify_buffer_authenticode(data, datasize, context, sha256hash, sha1hash);
if (EFI_ERROR(efi_status))
return efi_status;

return verify_buffer_authenticode(data, datasize, context, sha256hash, sha1hash);
return verify_buffer_sbat(data, datasize, context);
}

static int
Expand Down

0 comments on commit 61e9894

Please sign in to comment.