Skip to content

Feat/v2 onecrypto ecit - #279

Draft
Doug Flick (Flickdm) wants to merge 8 commits into
microsoft:feat/v2-onecryptofrom
Flickdm:feat/v2-onecrypto-ecit
Draft

Feat/v2 onecrypto ecit#279
Doug Flick (Flickdm) wants to merge 8 commits into
microsoft:feat/v2-onecryptofrom
Flickdm:feat/v2-onecrypto-ecit

Conversation

@Flickdm

Copy link
Copy Markdown
Member

Description

<Include a description of the change and why this change was made.>

For details on how to complete these options and their meaning refer to CONTRIBUTING.md.

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

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.>

@mu-automation mu-automation Bot added impact:non-functional Does not have a functional impact language:python Pull requests that update Python code labels Aug 13, 2026
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>
The prototyping MU_BASECORE pin tracked microsoft/mu_basecore
dev/202511/post-quantum-staging, which does not declare the ECIT
capability GUIDs (gCryptoOpCmsVerifyGuid, gCryptoOpAuthenticodeVerifyGuid)
or GetCryptoOpCapability that OpensslPkg BaseCryptLib now consumes. CI
Pre-Build therefore failed with "Value of Guid [gCryptoOpCmsVerifyGuid]
is not found under [Guids] section".

Point the pin at flickdm/mu_basecore feat/ecit-capability-reporting
(post-quantum-staging + the three ECIT contract commits) so the
GetCryptoOpCapability build resolves the GUIDs. Update both the CI
(.pytool/CISettings.py) and OneCrypto driver build
(OneCryptoPkg/DriverBuild.py) manifests.

Drop this commit once the ECIT APIs land on a released mu_basecore commit.
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:non-functional Does not have a functional impact language:python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant