Repository navigation
scripts: fix compute_authenticode_hash for unsigned PEs - #440
Merged
Doug Flick (Flickdm) merged 1 commit intoJul 6, 2026
Conversation
Jérémy Compostella (jeremy-compostella)
force-pushed
the
jcompost/fix-compute_authenticode_hash-for-unsigned-PEs
branch
2 times, most recently
from
June 23, 2026 18:17
fcbcb75 to
7737602
Compare
Michael Kubacki (makubacki)
requested review from
SochiOgbuanya and
Jordan Geurten (jgeurten)
June 24, 2026 00:04
Doug Flick (Flickdm)
approved these changes
Jun 30, 2026
Doug Flick (Flickdm)
force-pushed
the
jcompost/fix-compute_authenticode_hash-for-unsigned-PEs
branch
2 times, most recently
from
July 1, 2026 17:57
1b44710 to
6858195
Compare
Aaron (apop5)
approved these changes
Jul 1, 2026
When the PE has no attached certificate the security data directory
fields VirtualAddress and Size are both 0. The previous unconditional
slicing:
pe_data[certificate_table_offset + 0x08 : 0] # -> empty
+ pe_data[0 + 0 :] # -> whole file re-appended
produced a wrong digest for unsigned images.
Add an explicit branch: when VirtualAddress == 0, hash only the bytes
that follow the 8-byte cert-dir data-directory entry, which is the
correct tail of an unsigned PE image.
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Jérémy Compostella (jeremy-compostella)
force-pushed
the
jcompost/fix-compute_authenticode_hash-for-unsigned-PEs
branch
from
July 3, 2026 13:35
6858195 to
b558383
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the PE has no attached certificate the security data directory fields VirtualAddress and Size are both 0. The previous unconditional slicing:
produced a wrong digest for unsigned images.
Add an explicit branch: when VirtualAddress == 0, hash only the bytes that follow the 8-byte cert-dir data-directory entry, which is the correct tail of an unsigned PE image.
Description
When the PE has no attached certificate the security data directory
fields VirtualAddress and Size are both 0. The previous unconditional
slicing:
produced a wrong digest for unsigned images.
How This Was Tested
Generate Authenticode for an unsigned EFI binary and verify successful verification once enrolled in the DB.
Integration Instructions
N/A