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 pontential issue
in the sbat validation. If the singature is not checked first,
an attacker can just create a file with a valid .sbat section
and can still attack the signature valiation.

Signed-off-by: Jan Setje-Eilers <Jan.SetjeEilers@oracle.com>
  • Loading branch information
jsetje committed Jun 27, 2023
1 parent 569270d commit 9bab341
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 9bab341

Please sign in to comment.