Skip to content
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 RT DXE Shared Crypto [Rebase & FF] #67

Merged

Conversation

makubacki
Copy link
Member

@makubacki makubacki commented Feb 13, 2024

Description

Closes #55

Primary purpose is to add Runtime DXE shared crypto. Other fixes and
updates are included. Below is a summary of the changes.


OpensslPkg/RuntimeCryptLib: Fix build issues

UefiRuntimeLib needs to be included in [LibaryClasses] to properly
link the functions. gEfiEventVirtualAddressChangeGuid is missing
in the [Guids] section.


generate_cryptodriver.py: Fix migration regression

The migration commit (455ca6b) contained an older section of code in
the DSC generation section. This restores the section to match the
contents in microsoft/mu_basecore#713.


Use SHARED_CRYPTO_PATH for the shared crypto path

In CryptoBinPkg, some files (like Crypto.inc.dsc) are used during
the build. This should come from the latest revisions in the
mu_crypto_release repo (which doesn't use the actual binaries).

In consuming repos, the ext dep could be defined anywhere. To
satisfy both of these needs and make the location more portable in
general, a build environment variable is introduced to track the
path.

In mu_crypto_release, the path will be set to "CryptoBinPkg". This
will cause its build to reference the files in the code tree. In
shared crypto consuming repos, it is set in the ext dep (during build)
to the path the binaries are placed in.


Add shared crypto Runtime DXE driver

Adds the CryptoRuntimeDxe driver, currently built for IA32 and X64,
it produces the EDK II Crypto protocol backed by runtime code buffers
so the functionality can be invoked at OS runtime.

Consuming RT DXE drivers should link an instance of BaseCryptLib
that is RT DXE compatible, like the RuntimeDxeCryptLib in
CryptoPkg.

RUNTIMEDXE_CRYPTO_SERVICES and RUNTIMEDXE_CRYPTO_ARCH should be set
in platform DSC files to a value other than "NONE" to use the driver.


Update readmes for recent changes

Refreshes content in the main repo and shared crypto readme files
to reflect recent changes and current process.


  • Impacts functionality?
    • Functionality - Does the change ultimately impact how firmware functions?
    • Examples: Add a new library, publish a new PPI, update an algorithm, ...
  • Impacts security?
    • Security - Does the change have a direct security impact on an application,
      flow, or firmware?
    • Examples: Crypto algorithm change, buffer overflow fix, parameter
      validation improvement, ...
  • Breaking change?
    • Breaking change - Will anyone consuming this change experience a break
      in build or boot behavior?
    • Examples: Add a new library class, move a module to a different repo, call
      a function in a new library class in a pre-existing module, ...
  • Includes tests?
    • Tests - Does the change include any explicit test code?
    • Examples: Unit tests, integration tests, robot tests, ...
  • Includes documentation?
    • Documentation - Does the change contain explicit documentation additions
      outside direct code modifications (and comments)?
    • Examples: Update readme file, add feature readme file, link to documentation
      on an a separate Web page, ...

How This Was Tested

  • Local flavor build and assembly
  • Test binaries produced on QemuQ35Pkg and QemuSbsaPkg

Integration Instructions

Use the new Runtime DXE shared crypto binaries if needed for a
platform.

UefiRuntimeLib needs to be included in [LibaryClasses] to properly
link the functions. gEfiEventVirtualAddressChangeGuid is missing
in the [Guids] section.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
The migration commit (455ca6b) contained an older section of code in
the DSC generation section. This restores the section to match the
contents in microsoft/mu_basecore#713.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
In CryptoBinPkg, some files (like Crypto.inc.dsc) are used during
the build. This should come from the latest revisions in the
mu_crypto_release repo (which doesn't use the actual binaries).

In consuming repos, the path will likely come from MU_BASECORE.
Tehcnically, the ext dep could be defined anywhere. To satisfy
both of these needs and make the location more portable in
general, an environment variable is introduced to track the
path.

In mu_crypto_release, the path will be set to "CryptoBinPkg". In
shared crypto consuming repos, it will be set in the ext dep to
the path the binaries are placed in.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Currently built for IA32 and X64, the CryptoRuntimeDxe driver
produces the EDK II Crypto protocol backed by runtime code buffers
so the functionality can be invoked at OS runtime.

Consuming RT DXE drivers should link an instance of BaseCryptLib
that is RT DXE compatible, like the RuntimeDxeCryptLib in
CryptoPkg.

RUNTIMEDXE_CRYPTO_SERVICES and RUNTIMEDXE_CRYPTO_ARCH should be set
in platform DSC files to a value other than "NONE" to use the driver.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
@makubacki makubacki added type:enhancement New feature or pull request type:design-change A new proposal or modification to a feature design type:bug Something isn't working labels Feb 13, 2024
@makubacki makubacki self-assigned this Feb 13, 2024
@github-actions github-actions bot added language:python Pull requests that update Python code type:documentation Improvements or additions to documentation labels Feb 13, 2024
Refreshes content in the main repo and shared crypto readme files
to reflect recent changes and current process.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
@makubacki makubacki force-pushed the add_rt_dxe_shared_crypto branch from e86b9fa to c31490d Compare February 13, 2024 02:11
@makubacki makubacki merged commit 1a86e7f into microsoft:release/202302 Feb 14, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language:python Pull requests that update Python code type:bug Something isn't working type:design-change A new proposal or modification to a feature design type:documentation Improvements or additions to documentation type:enhancement New feature or pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Add Runtime DXE shared crypto support
3 participants