[DRAFT][WIP] SecurityPkg: DxeImageValidationLib rewrite#1809
[DRAFT][WIP] SecurityPkg: DxeImageValidationLib rewrite#1809Javagedes wants to merge 12 commits into
Conversation
⏳ QEMU Validation In ProgressA new QEMU validation run has started. Results from any previous run(s) are now outdated.
Workflow run: https://github.com/microsoft/mu_basecore/actions/runs/27289352428 This comment was automatically generated by the Mu QEMU PR Validation workflow. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/202511 #1809 +/- ##
=================================================
Coverage ? 1.10%
=================================================
Files ? 1477
Lines ? 377980
Branches ? 4863
=================================================
Hits ? 4160
Misses ? 372901
Partials ? 919
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I wasn't sure about adding the AI skills to this repo. But in any case, it shouldn't be included in this PR. |
07ae785 to
c5f9a3d
Compare
Adds two additional fields of PE_COFF_LOADER_IMAGE_CONTEXT: 1. `DataDirectoryRead`: An optional caller provided callback to to execute code on the given `EFI_IMAGE_DATA_DIRECTORY` 2. `DataDirectoryReadContext`: An optional caller provided opaque pointer that can be used by `DataDirectoryRead`.
Adds a API to the BaseCryptLib Library that accepts a image buffer and a hash type guid and returns a digest buffer and size.
Adds an API to the BaseCryptLib that accepts an X.509 buffer and a hash type guid and returns a digest buffer and size
merge into boilerplate
Adds the policy verification implementation and security data directory lookup to determine if image validation is necessary, and if so, which method to use (ValidateUnsignedImage vs ValidateSignedImage). Additionally includes unit tests for Policy.c and Support.c
Adds functionality for the full path of ValidateUnsignedImage and adds tests for the code.
…ntation Adds an implementation for ValidateSignedImage and adds unit tests. NOTE: IsSignedImageRevoked is still a stub. WIP.
c5f9a3d to
8140e11
Compare
1333d6a to
a38aaf1
Compare
|
I checked the code with AI. It seems the code does not handle 2 cases:
I have not got chance to review all the code yet. Maybe I am wrong. But I feel we have better have a test to cover that. |
…alidateSignedImage
Description
This is a complete rewrite of DxeImageValidationLib.
Please review the Scenario scoped tests found in
GoogleTest/DxeImageVerificationLibGoogleTest.cpp.Notable differences from original implementation:
ALWAYS_EXECUTE. Anything else is set toDENY_EXECUTE_ON_SECURITY_VIOLATIONand must go through the handler. There are no longer PCDs to configure Policy for certain scenarios.TODOS
IsSignedImageRevoked