From nobody Tue Feb 10 08:28:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+94998+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+94998+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1665500716; cv=none; d=zohomail.com; s=zohoarc; b=aiKnkB+UZNwgFyM//osqLrRL7DuAXAldeAeBYVac1ngnDFjnKhmuMplb/r1Jo2ap1wWujaFyZrXlqq0RusuwTxzcl2bS4GAZMrxgsU73/aRk4PvGxkhkvOkRQuquDvJ0y0fagkVW88JdffLJVqeEE57lNqY0AyNw7HlLbBWdeHY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665500716; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=VYbYFb0mR1IQXWXcGQ+UrLIJuhIboRAgRrto8d28gv0=; b=dNinuyjQDHK2R5SRqAe/95KULrQmtzDgE3DAeKmNIvYWyZuRxzsjpCv9BdUwDPP9Orc723mprkCMWy16Mjby8Mhzw4ZSwQYP87IEUr2TfNaO48uLdfO+spsVnEB2LpraTz0GiThBso2tvrFVoyEtKy1DcfBoWHO+M9+0LGxoI8k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+94998+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1665500716517333.98211251978523; Tue, 11 Oct 2022 08:05:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rd2qYY1788612xwmrcJgRMxB; Tue, 11 Oct 2022 08:05:16 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web08.8439.1665500715117670141 for ; Tue, 11 Oct 2022 08:05:15 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="366518327" X-IronPort-AV: E=Sophos;i="5.95,176,1661842800"; d="scan'208";a="366518327" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2022 08:04:07 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="604172822" X-IronPort-AV: E=Sophos;i="5.95,176,1661842800"; d="scan'208";a="604172822" X-Received: from mdkinney-mobl2.amr.corp.intel.com ([10.209.79.249]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2022 08:04:07 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Xiaoyu Lu , Guomin Jiang , Christopher Zurcher , Rebecca Cran , Ard Biesheuvel Subject: [edk2-devel] [Patch 05/12] CryptoPkg/Library: Cleanup BaseCryptLib and TlsLib Date: Tue, 11 Oct 2022 08:03:51 -0700 Message-Id: <20221011150358.1332-6-michael.d.kinney@intel.com> In-Reply-To: <20221011150358.1332-1-michael.d.kinney@intel.com> References: <20221011150358.1332-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com X-Gm-Message-State: J1Y9acrlGQ4ptTodaVZ8sMMIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1665500716; bh=7wkB6pUbq9vfGl+nTSpN4huwNJswkVX78lDNVne2jVU=; h=Cc:Date:From:Reply-To:Subject:To; b=RxxF6YV3m+VZSMUVK0UZR2/qlfKKaXd97SeFNtHBnlKQODX+xwjMFMokBs7TG/p6aPq p+ZLyuwmivtP9G+ZWv5JxUTMbi1VJIjfCFyBcfPNQUCOuBwITJBhxaHI83YCZ67TqWP6D fVC674yWPBGGm6IluOVo1Ra9c/8x9PL33Ds= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1665500716923100001 Content-Type: text/plain; charset="utf-8" * Move SysCall/inet_pton.c from BaseCryptLib to TlsLib. The functions in this file are only used by TlsLib instances and not any CryptLib instances. * Fix type mismatch in call to FreePool() in TlsConfig.c * Remove use of gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled from TslLib and CryptLib instances * Add missing *Null.c files to SecCryptLib.inf and RuntimeCryptLib.inf. * Remove ARM and AARCH64 sections from SmmCryptLib.inf that does not support those architectures. * Add missing PrintLib dependencies to [LibraryClasses] sections of CryptLib INF files * Remove extra library classes from [LibraryClasses] sections of CryptLib INF files * Remove unnecessary warning disables from [BuildOptions] sections of TlsLib and CryptLib INF files * Remove RVCT support from SecCryptLib.inf Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Cc: Christopher Zurcher Cc: Rebecca Cran Cc: Ard Biesheuvel Signed-off-by: Michael D Kinney --- CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 10 +--------- CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf | 8 +------- CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf | 9 ++------- CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf | 12 ++++-------- CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 12 ------------ .../{BaseCryptLib =3D> TlsLib}/SysCall/inet_pton.c | 0 CryptoPkg/Library/TlsLib/TlsConfig.c | 2 +- CryptoPkg/Library/TlsLib/TlsLib.inf | 12 +----------- 8 files changed, 10 insertions(+), 55 deletions(-) rename CryptoPkg/Library/{BaseCryptLib =3D> TlsLib}/SysCall/inet_pton.c (1= 00%) diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Li= brary/BaseCryptLib/BaseCryptLib.inf index 9634bd5fea25..5eaa6e5a2242 100644 --- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf @@ -53,15 +53,13 @@ [Sources] Pk/CryptTs.c Pk/CryptRsaPss.c Pk/CryptRsaPssSign.c - Pk/CryptEcNull.c |*|*|*|!gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnab= led - Pk/CryptEc.c |*|*|*|gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled + Pk/CryptEc.c Pem/CryptPem.c Bn/CryptBn.c =20 SysCall/CrtWrapper.c SysCall/TimerWrapper.c SysCall/BaseMemAllocation.c - SysCall/inet_pton.c =20 [Sources.Ia32] Rand/CryptRandTsc.c @@ -92,19 +90,13 @@ [LibraryClasses] IntrinsicLib PrintLib =20 -[FixedPcd] - gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled - # # Remove these [BuildOptions] after this library is cleaned up # [BuildOptions] # # suppress the following warnings so we do not break the build with warn= ings-as-errors: - # C4090: 'function' : different 'const' qualifiers # - MSFT:*_*_*_CC_FLAGS =3D /wd4090 - GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 GCC:*_CLANGPDB_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Dincompatible-point= er-types diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf b/CryptoPkg/Lib= rary/BaseCryptLib/PeiCryptLib.inf index 3799780c9f52..b1629647f9c6 100644 --- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf @@ -79,9 +79,7 @@ [LibraryClasses] DebugLib OpensslLib IntrinsicLib - -[FixedPcd] - gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled + PrintLib =20 # # Remove these [BuildOptions] after this library is cleaned up @@ -89,11 +87,7 @@ [FixedPcd] [BuildOptions] # # suppress the following warnings so we do not break the build with warn= ings-as-errors: - # C4090: 'function' : different 'const' qualifiers - # C4718: 'function call' : recursive call has no side effects, deleting # - MSFT:*_*_*_CC_FLAGS =3D /wd4090 /wd4718 - GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 GCC:*_CLANGPDB_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Dincompatible-point= er-types diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf b/CryptoPkg= /Library/BaseCryptLib/RuntimeCryptLib.inf index 845708bf1a1b..19039685a500 100644 --- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf @@ -59,7 +59,9 @@ [Sources] Pk/CryptTsNull.c Pk/CryptRsaPssNull.c Pk/CryptRsaPssSignNull.c + Pk/CryptEcNull.c Pem/CryptPem.c + Bn/CryptBnNull.c =20 SysCall/CrtWrapper.c SysCall/TimerWrapper.c @@ -87,26 +89,19 @@ [Packages] [LibraryClasses] BaseLib BaseMemoryLib - UefiBootServicesTableLib UefiRuntimeServicesTableLib DebugLib OpensslLib IntrinsicLib PrintLib =20 -[FixedPcd] - gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled - # # Remove these [BuildOptions] after this library is cleaned up # [BuildOptions] # # suppress the following warnings so we do not break the build with warn= ings-as-errors: - # C4090: 'function' : different 'const' qualifiers # - MSFT:*_*_*_CC_FLAGS =3D /wd4090 - GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 GCC:*_CLANGPDB_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Dincompatible-point= er-types diff --git a/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf b/CryptoPkg/Lib= rary/BaseCryptLib/SecCryptLib.inf index 4f652be46a82..4ad59b7bbc59 100644 --- a/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf @@ -38,6 +38,7 @@ [Sources] Hmac/CryptHmacNull.c Kdf/CryptHkdfNull.c Cipher/CryptAesNull.c + Cipher/CryptAeadAesGcmNull.c Pk/CryptRsaBasicNull.c Pk/CryptRsaExtNull.c Pk/CryptPkcs1OaepNull.c @@ -53,6 +54,8 @@ [Sources] Rand/CryptRandNull.c Pk/CryptRsaPssNull.c Pk/CryptRsaPssSignNull.c + Pk/CryptEcNull.c + Bn/CryptBnNull.c =20 SysCall/CrtWrapper.c SysCall/ConstantTimeClock.c @@ -69,6 +72,7 @@ [LibraryClasses] DebugLib OpensslLib IntrinsicLib + PrintLib =20 # # Remove these [BuildOptions] after this library is cleaned up @@ -76,15 +80,7 @@ [LibraryClasses] [BuildOptions] # # suppress the following warnings so we do not break the build with warn= ings-as-errors: - # C4090: 'function' : different 'const' qualifiers - # C4718: 'function call' : recursive call has no side effects, deleting # - MSFT:*_*_*_CC_FLAGS =3D /wd4090 /wd4718 - - # -JCryptoPkg/Include : To disable the use of the system includes provid= ed by RVCT - # --diag_remark=3D1 : Reduce severity of "#1-D: last line of file en= ds without a newline" - RVCT:*_*_ARM_CC_FLAGS =3D -JCryptoPkg/Include --diag_remark=3D1 - GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 GCC:*_CLANGPDB_*_CC_FLAGS =3D -std=3Dc99 -Wno-error=3Dincompatible-point= er-types diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf b/CryptoPkg/Lib= rary/BaseCryptLib/SmmCryptLib.inf index 9318052a51c5..0af7a3f96e8f 100644 --- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf @@ -74,19 +74,12 @@ [Sources.Ia32] [Sources.X64] Rand/CryptRandTsc.c =20 -[Sources.ARM] - Rand/CryptRand.c - -[Sources.AARCH64] - Rand/CryptRand.c - [Packages] MdePkg/MdePkg.dec CryptoPkg/CryptoPkg.dec =20 [LibraryClasses] BaseLib - IoLib BaseMemoryLib MemoryAllocationLib OpensslLib @@ -95,18 +88,13 @@ [LibraryClasses] MmServicesTableLib SynchronizationLib =20 -[FixedPcd] - gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled - # # Remove these [BuildOptions] after this library is cleaned up # [BuildOptions] # # suppress the following warnings so we do not break the build with warn= ings-as-errors: - # C4090: 'function' : different 'const' qualifiers # - MSFT:*_*_*_CC_FLAGS =3D /wd4090 =20 XCODE:*_*_*_CC_FLAGS =3D -mmmx -msse -std=3Dc99 =20 diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c b/CryptoPkg= /Library/TlsLib/SysCall/inet_pton.c similarity index 100% rename from CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c rename to CryptoPkg/Library/TlsLib/SysCall/inet_pton.c diff --git a/CryptoPkg/Library/TlsLib/TlsConfig.c b/CryptoPkg/Library/TlsLi= b/TlsConfig.c index dbe1f0652996..f13ae0ab7e5a 100644 --- a/CryptoPkg/Library/TlsLib/TlsConfig.c +++ b/CryptoPkg/Library/TlsLib/TlsConfig.c @@ -478,7 +478,7 @@ TlsSetCipherList ( FreePool (CipherString); =20 FreeMappedCipher: - FreePool (MappedCipher); + FreePool ((VOID *)MappedCipher); =20 return Status; } diff --git a/CryptoPkg/Library/TlsLib/TlsLib.inf b/CryptoPkg/Library/TlsLib= /TlsLib.inf index bc61cda74556..e3500b9c2548 100644 --- a/CryptoPkg/Library/TlsLib/TlsLib.inf +++ b/CryptoPkg/Library/TlsLib/TlsLib.inf @@ -27,6 +27,7 @@ [Sources] TlsInit.c TlsConfig.c TlsProcess.c + SysCall/inet_pton.c =20 [Packages] MdePkg/MdePkg.dec @@ -40,14 +41,3 @@ [LibraryClasses] MemoryAllocationLib OpensslLib SafeIntLib - -[FixedPcd] - gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled - -[BuildOptions] - # - # suppress the following warnings so we do not break the build with warn= ings-as-errors: - # C4090: 'function' : different 'const' qualifiers - # - MSFT:*_*_*_CC_FLAGS =3D /wd4090 - --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#94998): https://edk2.groups.io/g/devel/message/94998 Mute This Topic: https://groups.io/mt/94260745/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-