From cc1d13c9228d988071834b12c8494efb28b55802 Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Thu, 21 Nov 2019 09:24:41 -0800 Subject: CryptoPkg/Driver: Add Crypto PEIM, DXE, and SMM modules https://bugzilla.tianocore.org/show_bug.cgi?id=2420 Based on the following package with changes to merge into CryptoPkg. https://github.com/microsoft/mu_plus/tree/dev/201908/SharedCryptoPkg Add the CryptoPei, CryptoDxe, and CryptoSmm modules that produce EDK II Crypto Protocols/PPIs that provide the same services as the BaseCryptLib class. In order to optimize the size of CryptoPei, CryptoDxe, and CryptoSmm modules for a specific platform, the FixedAtBuild PCD gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable is used to determine if a specific service is enabled or disabled. If a service is enabled, then a call is made to the BaseCryptLib service. If the service is disabled, then a DEBUG() message and ASSERT() are performed and a default return value is returned. This provides simple detection of a service that is disabled but is used by another module when DEBUG()/ASSERT() macros are enabled. The use of a FixedAtBuild PCD is required so the compiler and linker know each services enable/disable setting at build time and allows disabled services to be optimized away. CryptoPei supports both pre-mem and post-mem use cases. If CryptoPei is initially dispatched pre-mmem, the the register for shadow service is used so the Crypto PPI can be reinstalled post-mem. Cc: Jian J Wang Cc: Xiaoyu Lu Signed-off-by: Michael D Kinney Reviewed-by: Jian J Wang --- CryptoPkg/Driver/CryptoDxe.inf | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 CryptoPkg/Driver/CryptoDxe.inf (limited to 'CryptoPkg/Driver/CryptoDxe.inf') diff --git a/CryptoPkg/Driver/CryptoDxe.inf b/CryptoPkg/Driver/CryptoDxe.inf new file mode 100644 index 0000000000..0d08f3a190 --- /dev/null +++ b/CryptoPkg/Driver/CryptoDxe.inf @@ -0,0 +1,49 @@ +## @file +# Produces the EDK II Crypto Protocol using the library services from +# BaseCryptLib and TlsLib. PcdCryptoServiceFamilyEnable is used to enable the +# subset of available services. +# +# Copyright (C) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x0001001B + PI_SPECIFICATION_VERSION = 0x0001000A + BASE_NAME = CryptoDxe + MODULE_UNI_FILE = Crypto.uni + FILE_GUID = FEA01457-E381-4135-9475-C6AFD0076C61 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = CryptoDxeEntry + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 +# + +[Sources] + Crypto.c + CryptoDxe.c + +[Packages] + MdePkg/MdePkg.dec + CryptoPkg/CryptoPkg.dec + +[LibraryClasses] + UefiDriverEntryPoint + UefiBootServicesTableLib + DebugLib + BaseCryptLib + TlsLib + +[Protocols] + gEdkiiCryptoProtocolGuid ## PRODUCES + +[Pcd] + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable #CONSUMES + +[Depex] + TRUE -- cgit v1.2.3