-
Notifications
You must be signed in to change notification settings - Fork 294
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
Add validation function for Microsoft signing #531
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static storage modifier has been removed from variables and functions. This is (a) an unrelated change and (b) wrong, they are static (this also removes the need for the = 0 initializer at the top).
Thank Julian's comment. About: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the nx compat default is a separate PR. Either drop the change or depend on that commit.
Thank Frozencemetery's comment. Yes, you are right. The nx compat default is a separate PR. I will drop the NX change. |
A validation function is added to post-process-pe.c to verify 3 flags required by Microsoft signing right after each EFI file has been built. Like other functions existing in post-process-pe.c, this function can be enabled through the "-m" flag by CLI command. Default is enabled. The output is something like this: ./post-process-pe -vv shim.efi set_dll_characteristics():358: Updating DLL Characteristics from 0x0000 to 0x0100 ms_validation():373: NX-Compat-Flag: PASS ms_validation():378: 4K-Alignment: PASS ms_validation():390: Section-Wr-Exe: PASS Microsoft is enforcing the validationis for all applications to be signed by the Microsoft third-party Unified Extensible Firmware Interface (UEFI) Certificate Authority (CA). These validations include: - Section Alignment of the submitted PE file must be aligned with page size. This must be 4kb. - Section Flags must not combine IMAGE_SCN_MEM_WRITE and IMAGE_SCN_MEM_EXECUTE for any given section. - DLL Characteristics must include IMAGE_DLLCHARACTERISTICS_NX_COMPAT Please refer the following for more details: https://techcommunity.microsoft.com/t5/hardware-dev-center/new-uefi-ca-memory-mitigation-requirements-for-signing/ba-p/3608714 recover "static" storage modifier. recover "set_nx_compat" to false. Signed-off-by: Dennis Tseng <[email protected]>
* update the key + add cert in PEM format * add validation function for signing from rhboot/shim#531.
A validation function is added to post-process-pe.c to verify 3 flags required by Microsoft signing right after each EFI file has been built.
Like other functions existing in post-process-pe.c, this function can be enabled through the "-m" flag by CLI command. Default is enabled.
The output is something like this:
./post-process-pe -vv shim.efi
set_dll_characteristics():358: Updating DLL Characteristics from 0x0000 to 0x0100 ms_validation():373: NX-Compat-Flag: PASS
ms_validation():378: 4K-Alignment: PASS
ms_validation():390: Section-Wr-Exe: PASS
Microsoft is enforcing the validationis for all applications to be signed by the Microsoft third-party Unified Extensible Firmware Interface (UEFI) Certificate Authority (CA). These validations include:
Please refer the following for more details:
https://techcommunity.microsoft.com/t5/hardware-dev-center/new-uefi-ca-memory-mitigation-requirements-for-signing/ba-p/3608714
Signed-off-by: Dennis Tseng [email protected]