Skip to content

Commit

Permalink
[REVERT] Reverts previous commit to update to 2023.2.16, moves to 202…
Browse files Browse the repository at this point in the history
…3.2.15, corrects extdep, removes duplicate files (#913)

## Description

An incorrect assumption was made that the INF's need to be removed from
the CryptoPkgDriver because the MU_BASECORE already had duplicate
entries and this aligned with previous releases (Now unlisted
2023.2.16). This goes back to the working release (2023.2.15) and
updates the extdep accordingly. Further additional (potentially
breaking) changes were required to be made to get the crypto package
working. See commit
5efeb20

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [X] Impacts functionality?
  - Simplifies RNG Support expected of platforms
- platforms integrating the binaries may have very different levels of
support for random number generation,
  -  allow the platform to provide a RNG service for PEI and DXE.
- [ ] Impacts security?
- [X] Breaking change?
  - Platforms are expected to provide a source for RNG 
     - See [this change]

(microsoft/mu_crypto_release@68c7e29)
- Platforms that have a direct dependency on CryptoPkg should now use
`$(SHARED_CRYPTO_PATH)`
  ```inf
    !include $(SHARED_CRYPTO_PATH)/Driver/Bin/CryptoDriver.inc.dsc
  ```
- [ ] Includes tests?
- [X] Includes documentation?

## How This Was Tested
   Built on multiple Release/202302 based platforms 
   Booted to Shell
   
## Integration Instructions
    Platforms are expected to provide a source for RNG [this change]

(microsoft/mu_crypto_release@68c7e29)
    
    MU_TIANO_PLATFORMS may be used as an example

---------

Signed-off-by: Michael Kubacki <[email protected]>
Co-authored-by: Michael Kubacki <[email protected]>
  • Loading branch information
Flickdm and makubacki authored Jun 14, 2024
1 parent 5b00b66 commit b139b75
Show file tree
Hide file tree
Showing 113 changed files with 121 additions and 7,307 deletions.
9 changes: 9 additions & 0 deletions CryptoPkg/Binaries/BaseCryptoDriver_ext_dep.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"scope": "global",
"type": "nuget",
"name": "edk2-basecrypto-driver-bin",
"source": "https://pkgs.dev.azure.com/projectmu/mu/_packaging/Mu-Public/nuget/v3/index.json",
"version": "2023.2.15",
"flags": ["set_build_var"],
"var_name": "BLD_*_SHARED_CRYPTO_PATH"
}
203 changes: 111 additions & 92 deletions CryptoPkg/CryptoPkg.ci.yaml

Large diffs are not rendered by default.

133 changes: 1 addition & 132 deletions CryptoPkg/CryptoPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT

# MU_CHANGE
!include CryptoPkg/Driver/Bin/Crypto.inc.dsc

!include UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc

################################################################################
Expand All @@ -51,39 +48,9 @@
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf # MU_CHANGE: /GS and -fstack-protector support


##MSCHANGE Begin
FltUsedLib|MdePkg/Library/FltUsedLib/FltUsedLib.inf
UnitTestLib|UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.inf
UnitTestPersistenceLib|UnitTestFrameworkPkg/Library/UnitTestPersistenceLibNull/UnitTestPersistenceLibNull.inf
UnitTestBootLib|UnitTestFrameworkPkg/Library/UnitTestBootLibNull/UnitTestBootLibNull.inf
UnitTestResultReportLib|UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.inf
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
##MSCHANGE End

# MU_CHANGE [BEGIN]
# Add RNG Libs for ARM
[LibraryClasses]
RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf

[LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.UEFI_APPLICATION]
[LibraryClasses.common.UEFI_APPLICATION]
RngLib|MdePkg/Library/DxeRngLib/DxeRngLib.inf

!if $(TOOL_CHAIN_TAG) == VS2019 or $(TOOL_CHAIN_TAG) == VS2022 ## MU_CHANGE
[LibraryClasses.IA32]
NULL|MdePkg/Library/VsIntrinsicLib/VsIntrinsicLib.inf
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
[LibraryClasses.X64.DXE_CORE, LibraryClasses.X64.UEFI_DRIVER, LibraryClasses.X64.DXE_DRIVER, LibraryClasses.X64.UEFI_APPLICATION]
# this is currently X64 only because MSVC doesn't support BaseMemoryLibOptDxe for AARCH64
BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
!endif ##MSCHANGE
# MU_CHANGE [END]

[LibraryClasses.ARM, LibraryClasses.AARCH64]

#ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf ## MU_CHANGE
Expand All @@ -99,67 +66,6 @@
# Add support for stack protector
# NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf # MU_CHANGE: Use Project Mu StackCheckLib

[LibraryClasses.common.PEIM]
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf

[LibraryClasses.common.DXE_SMM_DRIVER]
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf

!if $(CRYPTO_SERVICES) != "PACKAGE"
[LibraryClasses.ARM]
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf

[LibraryClasses.common.SEC]
TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf

[LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM]
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf

[LibraryClasses.ARM.PEIM, LibraryClasses.AARCH64.PEIM]
PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf

[LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.UEFI_APPLICATION] # MU_CHANGE add UEFI Application for UEFI TEsts
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
DebugLib|MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf # MU_CHANGE add debug lib

[LibraryClasses.common.DXE_SMM_DRIVER]
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf
TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf # MU_CHANGE add debug lib
!endif

[LibraryClasses.common.UEFI_APPLICATION]
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf

[LibraryClasses.common.MM_STANDALONE]
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/StandaloneMmReportStatusCodeLib.inf
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf

################################################################################
#
# Pcd Section - list of all EDK II PCD Entries defined by this Platform
Expand Down Expand Up @@ -207,48 +113,11 @@
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/PeiCryptLib.inf
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/StandaloneMmCryptLib.inf # MU_CHANGE: Add StandaloneMmCryptLib
# MU_CHANGE [BEGIN] The prebuilt versions of CryptoDriver
!if $(CRYPTO_BINARY_EXTDEP_PATH) != FALSE
!include CryptoPkg/Driver/Bin/CryptoPkg.ci.inc.dsc
!endif
# MU_CHANGE [END] The prebuilt versions of CryptoDriver

# MU_CHANGE START
[Components.X64, Components.IA32]
CryptoPkg/Library/BaseCryptLibOnProtocolPpi/SmmCryptLib.inf

[Components.IA32, Components.X64]
#
# Build verification of IA32/X64 specific libraries
#

[Components.IA32, Components.X64] # MU_CHANGE remove ARM and AARCH64
CryptoPkg/Driver/CryptoPei.inf {
<Defines>
FILE_GUID = $(PEI_CRYPTO_DRIVER_FILE_GUID) # MU_CHANGE updated File GUID
}


[Components.IA32, Components.X64, Components.AARCH64]
CryptoPkg/Driver/CryptoDxe.inf {
<Defines>
FILE_GUID = $(DXE_CRYPTO_DRIVER_FILE_GUID) # MU_CHANGE updated File GUID
}

[Components.IA32, Components.X64]
CryptoPkg/Driver/CryptoSmm.inf {
<Defines>
FILE_GUID = $(SMM_CRYPTO_DRIVER_FILE_GUID)# MU_CHANGE updated File GUID
}

# MU_CHANGE [BEGIN]: Add CryptoStandaloneMm
[Components.IA32, Components.X64, Components.AARCH64]
CryptoPkg/Driver/CryptoStandaloneMm.inf {
<Defines>
FILE_GUID = $(STANDALONEMM_CRYPTO_DRIVER_FILE_GUID) # MU_CHANGE updated File GUID
}
# MU_CHANGE [END]: Add CryptoStandaloneMm

## MU_CHANGE TCBZ_3799 - can't compile for ARM as it depends on ArmSoftFloatLib
[Components.IA32, Components.X64, Components.AARCH64]
CryptoPkg/Test/UnitTest/Library/BaseCryptLib/BaseCryptLibUnitTestApp.inf { ## Add unit-test application for the crypto tests.
Expand Down
1 change: 0 additions & 1 deletion CryptoPkg/Driver/Bin/.gitignore

This file was deleted.

9 changes: 0 additions & 9 deletions CryptoPkg/Driver/Bin/BaseCryptoDriver_ext_dep.json

This file was deleted.

Loading

0 comments on commit b139b75

Please sign in to comment.