[PQC] Feature ECIT - #279
Draft
Doug Flick (Flickdm) wants to merge 11 commits into
Draft
Doug Flick (Flickdm) wants to merge 11 commits into
Doug Flick (Flickdm) wants to merge 11 commits into
Conversation
Doug Flick (Flickdm)
force-pushed
the
feat/v2-onecrypto-ecit
branch
from
August 24, 2026 16:59
21aaca8 to
6dc093d
Compare
Doug Flick (Flickdm)
force-pushed
the
feat/v2-onecrypto
branch
2 times, most recently
from
September 4, 2026 23:43
4218191 to
0f4dc69
Compare
Doug Flick (Flickdm)
force-pushed
the
feat/v2-onecrypto-ecit
branch
from
September 17, 2026 20:57
6dc093d to
965b4ad
Compare
Doug Flick (Flickdm)
force-pushed
the
feat/v2-onecrypto-ecit
branch
from
September 17, 2026 22:52
965b4ad to
a321584
Compare
Signed-off-by: Doug Flick <dougflick@microsoft.com>
Remove the obsolete GetAuthenticodeHash() protocol registration so the provider ABI matches the corresponding MU_BASECORE CryptoPkg API removal. Squash with the corresponding MU_BASECORE CryptoPkg API removal. Signed-off-by: Doug Flick <dougflick@microsoft.com>
Return the gEfiHashAlgorithmSha*Guid value described by GetAuthenticodeHashAlgorithm() instead of the corresponding certificate signature GUID. Signed-off-by: Doug Flick <dougflick@microsoft.com>
Doug Flick (Flickdm)
force-pushed
the
feat/v2-onecrypto-ecit
branch
from
September 21, 2026 21:54
a321584 to
ab4cbb5
Compare
Doug Flick (Flickdm)
force-pushed
the
feat/v2-onecrypto-ecit
branch
from
September 21, 2026 22:14
ab4cbb5 to
5848fd3
Compare
Introduce the Extensible Crypto Information Table (ECIT) capability
reporting framework in BaseCryptLib. The framework enumerates the
signature algorithm OIDs supported by the linked OpenSSL provider
for PKCS#7 verify and Authenticode verify operations.
Architecture:
- CryptOpCapability.h declares the engine entry point, the per-op
signature-acceptance predicate typedef, and shared handler protos.
- Pk/CryptOpCapabilityCommon.c hosts the engine: state tracking
(Written vs Committed for ASan-clean two-pass sizing), Pass A
(legacy RSA/ECDSA OID enumeration) and Pass B (provider signature
enumeration with dedupe), and predicate-driven filtering.
- Pk/CryptPkcs7OpCapability.c contributes the PKCS#7 policy
(accept-all signature algorithms exposed by the provider).
- Pk/CryptAuthenticodeOpCapability.c contributes the Authenticode
policy (accept only digests in {sha1, sha256, sha384, sha512}).
- Info/CryptInfo.c routes GetCryptoOpCapability calls through a
slim dispatch table keyed on the operation GUID.
Live capability sets:
PKCS#7 verify (14 OIDs): RSA+MD5/SHA1/SHA224/SHA256/SHA384/SHA512,
ECDSA+SHA1/SHA224/SHA256/SHA384/SHA512,
ML-DSA-44/65/87
Authenticode ( 8 OIDs): RSA+SHA1/SHA256/SHA384/SHA512,
ECDSA+SHA1/SHA256/SHA384/SHA512
Adding a new operation requires a single new Pk/Crypt<Op>OpCapability.c
predicate+handler plus a one-line dispatch row.
Signed-off-by: Doug Flick <dougflick@microsoft.com>
Rename the ECIT capability-reporting operation and its handler from the
PKCS#7-specific name to the CMS-oriented name that matches the new
public CmsVerify() interface. The set of accepted algorithms is
unchanged; this is a naming and dispatch update only.
- Rename Pk/CryptPkcs7OpCapability.c to Pk/CryptCmsOpCapability.c,
the handler Pkcs7VerifyOpCapability() to CmsVerifyOpCapability(),
and the predicate Pkcs7Accept() to CmsAccept().
- Info/CryptInfo.c: dispatch gCryptoOpCmsVerifyGuid to the renamed
handler; include <Guid/CryptoOpId.h> after InternalCryptLib.h so
EFI_GUID is defined first.
- CryptAuthenticodeOpCapability.c: delegate to CmsVerifyOpCapability().
- BaseCryptLib.inf, UnitTestHostBaseCryptLib.inf: update the [Sources]
entry and the [Guids] reference to gCryptoOpCmsVerifyGuid.
Signed-off-by: Doug Flick <dougflick@microsoft.com>
Add a CmsVerify() stub to the OpensslPkg BaseCryptLib Null instance now that CmsVerify() is part of the public BaseCryptLib class. Signed-off-by: Doug Flick <dougflick@microsoft.com>
Provide CmsVerify() for the MbedTlsPkg BaseCryptLib backend now that CmsVerify() is part of the public class. It forwards to Pkcs7Verify() when no signer chain is requested; MbedTLS cannot return the verified signer chain, so a chain request returns FALSE. Also add a CmsVerify() stub to the Null instance. Signed-off-by: Doug Flick <dougflick@microsoft.com>
Assign CmsVerify to the v1.2 OneCrypto protocol in OneCryptoBin so the shipped provider exposes the newly public CmsVerify() implementation. Signed-off-by: Doug Flick <dougflick@microsoft.com>
Assign the GetCryptoOpCapability service (v1.3) in the OneCrypto binary's protocol population so the built provider exposes the ECIT capability query to consumers, matching the CryptoPkg ONE_CRYPTO_PROTOCOL 1.3 definition. Reflects the in-discussion UEFI Code First item tianocore/edk2#12408 and is subject to change until ratified. Signed-off-by: Doug Flick <dougflick@microsoft.com>
Add AuthenticodeHashOpCapability(), dispatched for gCryptoOpAuthenticodeHashGuid, which reports the PE/COFF Authenticode image-hash (digest) algorithms the library supports as a CSV of dotted OIDs (SHA-1/256/384/512). The list is derived from the same mAuthHashInfo table used by GetAuthenticodeHash() by probing each digest's availability, and cached on first use. This lets a feature owner (e.g. image verification) report the digest algorithms it can compute alongside the signature algorithms it verifies. Signed-off-by: Doug Flick <dougflick@microsoft.com>
Add the gCryptoOpCmsContentDigestGuid capability handler so the ECIT collector can report the digest (content pre-hash) OIDs usable in CMS SignedData -- the message-digest algorithms an ML-DSA (or any) signer relies on. The set is enumerated live from the linked OpenSSL provider via EVP_MD_do_all_provided, so UEFI carries no static digest allowlist; extendable-output functions are excluded because the CMS content-digest path cannot finalize them to a fixed length. Also keep the shared signature enumerator a faithful mirror of the provider: Pass A now skips XOF digests and only emits legacy (digest, key) composite OIDs for key types the provider actually implements, since OBJ_find_sigid_by_algs consults a static table that does not know what the build ships. Signed-off-by: Doug Flick <dougflick@microsoft.com>
Doug Flick (Flickdm)
force-pushed
the
feat/v2-onecrypto-ecit
branch
from
September 21, 2026 22:40
5848fd3 to
c0695b0
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.
Description
This pull request introduces a new extensible capability reporting mechanism (ECIT) for cryptographic operations in BaseCryptLib, allowing consumers to query supported algorithms at runtime via operation-specific GUIDs. It adds a dispatcher and per-operation handlers, integrates new CMS and Authenticode capability queries, and updates the protocol interface to expose these features. Additionally, some internal data structures are updated to include OID information.
Capability Reporting (ECIT) Mechanism:
GetCryptoOpCapability) inInfo/CryptInfo.cthat maps operation GUIDs to per-op handler functions, enabling runtime queries of supported cryptographic algorithms for CMS and Authenticode operations. The dispatcher and its handlers are documented and structured for easy extensibility. [1] [2]Pk/CryptOpCapabilityCommon.c,Pk/CryptCmsOpCapability.c,Pk/CryptAuthenticodeOpCapability.c) to enumerate supported signature and digest OIDs directly from the linked OpenSSL provider, ensuring no static allowlists are used.Protocol and Interface Updates:
BaseCryptLib.inf) and exposed them via the protocol interface, allowing external consumers to discover supported CMS and Authenticode algorithms. [1] [2]OneCryptoBin.cto wire up the newCmsVerifyandGetCryptoOpCapabilityfunctions, and re-grouped function assignments by version for clarity.CMS and Authenticode Handler Additions:
CmsVerifyimplementations for both MbedTLS and Null backends, with the MbedTLS backend explicitly rejecting requests for signer chains (not supported), and the Null backend returningFALSEfor all calls. [1] [2]Internal Data Structure Enhancements:
AUTH_HASH_INFOstructure inCryptAuthenticodeHash.cto include the dotted-decimal OID for each supported hash algorithm, enabling accurate OID reporting in capability payloads. [1] [2]Code Organization and Documentation:
CryptOpCapability.h) to declare internal interfaces and document the architecture, design rules, and handler prototypes for capability reporting.These changes collectively enable dynamic, provider-driven reporting of supported cryptographic algorithms, improving maintainability and future-proofing the BaseCryptLib cryptographic interface.
For details on how to complete these options and their meaning refer to CONTRIBUTING.md.
How This Was Tested
<Describe the test(s) that were run to verify the changes.>
Integration Instructions
<Describe how these changes should be integrated. Use N/A if nothing is required.>