Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update override validation to sort files prior to hashing. #1145

Open
wants to merge 1 commit into
base: dev/202405
Choose a base branch
from

Conversation

apop5
Copy link
Contributor

@apop5 apop5 commented Sep 19, 2024

Description

Override validation allows hashing a directory through the -t parameter.

When generating an override validation hash for a directory, it was found that the order of the files can be different when running under linux vs under windows.

To address this discrepancy, a new module hash has been crated ModuleHash2Cal, which sorts the files prior to hashing.

Since existing projects use hashes based on ModuleHashCal, when performing override validation checking, check against the original ModuleHashCal and the ModuleHash2Cal prior to generating an override validation failure.

Generating a new hash value will only use the ModuleHash2Cal.
 

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Tested changes on a project using existing project (to ensure backward compatability)
Tested changes on the project under linux that was failing

Integration Instructions

N/A

@github-actions github-actions bot added the language:python Pull requests that update Python code label Sep 19, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 1.59%. Comparing base (23f8354) to head (f77c86c).

Additional details and impacted files
@@             Coverage Diff             @@
##           dev/202405    #1145   +/-   ##
===========================================
  Coverage        1.59%    1.59%           
===========================================
  Files            1448     1448           
  Lines          362490   362490           
  Branches         5632     5632           
===========================================
  Hits             5776     5776           
  Misses         356607   356607           
  Partials          107      107           
Flag Coverage Δ
MdeModulePkg 0.68% <ø> (ø)
MdePkg 5.42% <ø> (ø)
NetworkPkg 0.55% <ø> (ø)
PolicyServicePkg 30.41% <ø> (ø)
UefiCpuPkg 4.73% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@apop5 apop5 force-pushed the personal/apop5/updateoverridevalidatointosort branch 3 times, most recently from 1e941d2 to fb8e099 Compare September 20, 2024 17:03
@apop5 apop5 changed the base branch from release/202405 to dev/202405 September 20, 2024 17:04
@apop5 apop5 force-pushed the personal/apop5/updateoverridevalidatointosort branch from fb8e099 to f77c86c Compare September 20, 2024 17:07
@apop5 apop5 marked this pull request as ready for review September 20, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language:python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants