Build: Detect and strip PKCS#7 ContentInfo wrappers in KEK updates#403
Merged
Flickdm merged 1 commit intomicrosoft:mainfrom Apr 23, 2026
Merged
Conversation
Some KEK update files are generated with an outer ContentInfo SEQUENCE wrapping the SignedData blob. Older EDK2-based firmware expects raw SignedData directly in WIN_CERTIFICATE_UEFI_GUID.CertData; ContentInfo support was only added recently in: tianocore/edk2@37d3eb0 This is normally because the tool that used wanted to sign it in a "normal" way where the code in UEFI is anything but normal. If we strip off the ContentInfo(..) we have a greater chance of supporting platforms stuck on older UEFI firmware. Signed-of-by: Doug Flick <dougflick@microsoft.com>
43f098f to
7ff26e3
Compare
3 tasks
apop5
approved these changes
Apr 23, 2026
Javagedes
approved these changes
Apr 23, 2026
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.
Description
Some KEK update files are generated with an outer ContentInfo SEQUENCE wrapping the SignedData blob. Older EDK2-based firmware expects raw SignedData directly in WIN_CERTIFICATE_UEFI_GUID.CertData; ContentInfo support was only added recently in:
tianocore/edk2@37d3eb0
This is normally because the tool that used wanted to sign it in a "normal" way where the code in UEFI is anything but normal.
If we strip off the ContentInfo(..) we have a greater chance of supporting platforms stuck on older UEFI firmware.
So while not invalid - and for newer machines is fine - older firmware may pose an issue.
For details on how to complete these options and their meaning refer to CONTRIBUTING.md.
How This Was Tested
Tested with a known binary with this issue
KEK Validation Results
PostSignedObjects/KEK/Test/KEKUpdate_PK_WITH_CONTENT_INFO.binFile Hashes (SHA-256)
Command Output
PostSignedObjects/KEK/Test/KEKUpdate_PK_WITH_CONTENT_INFO.bin
{ "validation_date": "2026-04-23T00:50:24.707627+00:00", "file": "PostSignedObjects/KEK/Test/KEKUpdate_PK_WITH_CONTENT_INFO.bin", "parameters": { "var_name": "KEK", "var_guid": "8be4df61-93ca-11d2-aa0d-00e098032b8c", "attributes": "NV,BS,RT,AT,AP" }, "result": { "filename": "KEKUpdate_PK_WITH_CONTENT_INFO.bin", "path": "PostSignedObjects/KEK/Test/KEKUpdate_PK_WITH_CONTENT_INFO.bin", "valid": true, "payload_hash_valid": true, "content_info_wrapped": true, "error": null, "warnings": [ "cert_data contains a PKCS#7 ContentInfo wrapper. " ], "details": { "verified": true }, "payload_hash": "5b85333c009d7ea55cbb6f11a5c2ff45ee1091a968504c929aed25c84674962f", "payload_size": 1506 } }Reproduce Locally
Integration Instructions
N/A