From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.1118.1657161368968910259 for ; Wed, 06 Jul 2022 19:36:09 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=iU0pT6h9; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: paytonx.hsieh@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657161369; x=1688697369; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dbtCP/yDvvmZAZr8oGEfeU5HYawrkFKWKfpaQGcafQU=; b=iU0pT6h9VhJXiHGXEdSV0fDBos0QsfxQ79UmP1Kkt9oZuhPlcxz6qWbJ vGyOY9cv8rf9PeQ0wa6sNg80YElAtvuqIHPwSSjAXta12oJ+HnQ9Jg3LS ibCQxT/j6aep51juPH6ezN4nun9X2BDOVYnQYm4fNwJx57adoUEwzychu ftsCgLp9KzpCJwE9sA7WsKCxC+Hdu3DwjbZTl7FeVBG22WYDu9iCNxqsH Ql9SKJVJz4t+B/KOqvz/4ZhLHJXjhNvPBIhqRJrPoMhCRtnXgskfGHBNb 8mEgNkCUzblneJ5h2MbJNcjhUDRoSYPPmb7wPIsmez4c02kwglgsf3ZGh g==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="285038286" X-IronPort-AV: E=Sophos;i="5.92,251,1650956400"; d="scan'208";a="285038286" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2022 19:36:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,251,1650956400"; d="scan'208";a="593565342" Received: from peijenhx-win10.gar.corp.intel.com ([10.227.107.8]) by orsmga002.jf.intel.com with ESMTP; 06 Jul 2022 19:36:07 -0700 From: paytonx.hsieh@intel.com To: devel@edk2.groups.io Cc: PaytonX Hsieh , Guo Dong , Ray Ni , James Lu , Gua Guo Subject: [PATCH] UefiPayloadPkg: Add CryptoDxe driver to UefiPayload Date: Thu, 7 Jul 2022 10:35:04 +0800 Message-Id: <1f79d8efdb7d4e0b8dfc923b259009e19ebc136e.1657161066.git.paytonx.hsieh@intel.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: PaytonX Hsieh REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3979 Add macro CRYPTO_ENABLE to decide to build CryptoDxe into UPL. Drviers can locate protocol instead of building openssl lib into drivers. This can reduce the binary size that UPL required. Cc: Guo Dong Cc: Ray Ni Cc: James Lu Cc: Gua Guo Signed-off-by: PaytonX Hsieh --- UefiPayloadPkg/UefiPayloadPkg.dsc | 42 +++++++++++++++++++++++++++++++ UefiPayloadPkg/UefiPayloadPkg.fdf | 3 +++ 2 files changed, 45 insertions(+) diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload= Pkg.dsc index cfcf38578d..782635431b 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -36,6 +36,7 @@ DEFINE PLATFORM_BOOT_TIMEOUT =3D 3=0D DEFINE ABOVE_4G_MEMORY =3D TRUE=0D DEFINE BOOT_MANAGER_ESCAPE =3D FALSE=0D + DEFINE CRYPTO_ENABLE =3D FALSE=0D DEFINE SD_MMC_TIMEOUT =3D 1000000=0D #=0D # SBL: UEFI payload for Slim Bootloader=0D @@ -180,8 +181,13 @@ CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMain= tenanceLib.inf=0D SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf=0D DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLib/DxeHobListLib.inf=0D +!if $(CRYPTO_ENABLE) =3D=3D TRUE=0D + BaseCryptLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf= =0D + TlsLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf=0D +!else=0D BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf=0D TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf=0D +!endif=0D IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf=0D OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf=0D RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf=0D @@ -412,6 +418,31 @@ gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE= )=0D gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1800000=0D =0D +!if $(CRYPTO_ENABLE) =3D=3D TRUE=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Fami= ly | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md5.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Dh.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Random.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tdes.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.Ge= tContextSize | TRUE=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.In= it | TRUE=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.Cb= cEncrypt | TRUE=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Services.Cb= cDecrypt | TRUE=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Arc4.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Hkdf.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tls.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsSet.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D + gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsGet.Family = | PCD_CRYPTO_SERVICE_ENABLE_FAMILY=0D +!endif=0D +=0D [PcdsPatchableInModule.X64]=0D gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)= =0D gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER= )=0D @@ -719,6 +750,17 @@ MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf=0D !endif=0D =0D + #=0D + # Misc=0D + #=0D +!if $(CRYPTO_ENABLE) =3D=3D TRUE=0D + CryptoPkg/Driver/CryptoDxe.inf {=0D + =0D + BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf=0D + TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf=0D + }=0D +!endif=0D +=0D #------------------------------=0D # Build the shell=0D #------------------------------=0D diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayload= Pkg.fdf index c7b04978ad..f609813cc8 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.fdf +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf @@ -99,6 +99,9 @@ INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusC= odeRouterRuntimeDxe.inf=0D INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerR= untimeDxe.inf=0D =0D +!if $(CRYPTO_ENABLE) =3D=3D TRUE=0D +INF CryptoPkg/Driver/CryptoDxe.inf=0D +!endif=0D !if $(SECURITY_STUB_ENABLE) =3D=3D TRUE=0D INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf=0D !endif=0D --=20 2.28.0.windows.1