From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 336C6AC0A34 for ; Tue, 12 Dec 2023 04:03:33 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=sam9UHzp67YqY+GzljHVVcYb3OxLp/VFIqDADna8ahw=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Message-ID:Date:User-Agent:Subject:To:CC:References:From:In-Reply-To:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1702353812; v=1; b=ZKDDpMaxf0NOHz8vSjF+Vn1DCBL+j3V2etLwx7IaC4HyBnzle6+aiTAOxx6S/NW5fPONr7eL oE1mYtBYquSOyGE5+7FxdDH5mEvfAphSxAyJhlTRig1A0iqKAr7ghG+AKz9TDGm3QgVIVDBquPq fqE4S87Jh8wk8PGozI0lssv8= X-Received: by 127.0.0.2 with SMTP id YPYHYY7687511xnksUdezyjD; Mon, 11 Dec 2023 20:03:32 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.79]) by mx.groups.io with SMTP id smtpd.web11.5662.1702353811796078518 for ; Mon, 11 Dec 2023 20:03:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UVGoEwBguYTvkKKX/A8wYQ+K9KZX2puAyakXJNABXcvhk7OpmYBNg8724+QGdmj8CscJAPTwP7u6J3VoHsnN40pvD4YUT6FYoIDu7vUQmgmk3tli0g4VVANkXGdXI1kJqGSSlMfbpt8kE0JNNxItCjFed7xnARqW8ZIsyVtAUVYJwmrQn4VTtcYAanUK94vCcsb/VZptRn/4suXwrCfbFb9AJhV+xx1QVCBvPp7ytRcIeKO7AtmW8++7zobzBOpoBJUmub4aHlR3+VXhpE9jv4Rxa9R48amN6x2okpRn7vJMR4L0/nMX+A0RsU+iGMQGHy2GwXbPF20npy41yYkA6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I1mlrVV/KBTcqA9KLQybBhGzXfuQBgoGsbvXEU958Ms=; b=UOl4dju33Xb5tokxn8kzpt4yAlnNizoJT+bLl53XP9qPS6DvKSnkBL+Jy72Fo3LvWNp3Tdx4ntuIq50ridz3SWdVE3OpSLQFrSBzZ+3avHrjuN8XcK6oD8rN+cPjwA0Z1A/WNDNm32thTluF4ypxfnlluFaRC9mi3OsOF1ol5sXs4nMGbjSnuncu3qW1brp9D2y1xCDt1d/roMoyjIqaaDbzQ49B17kwGXOjb+aiw4HhW+QA/nZAz7Acyt+BFJUiXPfTa1T49u4cns/DgXaSbG/bVJc036KxswhRTA3/9G+gtkjhdYT7yPr2K5EoHK2JXA+hjJJ8x/XXZQWHCcGEPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from CH3PR12MB9194.namprd12.prod.outlook.com (2603:10b6:610:19f::7) by SA1PR12MB8698.namprd12.prod.outlook.com (2603:10b6:806:38b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33; Tue, 12 Dec 2023 04:03:27 +0000 X-Received: from CH3PR12MB9194.namprd12.prod.outlook.com ([fe80::3112:5f54:2e51:cf89]) by CH3PR12MB9194.namprd12.prod.outlook.com ([fe80::3112:5f54:2e51:cf89%5]) with mapi id 15.20.7068.033; Tue, 12 Dec 2023 04:03:27 +0000 Message-ID: <9982905a-11da-4c82-9923-2b9507f75059@amd.com> Date: Tue, 12 Dec 2023 15:03:17 +1100 User-Agent: Mozilla Thunderbird Beta Subject: Re: [edk2-devel] [PATCH v3 06/11] CryptoPkg: Add all .inf files for BaseCryptLibMbedTls To: devel@edk2.groups.io, wenxing.hou@intel.com CC: Jiewen Yao , Yi Li , Xiaoyu Lu , Guomin Jiang References: <20230928153416.537-1-wenxing.hou@intel.com> <20230928153416.537-7-wenxing.hou@intel.com> <179FF92851F08A90.471@groups.io> From: "Alexey Kardashevskiy via groups.io" In-Reply-To: <179FF92851F08A90.471@groups.io> X-ClientProxiedBy: SGAP274CA0007.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b6::19) To CH3PR12MB9194.namprd12.prod.outlook.com (2603:10b6:610:19f::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR12MB9194:EE_|SA1PR12MB8698:EE_ X-MS-Office365-Filtering-Correlation-Id: 5827f5b9-47b8-427c-d61d-08dbfac74b13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: L1HOXPPqgI24w1MEXDjI6zKwV9RVW2q+5R2XIG4S1niH4IuMIb4gwERlKLGdRaK+eZxpDaN+hYpFGv3Gzou2DZFH8MsQGOWVLC5L4l+GouXm65lf/mF3QV11ttapw28Xsc89I146LIJNZbwpp2TIRpytiCAco3RdHY4w/9AWJSlMQPSLzvzY/+a38w5CwLUqOy8qRf44vqAvNcUTauocQAZg6/nZP7Rx3JU3US+fzXeNqRtkFk9sWuDHYDeHVoeI1tfLvK/YN83ZXBPaSh+4o0CWx8922/UcfDwTFcCFcsA5dXRvaS8D2jOrL/yuC4VeUo13FMr3Kv5Nfu+1e7sQBW5wRp1O22GrPgo6yuhZB4F4hplMdLuj00yByiNeJr46Cgsy/bS67PPZjDNLKtDeFuA/v8ZGa31t5FCro+D5joQFIsqj134y/kYneisKY3TeAyqie0wjZtr2WXyYsxUrtGHS3xf5f1cbijV6CA4ZdRJy4lIS6pVdgilq1Z2VcJEqH0TKHfGVbRN8utKR44O4klLWXOACBPSlEVNkqZPuCJ1lVt0RnfAP0YpdZvQz1/OsFdQzRv21HdqrSIZfRwgOtYKpwY5Sq2e73rHOZeyp+v3hk/d000dMsZ5pI/f1qDUlr9OxHGzFoVDZp9rjL3bIUJtkA6wDrvNMOSi1raW/R6vuDgQbhaUh1zHEszhJmS5nDk6nTfT5/1A0s+itOyDgaCnM2CjwI4+1+0I7AcHc/ur4ZLz6+GoIitIZAj5YJ5WG X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Qtq4guFZ0IjWStfxEPohXxQsBkQNCWiMZpIql9N503OXpnBGulAbIlYkFdpt?= =?us-ascii?Q?l8yh92a+a6WLUGohlPR7gLk3u/LB7PLaoJWY2lYeJmuVKkbaX9ST8r1MntN1?= =?us-ascii?Q?2nyYfcXZiHUqQct1KrHCcsTqHCP49ls9yzKviiHD4YCfXEMwfyFlcYL+Mk9L?= =?us-ascii?Q?4ZLAJwoSTdovR+aBhfs+jfZ8Kh+D8tAI6uK9iSZTwT2nutODTYsOcx946/Iz?= =?us-ascii?Q?WeoUZoaYu+yFapq+x/MeVGRGSKZnn0MpyEJeZ9zdolnx52csRKLfBMtU0h50?= =?us-ascii?Q?T0lZZXM+GwP7SfUCAQecSFYkCXtvldYLcJXqoMVgrD9eq6dtQeOW+tv5yVaC?= =?us-ascii?Q?cSDBMR/VCiGiXK9y1JctDCRoYb4p/Pb7SY7rH6umK5y01g5Tojx/IhmrPMUw?= =?us-ascii?Q?rpUYpkZtV3BDlL1E3ARI/bn13z8vldiCXC5iHU44YaShewpNM/hav38CDCEY?= =?us-ascii?Q?UBHZk4bpr8YXUR0zPBFOcBScrFc/v425pFIdLos7DWVeGbU7mn/itkjxrtok?= =?us-ascii?Q?AeTK4knSeG8V2p18A/LHR5zkwTQimV6tL7P6Ljf3lgrYEOg2hExjfOXkMJLp?= =?us-ascii?Q?nnVW781qWxaO98wf4Szc/8Yc0siQaq+8GcnySR2iXzP/6anAcmq5AGGJPdwU?= =?us-ascii?Q?NZ1+hGITWl7EMV+L4kFDhr81YYfk5FzxTdljSW/bcw3MIkKH9hrRjG9RB/lP?= =?us-ascii?Q?cpPP4eLlPjFoq2xTHu1NejzDQtAHiV3Fj/yH1REFn69/5zmlnWvJmHQIwoXT?= =?us-ascii?Q?Fp3rEMcywCa1/F0VAJCbTnprBsQSCybu+1EzefX4GUk3Y48r3Xq3uetcfe0X?= =?us-ascii?Q?Vzb7rkcLFyr+gAdR/CH3/nyzcBDDk0tDupcxKBRUm8tFy7ZBn1UpiPbwJEki?= =?us-ascii?Q?hyjbMTxHAOqijAQCoEZCMBOoEfmJFQGnTEIN4OmugcUVZ+VurgpxAJ2wvMgx?= =?us-ascii?Q?drg4ADCP22Za0Md/F6ozTekKgdNSv9dY0Y7f8UU8T+Br9B2ybPSZmRWsmRWC?= =?us-ascii?Q?9/WQ/viEfV5eY02iVNOKjy1CS2adHiXVvgrEdYuBkpONPAwfu+OtTeV5sqH6?= =?us-ascii?Q?hQxaXXTK9fFwydo4rmp44DeLeICANO7kvvHad2TsnavpcnJYM79jAgBSumH6?= =?us-ascii?Q?KjPx+jd+s6/Vj3Wi64vTF+Uc9pH3kFexZ0ZZ3AA8O6MqSsUrkysjeILbosuf?= =?us-ascii?Q?JvEi2IWqRTFcgXohfy5OtKargXK8mRJKdUE2GjnazKUnUdJAXgfkPv3nmx4d?= =?us-ascii?Q?0BlOrwGo7o1so9pW8pUTPa+bSYKIlrvJXpj2h/7npb1QQRzdJUu8SCUR1Gj6?= =?us-ascii?Q?4pbsJ4v/zKEeYAadmNohsMhpeRW8y9RqO5c35MB7WXMiTtsjppp676EaoM0v?= =?us-ascii?Q?BvbdJK2YBi3lgYKLqnZS8Bi+BEpmtI0+dr1PY3VKcdjPCwdvWOyiE9f40Y9z?= =?us-ascii?Q?nKtPIO7AKMOzFlIppYC+NCiuxqzEb8kAhJCeQEUG9KsCu3kgGpYKaoF1Dw6N?= =?us-ascii?Q?GbT0trxGOureNB/QA+v87zQLJ230sQplsyu1r4PooFSd3SzVrYLuWP2U0wGH?= =?us-ascii?Q?a5eoxv/G2SU6usA+RssvNUuoQD73+UaKUSfXoHfz?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5827f5b9-47b8-427c-d61d-08dbfac74b13 X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB9194.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2023 04:03:27.7403 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Q8LQ77y6g987I2ne+2r+YGVumd1dn3b2nJMfhB7HJv36TfpLmhP/pRkIX9GTc2HxML2e0bY/Rk3vT3VXRdzNBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8698 Precedence: Bulk 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,aik@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: jBoIlHDBPwkdfm2dEJCA4CGCx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=ZKDDpMax; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io ah never mind, sorry for the noise. Needed to build BaseTools/Source/C=20 and install some packages. On 12/12/23 14:52, Alexey Kardashevskiy via groups.io wrote: > Hi, >=20 > This broke build: >=20 > nice build -q --cmd-len=3D64436 -n 20 -t GCC5 -a X64 -p=20 > OvmfPkg/OvmfPkgX64.dsc >=20 > build.py... > /home/aik/p/o-snp/CryptoPkg/CryptoPkg.dec(32): error 000E:=20 > File/directory not found in workspace > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /home/aik/p/o-snp/CryptoPkg/L= ibrary/MbedTlsLib/mbedtls/include >=20 > What am I missing? Thanks, >=20 >=20 > On 29/9/23 01:34, Wenxing Hou via groups.io wrote: >> Add .inf files and other support files. >> >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4177 >> >> Cc: Jiewen Yao >> Cc: Yi Li >> Cc: Xiaoyu Lu >> Cc: Guomin Jiang >> Signed-off-by: Wenxing Hou >> --- >> =C2=A0 CryptoPkg/CryptoPkg.dec=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 |=C2=A0=C2=A0 4 + >> =C2=A0 CryptoPkg/CryptoPkgMbedTls.dsc=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 280 +++++++++++ >> =C2=A0 .../BaseCryptLibMbedTls/BaseCryptLib.inf=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 |=C2=A0 81 +++ >> =C2=A0 .../BaseCryptLibMbedTls/PeiCryptLib.inf=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 | 101 ++++ >> =C2=A0 .../BaseCryptLibMbedTls/PeiCryptLib.uni=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 |=C2=A0 25 + >> =C2=A0 .../BaseCryptLibMbedTls/RuntimeCryptLib.inf=C2=A0=C2=A0 |=C2=A0 9= 2 ++++ >> =C2=A0 .../BaseCryptLibMbedTls/RuntimeCryptLib.uni=C2=A0=C2=A0 |=C2=A0 2= 2 + >> =C2=A0 .../BaseCryptLibMbedTls/SecCryptLib.inf=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 |=C2=A0 84 ++++ >> =C2=A0 .../BaseCryptLibMbedTls/SecCryptLib.uni=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 |=C2=A0 17 + >> =C2=A0 .../BaseCryptLibMbedTls/SmmCryptLib.inf=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 |=C2=A0 92 ++++ >> =C2=A0 .../BaseCryptLibMbedTls/SmmCryptLib.uni=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 |=C2=A0 22 + >> =C2=A0 .../SysCall/ConstantTimeClock.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 75 +++ >> =C2=A0 .../BaseCryptLibMbedTls/SysCall/CrtWrapper.c=C2=A0 |=C2=A0 58 +++ >> =C2=A0 .../SysCall/RuntimeMemAllocation.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 462 ++++++++++++++++++ >> =C2=A0 .../SysCall/TimerWrapper.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= | 198 ++++++++ >> =C2=A0 .../BaseCryptLibMbedTls/TestBaseCryptLib.inf=C2=A0 |=C2=A0 76 +++ >> =C2=A0 CryptoPkg/Library/Include/stdint.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 19 + >> =C2=A0 CryptoPkg/Library/Include/stubs-32.h=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 9 + >> =C2=A0 CryptoPkg/Library/MbedTlsLib/EcSm2Null.c=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 |=C2=A0=C2=A0 2 +- >> =C2=A0 19 files changed, 1718 insertions(+), 1 deletion(-) >> =C2=A0 create mode 100644 CryptoPkg/CryptoPkgMbedTls.dsc >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/BaseCryptLib.inf >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/PeiCryptLib.inf >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/PeiCryptLib.uni >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/RuntimeCryptLib.inf >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/RuntimeCryptLib.uni >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/SecCryptLib.inf >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/SecCryptLib.uni >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/SmmCryptLib.inf >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/SmmCryptLib.uni >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/RuntimeMemAllocation.c >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c >> =C2=A0 create mode 100644=20 >> CryptoPkg/Library/BaseCryptLibMbedTls/TestBaseCryptLib.inf >> =C2=A0 create mode 100644 CryptoPkg/Library/Include/stdint.h >> =C2=A0 create mode 100644 CryptoPkg/Library/Include/stubs-32.h >> >> diff --git a/CryptoPkg/CryptoPkg.dec b/CryptoPkg/CryptoPkg.dec >> index 0c7d16109b..a5fa81a338 100644 >> --- a/CryptoPkg/CryptoPkg.dec >> +++ b/CryptoPkg/CryptoPkg.dec >> @@ -27,6 +27,10 @@ >> =C2=A0=C2=A0=C2=A0 Library/OpensslLib/openssl/providers/implementations/= include >> =C2=A0=C2=A0=C2=A0 Library/OpensslLib/OpensslGen/include >> =C2=A0=C2=A0=C2=A0 Library/OpensslLib/OpensslGen/providers/common/includ= e >> +=C2=A0 Library/MbedTlsLib/Include >> +=C2=A0 Library/MbedTlsLib/mbedtls >> +=C2=A0 Library/MbedTlsLib/mbedtls/include >> +=C2=A0 Library/MbedTlsLib/mbedtls/include/mbedtls >> =C2=A0 [LibraryClasses] >> =C2=A0=C2=A0=C2=A0 ##=C2=A0 @libraryclass=C2=A0 Provides basic library f= unctions for=20 >> cryptographic primitives. >> diff --git a/CryptoPkg/CryptoPkgMbedTls.dsc=20 >> b/CryptoPkg/CryptoPkgMbedTls.dsc >> new file mode 100644 >> index 0000000000..5d0ae6ff3f >> --- /dev/null >> +++ b/CryptoPkg/CryptoPkgMbedTls.dsc >> @@ -0,0 +1,280 @@ >> +## @file >> +#=C2=A0 Cryptographic Library Package for UEFI Security Implementation. >> +#=C2=A0 PEIM, DXE Driver, and SMM Driver with all crypto services enabl= ed. >> +# >> +#=C2=A0 Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +#=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +## >> + >> +#######################################################################= ######### >> +# >> +# Defines Section - statements that will be processed to create a=20 >> Makefile. >> +# >> +#######################################################################= ######### >> +[Defines] >> +=C2=A0 PLATFORM_NAME=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D CryptoPkg >> +=C2=A0 PLATFORM_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D E1063286-6C8C-4c25-= AEF0-67A9A5B6E6B6 >> +=C2=A0 PLATFORM_VERSION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0.98 >> +=C2=A0 DSC_SPECIFICATION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0x00010005 >> +=C2=A0 OUTPUT_DIRECTORY=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D Build/CryptoPkgMbed >> +=C2=A0 SUPPORTED_ARCHITECTURES=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 =3D IA32|X64|ARM|AARCH64|RISCV64 >> +=C2=A0 BUILD_TARGETS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D DEBUG|RELEASE|NOOPT >> +=C2=A0 SKUID_IDENTIFIER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D DEFAULT >> + >> +!ifndef CRYPTO_IMG_TYPE >> +=C2=A0 DEFINE CRYPTO_IMG_TYPE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 =3D DXE_SMM >> +!endif >> + >> +!if $(CRYPTO_IMG_TYPE) IN "PEI_DEFAULT PEI_PREMEM DXE_SMM" >> +!else >> +=C2=A0 !error CRYPTO_IMG_TYPE must be set to one of PEI_DEFAULT PEI_PRE= MEM=20 >> DXE_SMM. >> +!endif >> + >> +#######################################################################= ######### >> +# >> +# Library Class section - list of all Library Classes needed by this=20 >> Platform. >> +# >> +#######################################################################= ######### >> + >> +!include MdePkg/MdeLibs.dsc.inc >> +[LibraryClasses] >> +=C2=A0 BaseLib|MdePkg/Library/BaseLib/BaseLib.inf >> +=C2=A0 BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf >> +=C2=A0 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf >> +=C2=A0 DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf >> + =20 >> UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBoo= tServicesTableLib.inf >> + =20 >> UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf >> +=C2=A0 BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull= .inf >> +=C2=A0 TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf >> +=C2=A0 HashApiLib|CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf >> +=C2=A0 RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf >> + =20 >> SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniza= tionLib.inf >> + >> +[LibraryClasses.ARM, LibraryClasses.AARCH64] >> +=C2=A0 # >> +=C2=A0 # It is not possible to prevent the ARM compiler for generic=20 >> intrinsic functions. >> +=C2=A0 # This library provides the instrinsic functions generate by a= =20 >> given compiler. >> +=C2=A0 # [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean lin= k=20 >> this library >> +=C2=A0 # into all ARM and AARCH64 images. >> +=C2=A0 # >> +=C2=A0 NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.= inf >> + >> +=C2=A0 # Add support for stack protector >> +=C2=A0 NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf >> + >> +[LibraryClasses.common.PEIM] >> +=C2=A0 PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf >> + =20 >> MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf >> + =20 >> PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/Pei= ServicesTablePointerLib.inf >> +=C2=A0 PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf >> +=C2=A0 HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf >> + >> +[LibraryClasses.common.DXE_SMM_DRIVER] >> + =20 >> SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableL= ib.inf >> + =20 >> MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAlloc= ationLib.inf >> + =20 >> MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.= inf >> + =20 >> SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniza= tionLib.inf >> + >> +[LibraryClasses] >> + =20 >> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf >> + =20 >> DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebug= LibReportStatusCode.inf >> + =20 >> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseD= ebugPrintErrorLevelLib.inf >> + =20 >> OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf >> +=C2=A0 PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf >> +=C2=A0 DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib= .inf >> +=C2=A0 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf >> + =20 >> TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplat= e.inf >> + =20 >> UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/U= efiRuntimeServicesTableLib.inf >> +=C2=A0 IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf >> +=C2=A0 MbedTlsLib|CryptoPkg/Library/MbedTlsLib/MbedTlsLib.inf >> +=C2=A0 IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf >> +=C2=A0 SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf >> + >> +[LibraryClasses.ARM] >> +=C2=A0 ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.i= nf >> + >> +[LibraryClasses.common.PEIM] >> +=C2=A0 PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf >> + =20 >> ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf >> +=C2=A0 BaseCryptLib|CryptoPkg/Library/BaseCryptLibMbedTls/PeiCryptLib.i= nf >> +=C2=A0 TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf >> + >> +[LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM] >> + =20 >> PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/= PeiServicesTablePointerLibIdt.inf >> + >> +[LibraryClasses.ARM.PEIM, LibraryClasses.AARCH64.PEIM] >> + =20 >> PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/Pei= ServicesTablePointerLib.inf >> + >> +[LibraryClasses.common.DXE_DRIVER] >> + =20 >> ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf >> +=C2=A0 BaseCryptLib|CryptoPkg/Library/BaseCryptLibMbedTls/BaseCryptLib.= inf >> +=C2=A0 TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf >> + >> +[LibraryClasses.common.DXE_SMM_DRIVER] >> + =20 >> ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmRepor= tStatusCodeLib.inf >> +=C2=A0 BaseCryptLib|CryptoPkg/Library/BaseCryptLibMbedTls/SmmCryptLib.i= nf >> +=C2=A0 TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf >> + >> +#######################################################################= ######### >> +# >> +# Pcd Section - list of all EDK II PCD Entries defined by this Platform >> +# >> +#######################################################################= ######### >> +[PcdsFixedAtBuild] >> +=C2=A0 gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f >> +=C2=A0 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000 >> +=C2=A0 gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x06 >> + >> +!if $(CRYPTO_IMG_TYPE) IN "DXE_SMM" >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacMd5.Family= =C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha1.Family= =C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Fami= ly | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md4.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md5.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Dh.Family=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMI= LY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Random.Family= =C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family= =C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family= =C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family= =C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tdes.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Arc4.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Hkdf.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tls.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsSet.Family= =C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsGet.Family= =C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.ParallelHash.Fa= mily=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> +!endif >> + >> +!if $(CRYPTO_IMG_TYPE) IN "PEI_DEFAULT" >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Family=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY >> + >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Pk= cs1Verify=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Ne= w=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Se= tKey=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Fr= ee=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Services.G= etContextSize=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Services.I= nit=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Services.U= pdate=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Services.F= inal=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services= .GetContextSize=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services= .Init=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services= .Update=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services= .Final=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 | TRUE >> + >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services= .GetContextSize=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services= .Init=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services= .Update=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services= .Final=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services= .HashAll=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 | TRUE >> + >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.Ge= tContextSize=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.In= it=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.Up= date=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.Fi= nal=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.Ha= shAll=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.Du= plicate=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Serv= ices.New=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Serv= ices.Free=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Serv= ices.SetKey=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | T= RUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Serv= ices.Duplicate=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Serv= ices.Update=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | T= RUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Serv= ices.Final=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Hkdf.Services.S= ha256ExtractAndExpand | TRUE >> +!endif >> + >> +!if $(CRYPTO_IMG_TYPE) IN "PEI_PREMEM" >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services= .GetContextSize=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services= .Init=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services= .Update=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services= .Final=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 | TRUE >> + >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services= .GetContextSize=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services= .Init=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services= .Update=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services= .Final=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services= .HashAll=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 | TRUE >> + >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Services= .GetContextSize=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Services= .Init=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Services= .Update=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 | TRUE >> + =20 >> gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Services= .Final=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 | TRUE >> +!endif >> + >> +#######################################################################= ############################ >> +# >> +# Components Section - list of the modules and components that will=20 >> be processed by compilation >> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tools and the EDK= II tools to generate=20 >> PE32/PE32+/Coff image files. >> +# >> +# Note: The EDK II DSC file is not used to specify how compiled=20 >> binary images get placed >> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 into firmware volume images. This= section is just a list of=20 >> modules to compile from >> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 source into UEFI-compliant binari= es. >> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 It is the FDF file that contains = information on combining=20 >> binary files into firmware >> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 volume images, whose concept is b= eyond UEFI and is described=20 >> in PI specification. >> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Binary modules do not need to be = listed in this section, as=20 >> they should be >> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 specified in the FDF file. For ex= ample: Shell binary=20 >> (Shell_Full.efi), FAT binary (Fat.efi), >> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Logo (Logo.bmp), and etc. >> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 There may also be modules listed = in this section that are not=20 >> required in the FDF file, >> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 When a module listed here is excl= uded from FDF file, then=20 >> UEFI-compliant binary will be >> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 generated for it, but the binary = will not be put into any=20 >> firmware volume. >> +# >> +#######################################################################= ############################ >> + >> +!if $(CRYPTO_IMG_TYPE) IN "PEI_DEFAULT PEI_PREMEM" >> +[Components.IA32, Components.X64, Components.ARM, Components.AARCH64] >> +=C2=A0 CryptoPkg/Driver/CryptoPei.inf { >> +=C2=A0=C2=A0=C2=A0 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !if "$(CRYPTO_SERVICES)" =3D=3D "ALL" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FILE_GUID =3D 8DF53C2E-3380-= 495F-A8B7-370CFE28E1C6 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !elseif "$(CRYPTO_SERVICES)" =3D=3D "NON= E" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FILE_GUID =3D E5A97EE3-71CC-= 407F-9DA9-6BE0C8A6C7DF >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !elseif "$(CRYPTO_SERVICES)" =3D=3D "MIN= _PEI" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FILE_GUID =3D 0F5827A9-35FD-= 4F41-8D38-9BAFCE594D31 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !endif >> +=C2=A0 } >> +!endif >> + >> +!if $(CRYPTO_IMG_TYPE) IN "DXE_SMM" >> +[Components.IA32, Components.X64, Components.AARCH64] >> +=C2=A0 CryptoPkg/Driver/CryptoDxe.inf { >> +=C2=A0=C2=A0=C2=A0 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !if "$(CRYPTO_SERVICES)" =3D=3D "ALL" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FILE_GUID =3D D9444B06-060D-= 42C5-9344-F04707BE0169 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !elseif "$(CRYPTO_SERVICES)" =3D=3D "NON= E" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FILE_GUID =3D C7A340F4-A6CC-= 4F95-A2DA-42BEA4C3944A >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !elseif "$(CRYPTO_SERVICES)" =3D=3D MIN_= DXE_MIN_SMM >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FILE_GUID =3D DDF5BE9E-159A-= 4B77-B6D7-82B84B5763A2 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !endif >> +=C2=A0 } >> + >> +[Components.IA32, Components.X64] >> +=C2=A0 CryptoPkg/Driver/CryptoSmm.inf { >> +=C2=A0=C2=A0=C2=A0 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !if "$(CRYPTO_SERVICES)" =3D=3D "ALL" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FILE_GUID =3D A3542CE8-77F7-= 49DC-A834-45D37D2EC1FA >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !elseif "$(CRYPTO_SERVICES)" =3D=3D "NON= E" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FILE_GUID =3D 6DCB3127-01E7-= 4131-A487-DC77A965A541 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !elseif "$(CRYPTO_SERVICES)" =3D=3D MIN_= DXE_MIN_SMM >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FILE_GUID =3D 85F7EA15-3A2B-= 474A-8875-180542CD6BF3 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !endif >> +=C2=A0 } >> +!endif >> + >> +[BuildOptions] >> +=C2=A0 *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES >> +=C2=A0 MSFT:*_*_*_CC_FLAGS =3D /D ENABLE_MD5_DEPRECATED_INTERFACES >> +=C2=A0 INTEL:*_*_*_CC_FLAGS =3D /D ENABLE_MD5_DEPRECATED_INTERFACES >> +=C2=A0 GCC:*_*_*_CC_FLAGS =3D -D ENABLE_MD5_DEPRECATED_INTERFACES >> +=C2=A0 RVCT:*_*_*_CC_FLAGS =3D -DENABLE_MD5_DEPRECATED_INTERFACES >> +!if $(CRYPTO_IMG_TYPE) IN "DXE_SMM" >> +=C2=A0 MSFT:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 >> +=C2=A0 GCC:*_GCC*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000 >> +!endif >> diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/BaseCryptLib.inf=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/BaseCryptLib.inf >> new file mode 100644 >> index 0000000000..16def792c5 >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/BaseCryptLib.inf >> @@ -0,0 +1,81 @@ >> +## @file >> +#=C2=A0 Cryptographic Library Instance for DXE_DRIVER. >> +# >> +#=C2=A0 Caution: This module requires additional review when modified. >> +#=C2=A0 This library will have external input - signature. >> +#=C2=A0 This external input must be validated carefully to avoid securi= ty=20 >> issues such as >> +#=C2=A0 buffer overflow or integer overflow. >> +# >> +#=C2=A0 Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +#=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +## >> + >> +[Defines] >> +=C2=A0 INF_VERSION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0x00010= 005 >> +=C2=A0 BASE_NAME=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D BaseCryptLib >> +=C2=A0 FILE_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D 693C5308-AF95-4CE5-ADE9-CA011C2FC642 >> +=C2=A0 MODULE_TYPE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D DXE_DRI= VER >> +=C2=A0 VERSION_STRING=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 1.0 >> +=C2=A0 LIBRARY_CLASS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D BaseCryptLib|DXE_DR= IVER DXE_CORE=20 >> UEFI_APPLICATION UEFI_DRIVER >> + >> +# >> +# The following information is for reference only and not required by= =20 >> the build tools. >> +# >> +#=C2=A0 VALID_ARCHITECTURES=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =3D IA32 X64 ARM AARCH64 >> +# >> + >> +[Sources] >> +=C2=A0 InternalCryptLib.h >> +=C2=A0 Cipher/CryptAeadAesGcmNull.c >> +=C2=A0 Cipher/CryptAes.c >> +=C2=A0 Hash/CryptSha256.c >> +=C2=A0 Hash/CryptSha512.c >> +=C2=A0 Hash/CryptParallelHashNull.c >> +=C2=A0 Hash/CryptSm3Null.c >> +=C2=A0 Hash/CryptMd5.c >> +=C2=A0 Hash/CryptSha1.c >> +=C2=A0 Hmac/CryptHmac.c >> +=C2=A0 Kdf/CryptHkdf.c >> +=C2=A0 Pk/CryptRsaBasic.c >> +=C2=A0 Pk/CryptRsaExtNull.c >> +=C2=A0 Pk/CryptRsaPss.c >> +=C2=A0 Pk/CryptRsaPssSignNull.c >> +=C2=A0 Bn/CryptBnNull.c >> +=C2=A0 Pem/CryptPemNull.c >> +=C2=A0 Pk/CryptDhNull.c >> +=C2=A0 Pk/CryptEcNull.c >> +=C2=A0 Pk/CryptPkcs1OaepNull.c >> +=C2=A0 Pk/CryptPkcs5Pbkdf2Null.c >> +=C2=A0 Pk/CryptPkcs7SignNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyEkuNull.c >> +=C2=A0 Pk/CryptX509Null.c >> +=C2=A0 Pk/CryptAuthenticodeNull.c >> +=C2=A0 Pk/CryptTsNull.c >> +=C2=A0 Rand/CryptRandNull.c >> +=C2=A0 SysCall/CrtWrapper.c >> +=C2=A0 SysCall/TimerWrapper.c >> + >> +[Packages] >> +=C2=A0 MdePkg/MdePkg.dec >> +=C2=A0 CryptoPkg/CryptoPkg.dec >> + >> +[LibraryClasses] >> +=C2=A0 BaseLib >> +=C2=A0 BaseMemoryLib >> +=C2=A0 MemoryAllocationLib >> +=C2=A0 UefiRuntimeServicesTableLib >> +=C2=A0 DebugLib >> +=C2=A0 MbedTlsLib >> +=C2=A0 PrintLib >> +=C2=A0 IntrinsicLib >> +=C2=A0 RngLib >> +=C2=A0 SynchronizationLib >> +[Protocols] >> +=C2=A0 gEfiMpServiceProtocolGuid >> +# >> +# Remove these [BuildOptions] after this library is cleaned up >> +# >> +[BuildOptions] >> +=C2=A0 MSFT:*_*_*_CC_FLAGS =3D /GL- >> diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/PeiCryptLib.inf=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/PeiCryptLib.inf >> new file mode 100644 >> index 0000000000..72b22a24e8 >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/PeiCryptLib.inf >> @@ -0,0 +1,101 @@ >> +## @file >> +#=C2=A0 Cryptographic Library Instance for PEIM. >> +# >> +#=C2=A0 Caution: This module requires additional review when modified. >> +#=C2=A0 This library will have external input - signature. >> +#=C2=A0 This external input must be validated carefully to avoid securi= ty=20 >> issues such as >> +#=C2=A0 buffer overflow or integer overflow. >> +# >> +#=C2=A0 Note: >> +#=C2=A0 HMAC-SHA256 functions, AES functions, RSA external >> +#=C2=A0 functions, PKCS#7 SignedData sign functions, Diffie-Hellman=20 >> functions, X.509 >> +#=C2=A0 certificate handler functions, authenticode signature verificat= ion=20 >> functions, >> +#=C2=A0 PEM handler functions, and pseudorandom number generator functi= ons=20 >> are not >> +#=C2=A0 supported in this instance. >> +# >> +#=C2=A0 Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +#=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +## >> + >> +[Defines] >> +=C2=A0 INF_VERSION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0x00010= 005 >> +=C2=A0 BASE_NAME=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D PeiCryptLib >> +=C2=A0 MODULE_UNI_FILE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D PeiCryptLib.uni >> +=C2=A0 FILE_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D 91E0A3C3-37A7-4AEE-8689-C5B0AD2C8E63 >> +=C2=A0 MODULE_TYPE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D PEIM >> +=C2=A0 VERSION_STRING=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 1.0 >> +=C2=A0 LIBRARY_CLASS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D BaseCryptLib|PEIM P= EI_CORE >> + >> +# >> +# The following information is for reference only and not required by= =20 >> the build tools. >> +# >> +#=C2=A0 VALID_ARCHITECTURES=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =3D IA32 X64 >> +# >> + >> +[Sources] >> +=C2=A0 InternalCryptLib.h >> +=C2=A0 Hash/CryptMd5.c >> +=C2=A0 Hash/CryptSha1.c >> +=C2=A0 Hash/CryptSha256.c >> +=C2=A0 Hash/CryptSm3Null.c >> +=C2=A0 Hash/CryptSha512.c >> +=C2=A0 Hash/CryptParallelHashNull.c >> +=C2=A0 Hmac/CryptHmac.c >> +=C2=A0 Kdf/CryptHkdf.c >> +=C2=A0 Cipher/CryptAes.c >> +=C2=A0 Cipher/CryptAeadAesGcmNull.c >> +=C2=A0 Pk/CryptRsaBasic.c >> +=C2=A0 Pk/CryptRsaExtNull.c >> +=C2=A0 Pk/CryptRsaPss.c >> +=C2=A0 Pk/CryptRsaPssSignNull.c >> +=C2=A0 Bn/CryptBnNull.c >> +=C2=A0 Pem/CryptPemNull.c >> +=C2=A0 Pk/CryptDhNull.c >> +=C2=A0 Pk/CryptEcNull.c >> +=C2=A0 Pk/CryptPkcs1OaepNull.c >> +=C2=A0 Pk/CryptPkcs5Pbkdf2Null.c >> +=C2=A0 Pk/CryptPkcs7SignNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyEkuNull.c >> +=C2=A0 Pk/CryptX509Null.c >> +=C2=A0 Pk/CryptAuthenticodeNull.c >> +=C2=A0 Pk/CryptTsNull.c >> +=C2=A0 Rand/CryptRandNull.c >> +=C2=A0 SysCall/CrtWrapper.c >> +=C2=A0 SysCall/ConstantTimeClock.c >> + >> +[Packages] >> +=C2=A0 MdePkg/MdePkg.dec >> +=C2=A0 CryptoPkg/CryptoPkg.dec >> + >> +[LibraryClasses] >> +=C2=A0 BaseLib >> +=C2=A0 BaseMemoryLib >> +=C2=A0 MemoryAllocationLib >> +=C2=A0 DebugLib >> +=C2=A0 MbedTlsLib >> +=C2=A0 IntrinsicLib >> +=C2=A0 PrintLib >> +=C2=A0 PeiServicesTablePointerLib >> +=C2=A0 PeiServicesLib >> +=C2=A0 SynchronizationLib >> + >> +[Ppis] >> +=C2=A0 gEfiPeiMpServicesPpiGuid >> +# >> +# Remove these [BuildOptions] after this library is cleaned up >> +# >> +[BuildOptions] >> +=C2=A0 # >> +=C2=A0 # suppress the following warnings so we do not break the build w= ith=20 >> warnings-as-errors: >> +=C2=A0 # C4090: 'function' : different 'const' qualifiers >> +=C2=A0 # C4718: 'function call' : recursive call has no side effects,= =20 >> deleting >> +=C2=A0 # >> +=C2=A0 MSFT:*_*_*_CC_FLAGS =3D /wd4090 /wd4718 >> + >> +=C2=A0 GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 >> +=C2=A0 GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 >> +=C2=A0 GCC:*_CLANGPDB_*_CC_FLAGS =3D -std=3Dc99=20 >> -Wno-error=3Dincompatible-pointer-types >> + >> +=C2=A0 XCODE:*_*_*_CC_FLAGS =3D -std=3Dc99 >> diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/PeiCryptLib.uni=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/PeiCryptLib.uni >> new file mode 100644 >> index 0000000000..3a6845642d >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/PeiCryptLib.uni >> @@ -0,0 +1,25 @@ >> +// /** @file >> +// Cryptographic Library Instance for PEIM. >> +// >> +// Caution: This module requires additional review when modified. >> +// This library will have external input - signature. >> +// This external input must be validated carefully to avoid security=20 >> issues such as >> +// buffer overflow or integer overflow. >> +// >> +// Note: AES >> +// functions, RSA external functions, PKCS#7 SignedData sign functions, >> +// Diffie-Hellman functions, X.509 certificate handler functions,=20 >> authenticode >> +// signature verification functions, PEM handler functions, and=20 >> pseudorandom number >> +// generator functions are not supported in this instance. >> +// >> +// Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +// >> +// SPDX-License-Identifier: BSD-2-Clause-Patent >> +// >> +// **/ >> + >> + >> +#string STR_MODULE_ABSTRACT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #language en-US=20 >> "Cryptographic Library Instance for PEIM" >> + >> +#string STR_MODULE_DESCRIPTION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 #language en-US "Caution:=20 >> This module requires additional review when modified. This library=20 >> will have external input - signature. This external input must be=20 >> validated carefully to avoid security issues such as buffer overflow=20 >> or integer overflow. Note: AES functions, RSA external functions,=20 >> PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509=20 >> certificate handler functions, authenticode signature verification=20 >> functions, PEM handler functions, and pseudorandom number generator=20 >> functions are not supported in this instance." >> + >> diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/RuntimeCryptLib.inf= =20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/RuntimeCryptLib.inf >> new file mode 100644 >> index 0000000000..9f17ef00bf >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/RuntimeCryptLib.inf >> @@ -0,0 +1,92 @@ >> +## @file >> +#=C2=A0 Cryptographic Library Instance for DXE_RUNTIME_DRIVER. >> +# >> +#=C2=A0 Caution: This module requires additional review when modified. >> +#=C2=A0 This library will have external input - signature. >> +#=C2=A0 This external input must be validated carefully to avoid securi= ty=20 >> issues such as >> +#=C2=A0 buffer overflow or integer overflow. >> +# >> +#=C2=A0 Note: SHA-384 Digest functions, SHA-512 Digest functions, >> +#=C2=A0 HMAC-SHA256 functions, AES functions, RSA external >> +#=C2=A0 functions, PKCS#7 SignedData sign functions, Diffie-Hellman=20 >> functions, and >> +#=C2=A0 authenticode signature verification functions are not supported= in=20 >> this instance. >> +# >> +#=C2=A0 Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +#=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +## >> + >> +[Defines] >> +=C2=A0 INF_VERSION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0x00010= 005 >> +=C2=A0 BASE_NAME=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D RuntimeCryptLib >> +=C2=A0 MODULE_UNI_FILE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D RuntimeCryptLib.uni >> +=C2=A0 FILE_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D D263B580-D9FC-4DC4-B445-578AAEFF530E >> +=C2=A0 MODULE_TYPE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D DXE_RUN= TIME_DRIVER >> +=C2=A0 VERSION_STRING=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 1.0 >> +=C2=A0 LIBRARY_CLASS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D BaseCryptLib|DXE_RU= NTIME_DRIVER >> +=C2=A0 CONSTRUCTOR=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D Runtime= CryptLibConstructor >> + >> +# >> +# The following information is for reference only and not required by= =20 >> the build tools. >> +# >> +#=C2=A0 VALID_ARCHITECTURES=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =3D IA32 X64 ARM AARCH64 >> +# >> + >> +[Sources] >> +=C2=A0 InternalCryptLib.h >> +=C2=A0 Hash/CryptMd5.c >> +=C2=A0 Hash/CryptSha1.c >> +=C2=A0 Hash/CryptSha256.c >> +=C2=A0 Hash/CryptSm3Null.c >> +=C2=A0 Hash/CryptSha512.c >> +=C2=A0 Hash/CryptParallelHashNull.c >> +=C2=A0 Hmac/CryptHmac.c >> +=C2=A0 Kdf/CryptHkdf.c >> +=C2=A0 Cipher/CryptAes.c >> +=C2=A0 Cipher/CryptAeadAesGcmNull.c >> +=C2=A0 Pk/CryptRsaBasic.c >> +=C2=A0 Pk/CryptRsaExtNull.c >> +=C2=A0 Pk/CryptRsaPssNull.c >> +=C2=A0 Pk/CryptRsaPssSignNull.c >> +=C2=A0 Bn/CryptBnNull.c >> +=C2=A0 Pem/CryptPemNull.c >> +=C2=A0 Pk/CryptDhNull.c >> +=C2=A0 Pk/CryptEcNull.c >> +=C2=A0 Pk/CryptPkcs1OaepNull.c >> +=C2=A0 Pk/CryptPkcs5Pbkdf2Null.c >> +=C2=A0 Pk/CryptPkcs7SignNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyEkuNull.c >> +=C2=A0 Pk/CryptX509Null.c >> +=C2=A0 Pk/CryptAuthenticodeNull.c >> +=C2=A0 Pk/CryptTsNull.c >> +=C2=A0 Rand/CryptRandNull.c >> +=C2=A0 SysCall/CrtWrapper.c >> +=C2=A0 SysCall/TimerWrapper.c >> +=C2=A0 SysCall/RuntimeMemAllocation.c >> + >> +[Packages] >> +=C2=A0 MdePkg/MdePkg.dec >> +=C2=A0 CryptoPkg/CryptoPkg.dec >> + >> +[LibraryClasses] >> +=C2=A0 BaseLib >> +=C2=A0 BaseMemoryLib >> +=C2=A0 UefiRuntimeServicesTableLib >> +=C2=A0 DebugLib >> +=C2=A0 MbedTlsLib >> +=C2=A0 IntrinsicLib >> +=C2=A0 PrintLib >> + >> +# >> +# Remove these [BuildOptions] after this library is cleaned up >> +# >> +[BuildOptions] >> +=C2=A0 # >> +=C2=A0 # suppress the following warnings so we do not break the build w= ith=20 >> warnings-as-errors: >> +=C2=A0 # >> +=C2=A0 GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 >> +=C2=A0 GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 >> +=C2=A0 GCC:*_CLANGPDB_*_CC_FLAGS =3D -std=3Dc99=20 >> -Wno-error=3Dincompatible-pointer-types >> + >> +=C2=A0 XCODE:*_*_*_CC_FLAGS =3D -std=3Dc99 >> diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/RuntimeCryptLib.uni= =20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/RuntimeCryptLib.uni >> new file mode 100644 >> index 0000000000..b2a2f5ff21 >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/RuntimeCryptLib.uni >> @@ -0,0 +1,22 @@ >> +// /** @file >> +// Cryptographic Library Instance for DXE_RUNTIME_DRIVER. >> +// >> +// Caution: This module requires additional review when modified. >> +// This library will have external input - signature. >> +// This external input must be validated carefully to avoid security=20 >> issues such as >> +// buffer overflow or integer overflow. >> +// >> +// Note: AES >> +// functions, RSA external functions, PKCS#7 SignedData sign functions, >> +// Diffie-Hellman functions, and authenticode signature verification=20 >> functions are >> +// not supported in this instance. >> +// >> +// Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +// >> +// SPDX-License-Identifier: BSD-2-Clause-Patent >> +// >> +// **/ >> + >> +#string STR_MODULE_ABSTRACT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #language en-US=20 >> "Cryptographic Library Instance for DXE_RUNTIME_DRIVER" >> + >> +#string STR_MODULE_DESCRIPTION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 #language en-US "Caution:=20 >> This module requires additional review when modified. This library=20 >> will have external input - signature. This external input must be=20 >> validated carefully to avoid security issues such as buffer overflow=20 >> or integer overflow. Note: AES functions, RSA external functions,=20 >> PKCS#7 SignedData sign functions, Diffie-Hellman functions, and=20 >> authenticode signature verification functions are not supported in=20 >> this instance." >> diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SecCryptLib.inf=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/SecCryptLib.inf >> new file mode 100644 >> index 0000000000..6fc073aac6 >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SecCryptLib.inf >> @@ -0,0 +1,84 @@ >> +## @file >> +#=C2=A0 Cryptographic Library Instance for SEC. >> +# >> +#=C2=A0 Caution: This module requires additional review when modified. >> +#=C2=A0 This library will have external input - signature. >> +#=C2=A0 This external input must be validated carefully to avoid securi= ty=20 >> issues such as >> +#=C2=A0 buffer overflow or integer overflow. >> +# >> +#=C2=A0 Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +#=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +## >> + >> +[Defines] >> +=C2=A0 INF_VERSION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0x00010= 005 >> +=C2=A0 BASE_NAME=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D SecCryptLib >> +=C2=A0 MODULE_UNI_FILE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D SecCryptLib.uni >> +=C2=A0 FILE_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D 894C367F-254A-4563-8624-798D46EAD796 >> +=C2=A0 MODULE_TYPE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D BASE >> +=C2=A0 VERSION_STRING=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 1.0 >> +=C2=A0 LIBRARY_CLASS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D BaseCryptLib|SEC >> + >> +# >> +# The following information is for reference only and not required by= =20 >> the build tools. >> +# >> +#=C2=A0 VALID_ARCHITECTURES=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =3D IA32 X64 >> +# >> + >> +[Sources] >> +=C2=A0 InternalCryptLib.h >> +=C2=A0 Hash/CryptSha512.c >> + >> +=C2=A0 Hash/CryptMd5Null.c >> +=C2=A0 Hash/CryptSha1Null.c >> +=C2=A0 Hash/CryptSha256Null.c >> +=C2=A0 Hash/CryptSm3Null.c >> +=C2=A0 Hash/CryptParallelHashNull.c >> +=C2=A0 Hmac/CryptHmacNull.c >> +=C2=A0 Kdf/CryptHkdfNull.c >> +=C2=A0 Cipher/CryptAesNull.c >> +=C2=A0 Cipher/CryptAeadAesGcmNull.c >> +=C2=A0 Pk/CryptRsaBasicNull.c >> +=C2=A0 Pk/CryptRsaExtNull.c >> +=C2=A0 Bn/CryptBnNull.c >> +=C2=A0 Pem/CryptPemNull.c >> +=C2=A0 Pk/CryptDhNull.c >> +=C2=A0 Pk/CryptEcNull.c >> +=C2=A0 Pk/CryptPkcs1OaepNull.c >> +=C2=A0 Pk/CryptPkcs5Pbkdf2Null.c >> +=C2=A0 Pk/CryptPkcs7SignNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyEkuNull.c >> +=C2=A0 Pk/CryptX509Null.c >> +=C2=A0 Pk/CryptAuthenticodeNull.c >> +=C2=A0 Pk/CryptTsNull.c >> +=C2=A0 Rand/CryptRandNull.c >> +=C2=A0 SysCall/CrtWrapper.c >> +=C2=A0 SysCall/ConstantTimeClock.c >> + >> +[Packages] >> +=C2=A0 MdePkg/MdePkg.dec >> +=C2=A0 CryptoPkg/CryptoPkg.dec >> + >> +[LibraryClasses] >> +=C2=A0 BaseLib >> +=C2=A0 BaseMemoryLib >> +=C2=A0 MemoryAllocationLib >> +=C2=A0 DebugLib >> +=C2=A0 MbedTlsLib >> +=C2=A0 IntrinsicLib >> +=C2=A0 PrintLib >> + >> +# >> +# Remove these [BuildOptions] after this library is cleaned up >> +# >> +[BuildOptions] >> +=C2=A0 # >> +=C2=A0 # suppress the following warnings so we do not break the build w= ith=20 >> warnings-as-errors: >> +=C2=A0 # >> +=C2=A0 GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 >> +=C2=A0 GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 >> +=C2=A0 GCC:*_CLANGPDB_*_CC_FLAGS =3D -std=3Dc99=20 >> -Wno-error=3Dincompatible-pointer-types >> + >> +=C2=A0 XCODE:*_*_*_CC_FLAGS =3D -std=3Dc99 >> diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SecCryptLib.uni=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/SecCryptLib.uni >> new file mode 100644 >> index 0000000000..be2fc4067f >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SecCryptLib.uni >> @@ -0,0 +1,17 @@ >> +// /** @file >> +// Cryptographic Library Instance for SEC driver. >> +// >> +// Caution: This module requires additional review when modified. >> +// This library will have external input - signature. >> +// This external input must be validated carefully to avoid security=20 >> issues such as >> +// buffer overflow or integer overflow. >> +// >> +// Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +// >> +// SPDX-License-Identifier: BSD-2-Clause-Patent >> +// >> +// **/ >> + >> +#string STR_MODULE_ABSTRACT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #language en-US=20 >> "Cryptographic Library Instance for SEC driver" >> + >> +#string STR_MODULE_DESCRIPTION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 #language en-US "Caution:=20 >> This module requires additional review when modified. This library=20 >> will have external input - signature. This external input must be=20 >> validated carefully to avoid security issues such as buffer overflow=20 >> or integer overflow. Note: AES functions, RSA external functions,=20 >> PKCS#7 SignedData sign functions, Diffie-Hellman functions, and=20 >> authenticode signature verification functions are not supported in=20 >> this instance." >> diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SmmCryptLib.inf=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/SmmCryptLib.inf >> new file mode 100644 >> index 0000000000..40c56d1b7d >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SmmCryptLib.inf >> @@ -0,0 +1,92 @@ >> +## @file >> +#=C2=A0 Cryptographic Library Instance for SMM driver. >> +# >> +#=C2=A0 Caution: This module requires additional review when modified. >> +#=C2=A0 This library will have external input - signature. >> +#=C2=A0 This external input must be validated carefully to avoid securi= ty=20 >> issues such as >> +#=C2=A0 buffer overflow or integer overflow. >> +# >> +#=C2=A0 Note: SHA-384 Digest functions, SHA-512 Digest functions, >> +#=C2=A0 RSA external functions, PKCS#7 SignedData sign functions,=20 >> Diffie-Hellman functions, and >> +#=C2=A0 authenticode signature verification functions are not supported= in=20 >> this instance. >> +# >> +#=C2=A0 Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +#=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +## >> + >> +[Defines] >> +=C2=A0 INF_VERSION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0x00010= 005 >> +=C2=A0 BASE_NAME=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D SmmCryptLib >> +=C2=A0 MODULE_UNI_FILE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D SmmCryptLib.uni >> +=C2=A0 FILE_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D CF104633-9901-4504-AD7A-91690926A253 >> +=C2=A0 MODULE_TYPE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D DXE_SMM= _DRIVER >> +=C2=A0 VERSION_STRING=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 1.0 >> +=C2=A0 PI_SPECIFICATION_VERSION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D= 0x0001000A >> +=C2=A0 LIBRARY_CLASS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D BaseCryptLib|DXE_SM= M_DRIVER=20 >> SMM_CORE MM_STANDALONE >> + >> +# >> +# The following information is for reference only and not required by= =20 >> the build tools. >> +# >> +#=C2=A0 VALID_ARCHITECTURES=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =3D IA32 X64 ARM AARCH64 >> +# >> + >> +[Sources] >> +=C2=A0 InternalCryptLib.h >> +=C2=A0 Hash/CryptMd5.c >> +=C2=A0 Hash/CryptSha1.c >> +=C2=A0 Hash/CryptSha256.c >> +=C2=A0 Hash/CryptSm3Null.c >> +=C2=A0 Hash/CryptSha512.c >> +=C2=A0 Hash/CryptParallelHashNull.c >> +=C2=A0 Hmac/CryptHmac.c >> +=C2=A0 Kdf/CryptHkdf.c >> +=C2=A0 Cipher/CryptAes.c >> +=C2=A0 Cipher/CryptAeadAesGcmNull.c >> +=C2=A0 Pk/CryptRsaBasic.c >> +=C2=A0 Pk/CryptRsaExtNull.c >> +=C2=A0 Pk/CryptRsaPss.c >> +=C2=A0 Pk/CryptRsaPssSignNull.c >> +=C2=A0 Bn/CryptBnNull.c >> +=C2=A0 Pem/CryptPemNull.c >> +=C2=A0 Pk/CryptDhNull.c >> +=C2=A0 Pk/CryptEcNull.c >> +=C2=A0 Pk/CryptPkcs1OaepNull.c >> +=C2=A0 Pk/CryptPkcs5Pbkdf2Null.c >> +=C2=A0 Pk/CryptPkcs7SignNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyEkuNull.c >> +=C2=A0 Pk/CryptX509Null.c >> +=C2=A0 Pk/CryptAuthenticodeNull.c >> +=C2=A0 Pk/CryptTsNull.c >> +=C2=A0 Rand/CryptRandNull.c >> +=C2=A0 SysCall/CrtWrapper.c >> +=C2=A0 SysCall/ConstantTimeClock.c >> + >> +[Packages] >> +=C2=A0 MdePkg/MdePkg.dec >> +=C2=A0 CryptoPkg/CryptoPkg.dec >> + >> +[LibraryClasses] >> +=C2=A0 BaseLib >> +=C2=A0 BaseMemoryLib >> +=C2=A0 MemoryAllocationLib >> +=C2=A0 MbedTlsLib >> +=C2=A0 IntrinsicLib >> +=C2=A0 PrintLib >> +=C2=A0 MmServicesTableLib >> +=C2=A0 SynchronizationLib >> + >> +# >> +# Remove these [BuildOptions] after this library is cleaned up >> +# >> +[BuildOptions] >> +=C2=A0 # >> +=C2=A0 # suppress the following warnings so we do not break the build w= ith=20 >> warnings-as-errors: >> +=C2=A0 # >> + >> +=C2=A0 XCODE:*_*_*_CC_FLAGS =3D -mmmx -msse -std=3Dc99 >> + >> +=C2=A0 GCC:*_CLANG35_*_CC_FLAGS =3D -std=3Dc99 >> +=C2=A0 GCC:*_CLANG38_*_CC_FLAGS =3D -std=3Dc99 >> +=C2=A0 GCC:*_CLANGPDB_*_CC_FLAGS =3D -std=3Dc99=20 >> -Wno-error=3Dincompatible-pointer-types >> diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SmmCryptLib.uni=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/SmmCryptLib.uni >> new file mode 100644 >> index 0000000000..13948c2f3d >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SmmCryptLib.uni >> @@ -0,0 +1,22 @@ >> +// /** @file >> +// Cryptographic Library Instance for SMM driver. >> +// >> +// Caution: This module requires additional review when modified. >> +// This library will have external input - signature. >> +// This external input must be validated carefully to avoid security=20 >> issues such as >> +// buffer overflow or integer overflow. >> +// >> +// Note: AES >> +// functions, RSA external functions, PKCS#7 SignedData sign functions, >> +// Diffie-Hellman functions, and authenticode signature verification=20 >> functions are >> +// not supported in this instance. >> +// >> +// Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +// >> +// SPDX-License-Identifier: BSD-2-Clause-Patent >> +// >> +// **/ >> + >> +#string STR_MODULE_ABSTRACT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #language en-US=20 >> "Cryptographic Library Instance for SMM driver" >> + >> +#string STR_MODULE_DESCRIPTION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 #language en-US "Caution:=20 >> This module requires additional review when modified. This library=20 >> will have external input - signature. This external input must be=20 >> validated carefully to avoid security issues such as buffer overflow=20 >> or integer overflow. Note: AES functions, RSA external functions,=20 >> PKCS#7 SignedData sign functions, Diffie-Hellman functions, and=20 >> authenticode signature verification functions are not supported in=20 >> this instance." >> diff --git=20 >> a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c >> new file mode 100644 >> index 0000000000..2ec13ef9d0 >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c >> @@ -0,0 +1,75 @@ >> +/** @file >> +=C2=A0 C Run-Time Libraries (CRT) Time Management Routines Wrapper=20 >> Implementation >> +=C2=A0 for MbedTLS-based Cryptographic Library. >> + >> +=C2=A0 This C file implements constant time value for time() and NULL f= or=20 >> gmtime() >> +=C2=A0 thus should not be used in library instances which require=20 >> functionality >> +=C2=A0 of following APIs which need system time support: >> +=C2=A0 1)=C2=A0 RsaGenerateKey >> +=C2=A0 2)=C2=A0 RsaCheckKey >> +=C2=A0 3)=C2=A0 RsaPkcs1Sign >> +=C2=A0 4)=C2=A0 Pkcs7Sign >> +=C2=A0 5)=C2=A0 DhGenerateParameter >> +=C2=A0 6)=C2=A0 DhGenerateKey >> + >> +Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#include >> +#include >> + >> +typedef int time_t; >> + >> +// >> +// Structures Definitions >> +// >> +struct tm { >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_sec;=C2=A0=C2=A0=C2=A0 /* seconds= after the minute [0-60] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_min;=C2=A0=C2=A0=C2=A0 /* minutes= after the hour [0-59] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_hour;=C2=A0=C2=A0 /* hours since = midnight [0-23] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_mday;=C2=A0=C2=A0 /* day of the m= onth [1-31] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_mon;=C2=A0=C2=A0=C2=A0 /* months = since January [0-11] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_year;=C2=A0=C2=A0 /* years since = 1900 */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_wday;=C2=A0=C2=A0 /* days since S= unday [0-6] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_yday;=C2=A0=C2=A0 /* days since J= anuary 1 [0-365] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_isdst;=C2=A0 /* Daylight Savings = Time flag */ >> +=C2=A0 long=C2=A0=C2=A0=C2=A0 tm_gmtoff; /* offset from CUT in seconds = */ >> +=C2=A0 char=C2=A0=C2=A0=C2=A0 *tm_zone;=C2=A0 /* timezone abbreviation = */ >> +}; >> + >> +// >> +// -- Time Management Routines -- >> +// >> + >> +/**time function. **/ >> +time_t >> +time ( >> +=C2=A0 time_t=C2=A0 *timer >> +=C2=A0 ) >> +{ >> +=C2=A0 if (timer !=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 *timer =3D 0; >> +=C2=A0 } >> + >> +=C2=A0 return 0; >> +} >> + >> +/**gmtime function. **/ >> +struct tm * >> +gmtime ( >> +=C2=A0 const time_t=C2=A0 *timer >> +=C2=A0 ) >> +{ >> +=C2=A0 return NULL; >> +} >> + >> +/**_time64 function. **/ >> +time_t >> +_time64 ( >> +=C2=A0 time_t=C2=A0 *t >> +=C2=A0 ) >> +{ >> +=C2=A0 return time (t); >> +} >> diff --git=20 >> a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c >> new file mode 100644 >> index 0000000000..f1d9b9c35c >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c >> @@ -0,0 +1,58 @@ >> +/** @file >> +=C2=A0 C Run-Time Libraries (CRT) Wrapper Implementation for MbedTLS-ba= sed >> +=C2=A0 Cryptographic Library. >> + >> +Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +/**dummy mbedtls_printf function. **/ >> +int >> +mbedtls_printf ( >> +=C2=A0 char const=C2=A0 *fmt, >> +=C2=A0 ... >> +=C2=A0 ) >> +{ >> +=C2=A0 ASSERT (FALSE); >> +=C2=A0 return 0; >> +} >> + >> +/**dummy mbedtls_vsnprintf function. **/ >> +int >> +mbedtls_vsnprintf ( >> +=C2=A0 char=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *str, >> +=C2=A0 size_t=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 size, >> +=C2=A0 const char=C2=A0 *format, >> +=C2=A0 ... >> +=C2=A0 ) >> +{ >> +=C2=A0 ASSERT (FALSE); >> +=C2=A0 return 0; >> +} >> + >> +/**strchr function. **/ >> +char * >> +strchr ( >> +=C2=A0 const char=C2=A0 *str, >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ch >> +=C2=A0 ) >> +{ >> +=C2=A0 return ScanMem8 (str, AsciiStrSize (str), (char)ch); >> +} >> + >> +/**strcmp function. **/ >> +int >> +strcmp ( >> +=C2=A0 const char=C2=A0 *s1, >> +=C2=A0 const char=C2=A0 *s2 >> +=C2=A0 ) >> +{ >> +=C2=A0 return (int)AsciiStrCmp (s1, s2); >> +} >> diff --git=20 >> a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/RuntimeMemAllocation.c= =20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/RuntimeMemAllocation.c >> new file mode 100644 >> index 0000000000..51992029a8 >> --- /dev/null >> +++=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/RuntimeMemAllocation.c >> @@ -0,0 +1,462 @@ >> +/** @file >> +=C2=A0 Light-weight Memory Management Routines for MbedTLS-based Crypto >> +=C2=A0 Library at Runtime Phase. >> + >> +Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +// ---------------------------------------------------------------- >> +// Initial version. Needs further optimizations. >> +// ---------------------------------------------------------------- >> + >> +// >> +// Definitions for Runtime Memory Operations >> +// >> +#define RT_PAGE_SIZE=C2=A0=C2=A0 0x200 >> +#define RT_PAGE_MASK=C2=A0=C2=A0 0x1FF >> +#define RT_PAGE_SHIFT=C2=A0 9 >> + >> +#define RT_SIZE_TO_PAGES(a)=C2=A0 (((a) >> RT_PAGE_SHIFT) + (((a) &=20 >> RT_PAGE_MASK) ? 1 : 0)) >> +#define RT_PAGES_TO_SIZE(a)=C2=A0 ((a) << RT_PAGE_SHIFT) >> + >> +// >> +// Page Flag Definitions >> +// >> +#define RT_PAGE_FREE=C2=A0 0x00000000 >> +#define RT_PAGE_USED=C2=A0 0x00000001 >> + >> +#define MIN_REQUIRED_BLOCKS=C2=A0 600 >> + >> +// >> +// Memory Page Table >> +// >> +typedef struct { >> +=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0 StartPageOffset;=C2=A0=C2=A0=C2=A0= // Offset of the starting page=20 >> allocated. >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Only available for USED pages= . >> +=C2=A0 UINT32=C2=A0=C2=A0=C2=A0 PageFlag;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Page Attributes. >> +} RT_MEMORY_PAGE_ENTRY; >> + >> +typedef struct { >> +=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PageCount; >> +=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 LastEmptyPageOffset; >> +=C2=A0 UINT8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *DataAreaBase;=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 // Pointer to data Area. >> +=C2=A0 RT_MEMORY_PAGE_ENTRY=C2=A0=C2=A0=C2=A0 Pages[1];=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Page Table Entries. >> +} RT_MEMORY_PAGE_TABLE; >> + >> +// >> +// Global Page Table for Runtime Cryptographic Provider. >> +// >> +RT_MEMORY_PAGE_TABLE=C2=A0 *mRTPageTable =3D NULL; >> + >> +// >> +// Event for Runtime Address Conversion. >> +// >> +STATIC EFI_EVENT=C2=A0 mVirtualAddressChangeEvent; >> + >> +/** >> +=C2=A0 Initializes pre-allocated memory pointed by ScratchBuffer for=20 >> subsequent >> +=C2=A0 runtime use. >> + >> +=C2=A0 @param[in, out]=C2=A0 ScratchBuffer=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 Pointer to user-supplied memory=20 >> buffer. >> +=C2=A0 @param[in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ScratchBufferSize= =C2=A0 Size of supplied buffer in bytes. >> + >> +=C2=A0 @retval EFI_SUCCESS=C2=A0 Successful initialization. >> + >> +**/ >> +EFI_STATUS >> +InitializeScratchMemory ( >> +=C2=A0 IN OUT=C2=A0 UINT8=C2=A0 *ScratchBuffer, >> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 UINTN=C2=A0 ScratchBufferSize >> +=C2=A0 ) >> +{ >> +=C2=A0 UINTN=C2=A0 Index; >> +=C2=A0 UINTN=C2=A0 MemorySize; >> + >> +=C2=A0 // >> +=C2=A0 // Parameters Checking >> +=C2=A0 // >> +=C2=A0 if (ScratchBuffer =3D=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 return EFI_INVALID_PARAMETER; >> +=C2=A0 } >> + >> +=C2=A0 if (ScratchBufferSize < MIN_REQUIRED_BLOCKS * 1024) { >> +=C2=A0=C2=A0=C2=A0 return EFI_BUFFER_TOO_SMALL; >> +=C2=A0 } >> + >> +=C2=A0 mRTPageTable =3D (RT_MEMORY_PAGE_TABLE *)ScratchBuffer; >> + >> +=C2=A0 // >> +=C2=A0 // Initialize Internal Page Table for Memory Management >> +=C2=A0 // >> +=C2=A0 SetMem (mRTPageTable, ScratchBufferSize, 0xFF); >> +=C2=A0 MemorySize =3D ScratchBufferSize - sizeof (RT_MEMORY_PAGE_TABLE)= +=20 >> sizeof (RT_MEMORY_PAGE_ENTRY); >> + >> +=C2=A0 mRTPageTable->PageCount=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 =3D MemorySize / (RT_PAGE_SIZE +=20 >> sizeof (RT_MEMORY_PAGE_ENTRY)); >> +=C2=A0 mRTPageTable->LastEmptyPageOffset =3D 0x0; >> + >> +=C2=A0 for (Index =3D 0; Index < mRTPageTable->PageCount; Index++) { >> +=C2=A0=C2=A0=C2=A0 mRTPageTable->Pages[Index].PageFlag=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D RT_PAGE_FREE; >> +=C2=A0=C2=A0=C2=A0 mRTPageTable->Pages[Index].StartPageOffset =3D 0; >> +=C2=A0 } >> + >> +=C2=A0 mRTPageTable->DataAreaBase =3D ScratchBuffer + sizeof=20 >> (RT_MEMORY_PAGE_TABLE) + >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mRTPageTable->PageCount - 1) * sizeof= =20 >> (RT_MEMORY_PAGE_ENTRY); >> + >> +=C2=A0 return EFI_SUCCESS; >> +} >> + >> +/** >> +=C2=A0 Look-up Free memory Region for object allocation. >> + >> +=C2=A0 @param[in]=C2=A0 AllocationSize=C2=A0 Bytes to be allocated. >> + >> +=C2=A0 @return=C2=A0 Return available page offset for object allocation= . >> + >> +**/ >> +UINTN >> +LookupFreeMemRegion ( >> +=C2=A0 IN=C2=A0 UINTN=C2=A0 AllocationSize >> +=C2=A0 ) >> +{ >> +=C2=A0 UINTN=C2=A0 StartPageIndex; >> +=C2=A0 UINTN=C2=A0 Index; >> +=C2=A0 UINTN=C2=A0 SubIndex; >> +=C2=A0 UINTN=C2=A0 ReqPages; >> + >> +=C2=A0 StartPageIndex =3D RT_SIZE_TO_PAGES (mRTPageTable->LastEmptyPage= Offset); >> +=C2=A0 ReqPages=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D RT_SIZE_TO_PAGE= S (AllocationSize); >> +=C2=A0 if (ReqPages > mRTPageTable->PageCount) { >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 // No enough region for object allocation. >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 return (UINTN)(-1); >> +=C2=A0 } >> + >> +=C2=A0 // >> +=C2=A0 // Look up the free memory region with in current memory map tab= le. >> +=C2=A0 // >> +=C2=A0 for (Index =3D StartPageIndex; Index <=3D (mRTPageTable->PageCou= nt -=20 >> ReqPages); ) { >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 // Check consecutive ReqPages pages. >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 for (SubIndex =3D 0; SubIndex < ReqPages; SubIndex++= ) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ((mRTPageTable->Pages[SubIndex + Inde= x].PageFlag &=20 >> RT_PAGE_USED) !=3D 0) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 if (SubIndex =3D=3D ReqPages) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Succeed! Return the Starting Offset. >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return RT_PAGES_TO_SIZE (Index); >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 // Failed! Skip current free memory pages and adjace= nt Used pages >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 while ((mRTPageTable->Pages[SubIndex + Index].PageFl= ag &=20 >> RT_PAGE_USED) !=3D 0) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SubIndex++; >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 Index +=3D SubIndex; >> +=C2=A0 } >> + >> +=C2=A0 // >> +=C2=A0 // Look up the free memory region from the beginning of the memo= ry=20 >> table >> +=C2=A0 // until the StartCursorOffset >> +=C2=A0 // >> +=C2=A0 if (ReqPages > StartPageIndex) { >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 // No enough region for object allocation. >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 return (UINTN)(-1); >> +=C2=A0 } >> + >> +=C2=A0 for (Index =3D 0; Index < (StartPageIndex - ReqPages); ) { >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 // Check Consecutive ReqPages Pages. >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 for (SubIndex =3D 0; SubIndex < ReqPages; SubIndex++= ) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ((mRTPageTable->Pages[SubIndex + Inde= x].PageFlag &=20 >> RT_PAGE_USED) !=3D 0) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 if (SubIndex =3D=3D ReqPages) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Succeed! Return the Starting Offset. >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return RT_PAGES_TO_SIZE (Index); >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 // Failed! Skip current adjacent Used pages >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 while ((SubIndex < (StartPageIndex - ReqPages)) && >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((mRTPageT= able->Pages[SubIndex + Index].PageFlag &=20 >> RT_PAGE_USED) !=3D 0)) >> +=C2=A0=C2=A0=C2=A0 { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SubIndex++; >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 Index +=3D SubIndex; >> +=C2=A0 } >> + >> +=C2=A0 // >> +=C2=A0 // No available region for object allocation! >> +=C2=A0 // >> +=C2=A0 return (UINTN)(-1); >> +} >> + >> +/** >> +=C2=A0 Allocates a buffer at runtime phase. >> + >> +=C2=A0 @param[in]=C2=A0 AllocationSize=C2=A0=C2=A0=C2=A0 Bytes to be al= located. >> + >> +=C2=A0 @return=C2=A0 A pointer to the allocated buffer or NULL if alloc= ation=20 >> fails. >> + >> +**/ >> +VOID * >> +RuntimeAllocateMem ( >> +=C2=A0 IN=C2=A0 UINTN=C2=A0 AllocationSize >> +=C2=A0 ) >> +{ >> +=C2=A0 UINT8=C2=A0 *AllocPtr; >> +=C2=A0 UINTN=C2=A0 ReqPages; >> +=C2=A0 UINTN=C2=A0 Index; >> +=C2=A0 UINTN=C2=A0 StartPage; >> +=C2=A0 UINTN=C2=A0 AllocOffset; >> + >> +=C2=A0 AllocPtr =3D NULL; >> +=C2=A0 ReqPages =3D 0; >> + >> +=C2=A0 // >> +=C2=A0 // Look for available consecutive memory region starting from=20 >> LastEmptyPageOffset. >> +=C2=A0 // If no proper memory region found, look up from the beginning. >> +=C2=A0 // If still not found, return NULL to indicate failed allocation= . >> +=C2=A0 // >> +=C2=A0 AllocOffset =3D LookupFreeMemRegion (AllocationSize); >> +=C2=A0 if (AllocOffset =3D=3D (UINTN)(-1)) { >> +=C2=A0=C2=A0=C2=A0 return NULL; >> +=C2=A0 } >> + >> +=C2=A0 // >> +=C2=A0 // Allocates consecutive memory pages with length of Size. Updat= e=20 >> the page >> +=C2=A0 // table status. Returns the starting address. >> +=C2=A0 // >> +=C2=A0 ReqPages=C2=A0 =3D RT_SIZE_TO_PAGES (AllocationSize); >> +=C2=A0 AllocPtr=C2=A0 =3D mRTPageTable->DataAreaBase + AllocOffset; >> +=C2=A0 StartPage =3D RT_SIZE_TO_PAGES (AllocOffset); >> +=C2=A0 Index=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0; >> +=C2=A0 while (Index < ReqPages) { >> +=C2=A0=C2=A0=C2=A0 mRTPageTable->Pages[StartPage + Index].PageFlag=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=3D=20 >> RT_PAGE_USED; >> +=C2=A0=C2=A0=C2=A0 mRTPageTable->Pages[StartPage + Index].StartPageOffs= et =3D=20 >> AllocOffset; >> + >> +=C2=A0=C2=A0=C2=A0 Index++; >> +=C2=A0 } >> + >> +=C2=A0 mRTPageTable->LastEmptyPageOffset =3D AllocOffset + RT_PAGES_TO_= SIZE=20 >> (ReqPages); >> + >> +=C2=A0 ZeroMem (AllocPtr, AllocationSize); >> + >> +=C2=A0 // >> +=C2=A0 // Returns a VOID pointer to the allocated space >> +=C2=A0 // >> +=C2=A0 return AllocPtr; >> +} >> + >> +/** >> +=C2=A0 Frees a buffer that was previously allocated at runtime phase. >> + >> +=C2=A0 @param[in]=C2=A0 Buffer=C2=A0 Pointer to the buffer to free. >> + >> +**/ >> +VOID >> +RuntimeFreeMem ( >> +=C2=A0 IN=C2=A0 VOID=C2=A0 *Buffer >> +=C2=A0 ) >> +{ >> +=C2=A0 UINTN=C2=A0 StartOffset; >> +=C2=A0 UINTN=C2=A0 StartPageIndex; >> + >> +=C2=A0 StartOffset=C2=A0=C2=A0=C2=A0 =3D (UINTN)Buffer - (UINTN)mRTPage= Table->DataAreaBase; >> +=C2=A0 StartPageIndex =3D RT_SIZE_TO_PAGES=20 >> (mRTPageTable->Pages[RT_SIZE_TO_PAGES (StartOffset)].StartPageOffset); >> + >> +=C2=A0 while (StartPageIndex < mRTPageTable->PageCount) { >> +=C2=A0=C2=A0=C2=A0 if (((mRTPageTable->Pages[StartPageIndex].PageFlag &= =20 >> RT_PAGE_USED) !=3D 0) && >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mRTPageTable->Pages[StartPa= geIndex].StartPageOffset =3D=3D=20 >> StartOffset)) >> +=C2=A0=C2=A0=C2=A0 { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Free this page >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mRTPageTable->Pages[StartPageIndex].Page= Flag=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &=3D=20 >> ~RT_PAGE_USED; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mRTPageTable->Pages[StartPageIndex].Page= Flag=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=3D=20 >> RT_PAGE_FREE; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mRTPageTable->Pages[StartPageIndex].Star= tPageOffset =3D 0; >> + >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 StartPageIndex++; >> +=C2=A0=C2=A0=C2=A0 } else { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> +=C2=A0=C2=A0=C2=A0 } >> +=C2=A0 } >> + >> +=C2=A0 return; >> +} >> + >> +/** >> +=C2=A0 Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE. >> + >> +=C2=A0 This is a notification function registered on=20 >> EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE >> +=C2=A0 event. It converts a pointer to a new virtual address. >> + >> +=C2=A0 @param[in]=C2=A0 Event=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The event w= hose notification function is=20 >> being invoked. >> +=C2=A0 @param[in]=C2=A0 Context=C2=A0=C2=A0=C2=A0 The pointer to the no= tification function's=20 >> context. >> + >> +**/ >> +VOID >> +EFIAPI >> +RuntimeCryptLibAddressChangeEvent ( >> +=C2=A0 IN=C2=A0 EFI_EVENT=C2=A0 Event, >> +=C2=A0 IN=C2=A0 VOID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Context >> +=C2=A0 ) >> +{ >> +=C2=A0 // >> +=C2=A0 // Converts a pointer for runtime memory management to a new=20 >> virtual address. >> +=C2=A0 // >> +=C2=A0 EfiConvertPointer (0x0, (VOID **)&mRTPageTable->DataAreaBase); >> +=C2=A0 EfiConvertPointer (0x0, (VOID **)&mRTPageTable); >> +} >> + >> +/** >> +=C2=A0 Constructor routine for runtime crypt library instance. >> + >> +=C2=A0 The constructor function pre-allocates space for runtime=20 >> cryptographic operation. >> + >> +=C2=A0 @param=C2=A0 ImageHandle=C2=A0=C2=A0 The firmware allocated hand= le for the EFI image. >> +=C2=A0 @param=C2=A0 SystemTable=C2=A0=C2=A0 A pointer to the EFI System= Table. >> + >> +=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 The construction succeeded. >> +=C2=A0 @retval EFI_OUT_OF_RESOURCE=C2=A0 Failed to allocate memory. >> + >> +**/ >> +EFI_STATUS >> +EFIAPI >> +RuntimeCryptLibConstructor ( >> +=C2=A0 IN EFI_HANDLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ImageHan= dle, >> +=C2=A0 IN EFI_SYSTEM_TABLE=C2=A0 *SystemTable >> +=C2=A0 ) >> +{ >> +=C2=A0 EFI_STATUS=C2=A0 Status; >> +=C2=A0 VOID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Buffer; >> + >> +=C2=A0 // >> +=C2=A0 // Pre-allocates runtime space for possible cryptographic operat= ions >> +=C2=A0 // >> +=C2=A0 Buffer =3D AllocateRuntimePool (MIN_REQUIRED_BLOCKS * 1024); >> +=C2=A0 Status =3D InitializeScratchMemory (Buffer, MIN_REQUIRED_BLOCKS = * 1024); >> +=C2=A0 if (EFI_ERROR (Status)) { >> +=C2=A0=C2=A0=C2=A0 return Status; >> +=C2=A0 } >> + >> +=C2=A0 // >> +=C2=A0 // Create address change event >> +=C2=A0 // >> +=C2=A0 Status =3D gBS->CreateEventEx ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 EVT_NOTIFY_SIGNAL, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 TPL_NOTIFY, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 RuntimeCryptLibAddressChangeEvent, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &gEfiEventVirtualAddressChangeGuid, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &mVirtualAddressChangeEvent >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >> +=C2=A0 ASSERT_EFI_ERROR (Status); >> + >> +=C2=A0 return Status; >> +} >> + >> +// >> +// -- Memory-Allocation Routines Wrapper for UEFI-MbedTLS Library -- >> +// >> + >> +/** Allocates memory blocks. **/ >> +VOID * >> +malloc ( >> +=C2=A0 size_t=C2=A0 size >> +=C2=A0 ) >> +{ >> +=C2=A0 return RuntimeAllocateMem ((UINTN)size); >> +} >> + >> +/** Reallocate memory blocks. **/ >> +VOID * >> +realloc ( >> +=C2=A0 VOID=C2=A0=C2=A0=C2=A0 *ptr, >> +=C2=A0 size_t=C2=A0 size >> +=C2=A0 ) >> +{ >> +=C2=A0 VOID=C2=A0=C2=A0 *NewPtr; >> +=C2=A0 UINTN=C2=A0 StartOffset; >> +=C2=A0 UINTN=C2=A0 StartPageIndex; >> +=C2=A0 UINTN=C2=A0 PageCount; >> + >> +=C2=A0 if (ptr =3D=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 return malloc (size); >> +=C2=A0 } >> + >> +=C2=A0 // >> +=C2=A0 // Get Original Size of ptr >> +=C2=A0 // >> +=C2=A0 StartOffset=C2=A0=C2=A0=C2=A0 =3D (UINTN)ptr - (UINTN)mRTPageTab= le->DataAreaBase; >> +=C2=A0 StartPageIndex =3D RT_SIZE_TO_PAGES=20 >> (mRTPageTable->Pages[RT_SIZE_TO_PAGES (StartOffset)].StartPageOffset); >> +=C2=A0 PageCount=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0; >> +=C2=A0 while (StartPageIndex < mRTPageTable->PageCount) { >> +=C2=A0=C2=A0=C2=A0 if (((mRTPageTable->Pages[StartPageIndex].PageFlag &= =20 >> RT_PAGE_USED) !=3D 0) && >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mRTPageTable->Pages[StartPa= geIndex].StartPageOffset =3D=3D=20 >> StartOffset)) >> +=C2=A0=C2=A0=C2=A0 { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 StartPageIndex++; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PageCount++; >> +=C2=A0=C2=A0=C2=A0 } else { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> +=C2=A0=C2=A0=C2=A0 } >> +=C2=A0 } >> + >> +=C2=A0 if (size <=3D RT_PAGES_TO_SIZE (PageCount)) { >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 // Return the original pointer, if Caller try to red= uce region size; >> +=C2=A0=C2=A0=C2=A0 // >> +=C2=A0=C2=A0=C2=A0 return ptr; >> +=C2=A0 } >> + >> +=C2=A0 NewPtr =3D RuntimeAllocateMem ((UINTN)size); >> +=C2=A0 if (NewPtr =3D=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 return NULL; >> +=C2=A0 } >> + >> +=C2=A0 CopyMem (NewPtr, ptr, RT_PAGES_TO_SIZE (PageCount)); >> + >> +=C2=A0 RuntimeFreeMem (ptr); >> + >> +=C2=A0 return NewPtr; >> +} >> + >> +/** Deallocates or frees a memory block. **/ >> +VOID >> +free ( >> +=C2=A0 VOID=C2=A0 *ptr >> +=C2=A0 ) >> +{ >> +=C2=A0 // >> +=C2=A0 // In Standard C, free() handles a null pointer argument=20 >> transparently. This >> +=C2=A0 // is not true of RuntimeFreeMem() below, so protect it. >> +=C2=A0 // >> +=C2=A0 if (ptr !=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 RuntimeFreeMem (ptr); >> +=C2=A0 } >> +} >> diff --git=20 >> a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c >> new file mode 100644 >> index 0000000000..b7cd4d3181 >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c >> @@ -0,0 +1,198 @@ >> +/** @file >> +=C2=A0 C Run-Time Libraries (CRT) Time Management Routines Wrapper=20 >> Implementation >> +=C2=A0 for MbedTLS-based Cryptographic Library (used in DXE & RUNTIME). >> + >> +Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#include >> +#include >> +#include >> +#include >> + >> +typedef int time_t; >> + >> +// >> +// Structures Definitions >> +// >> +struct tm { >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_sec;=C2=A0=C2=A0=C2=A0 /* seconds= after the minute [0-60] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_min;=C2=A0=C2=A0=C2=A0 /* minutes= after the hour [0-59] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_hour;=C2=A0=C2=A0 /* hours since = midnight [0-23] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_mday;=C2=A0=C2=A0 /* day of the m= onth [1-31] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_mon;=C2=A0=C2=A0=C2=A0 /* months = since January [0-11] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_year;=C2=A0=C2=A0 /* years since = 1900 */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_wday;=C2=A0=C2=A0 /* days since S= unday [0-6] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_yday;=C2=A0=C2=A0 /* days since J= anuary 1 [0-365] */ >> +=C2=A0 int=C2=A0=C2=A0=C2=A0=C2=A0 tm_isdst;=C2=A0 /* Daylight Savings = Time flag */ >> +=C2=A0 long=C2=A0=C2=A0=C2=A0 tm_gmtoff; /* offset from CUT in seconds = */ >> +=C2=A0 char=C2=A0=C2=A0=C2=A0 *tm_zone;=C2=A0 /* timezone abbreviation = */ >> +}; >> + >> +// >> +// -- Time Management Routines -- >> +// >> + >> +#define IsLeap(y)=C2=A0 (((y) % 4) =3D=3D 0 && (((y) % 100) !=3D 0 || (= (y) %=20 >> 400) =3D=3D 0)) >> +#define SECSPERMIN=C2=A0=C2=A0 (60) >> +#define SECSPERHOUR=C2=A0 (60 * 60) >> +#define SECSPERDAY=C2=A0=C2=A0 (24 * SECSPERHOUR) >> + >> +// >> +//=C2=A0 The arrays give the cumulative number of days up to the first = of the >> +//=C2=A0 month number used as the index (1 -> 12) for regular and leap = years. >> +//=C2=A0 The value at index 13 is for the whole year. >> +// >> +UINTN=C2=A0 CumulativeDays[2][14] =3D { >> +=C2=A0 { >> +=C2=A0=C2=A0=C2=A0 0, >> +=C2=A0=C2=A0=C2=A0 0, >> +=C2=A0=C2=A0=C2=A0 31, >> +=C2=A0=C2=A0=C2=A0 31 + 28, >> +=C2=A0=C2=A0=C2=A0 31 + 28 + 31, >> +=C2=A0=C2=A0=C2=A0 31 + 28 + 31 + 30, >> +=C2=A0=C2=A0=C2=A0 31 + 28 + 31 + 30 + 31, >> +=C2=A0=C2=A0=C2=A0 31 + 28 + 31 + 30 + 31 + 30, >> +=C2=A0=C2=A0=C2=A0 31 + 28 + 31 + 30 + 31 + 30 + 31, >> +=C2=A0=C2=A0=C2=A0 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31, >> +=C2=A0=C2=A0=C2=A0 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, >> +=C2=A0=C2=A0=C2=A0 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, >> +=C2=A0=C2=A0=C2=A0 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30= , >> +=C2=A0=C2=A0=C2=A0 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30= + 31 >> +=C2=A0 }, >> +=C2=A0 { >> +=C2=A0=C2=A0=C2=A0 0, >> +=C2=A0=C2=A0=C2=A0 0, >> +=C2=A0=C2=A0=C2=A0 31, >> +=C2=A0=C2=A0=C2=A0 31 + 29, >> +=C2=A0=C2=A0=C2=A0 31 + 29 + 31, >> +=C2=A0=C2=A0=C2=A0 31 + 29 + 31 + 30, >> +=C2=A0=C2=A0=C2=A0 31 + 29 + 31 + 30 + 31, >> +=C2=A0=C2=A0=C2=A0 31 + 29 + 31 + 30 + 31 + 30, >> +=C2=A0=C2=A0=C2=A0 31 + 29 + 31 + 30 + 31 + 30 + 31, >> +=C2=A0=C2=A0=C2=A0 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31, >> +=C2=A0=C2=A0=C2=A0 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30, >> +=C2=A0=C2=A0=C2=A0 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, >> +=C2=A0=C2=A0=C2=A0 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30= , >> +=C2=A0=C2=A0=C2=A0 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30= + 31 >> +=C2=A0 } >> +}; >> + >> +/** Get the system time as seconds elapsed since midnight, January 1,= =20 >> 1970. **/ >> +time_t >> +time ( >> +=C2=A0 time_t=C2=A0 *timer >> +=C2=A0 ) >> +{ >> +=C2=A0 EFI_STATUS=C2=A0 Status; >> +=C2=A0 EFI_TIME=C2=A0=C2=A0=C2=A0 Time; >> +=C2=A0 time_t=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CalTime; >> +=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Year; >> + >> +=C2=A0 // >> +=C2=A0 // Get the current time and date information >> +=C2=A0 // >> +=C2=A0 Status =3D gRT->GetTime (&Time, NULL); >> +=C2=A0 if (EFI_ERROR (Status) || (Time.Year < 1970)) { >> +=C2=A0=C2=A0=C2=A0 return 0; >> +=C2=A0 } >> + >> +=C2=A0 // >> +=C2=A0 // Years Handling >> +=C2=A0 // UTime should now be set to 00:00:00 on Jan 1 of the current y= ear. >> +=C2=A0 // >> +=C2=A0 for (Year =3D 1970, CalTime =3D 0; Year !=3D Time.Year; Year++) = { >> +=C2=A0=C2=A0=C2=A0 CalTime =3D CalTime + (time_t)(CumulativeDays[IsLeap= (Year)][13] *=20 >> SECSPERDAY); >> +=C2=A0 } >> + >> +=C2=A0 // >> +=C2=A0 // Add in number of seconds for current Month, Day, Hour, Minute= ,=20 >> Seconds, and TimeZone adjustment >> +=C2=A0 // >> +=C2=A0 CalTime =3D CalTime + >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (tim= e_t)((Time.TimeZone !=3D EFI_UNSPECIFIED_TIMEZONE) ?=20 >> (Time.TimeZone * 60) : 0) + >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (tim= e_t)(CumulativeDays[IsLeap (Time.Year)][Time.Month] *=20 >> SECSPERDAY) + >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (tim= e_t)(((Time.Day > 0) ? Time.Day - 1 : 0) * SECSPERDAY) + >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (tim= e_t)(Time.Hour * SECSPERHOUR) + >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (tim= e_t)(Time.Minute * 60) + >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (tim= e_t)Time.Second; >> + >> +=C2=A0 if (timer !=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 *timer =3D CalTime; >> +=C2=A0 } >> + >> +=C2=A0 return CalTime; >> +} >> + >> +/** Convert a time value from type time_t to struct tm. **/ >> +struct tm * >> +gmtime ( >> +=C2=A0 const time_t=C2=A0 *timer >> +=C2=A0 ) >> +{ >> +=C2=A0 struct tm=C2=A0 *GmTime; >> +=C2=A0 UINT16=C2=A0=C2=A0=C2=A0=C2=A0 DayNo; >> +=C2=A0 UINT16=C2=A0=C2=A0=C2=A0=C2=A0 DayRemainder; >> +=C2=A0 time_t=C2=A0=C2=A0=C2=A0=C2=A0 Year; >> +=C2=A0 time_t=C2=A0=C2=A0=C2=A0=C2=A0 YearNo; >> +=C2=A0 UINT16=C2=A0=C2=A0=C2=A0=C2=A0 TotalDays; >> +=C2=A0 UINT16=C2=A0=C2=A0=C2=A0=C2=A0 MonthNo; >> + >> +=C2=A0 if (timer =3D=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 return NULL; >> +=C2=A0 } >> + >> +=C2=A0 GmTime =3D AllocateZeroPool (sizeof (struct tm)); >> +=C2=A0 if (GmTime =3D=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 return NULL; >> +=C2=A0 } >> + >> +=C2=A0 ZeroMem ((VOID *)GmTime, (UINTN)sizeof (struct tm)); >> + >> +=C2=A0 DayNo=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D (UINT16)(*ti= mer / SECSPERDAY); >> +=C2=A0 DayRemainder =3D (UINT16)(*timer % SECSPERDAY); >> + >> +=C2=A0 GmTime->tm_sec=C2=A0 =3D (int)(DayRemainder % SECSPERMIN); >> +=C2=A0 GmTime->tm_min=C2=A0 =3D (int)((DayRemainder % SECSPERHOUR) / SE= CSPERMIN); >> +=C2=A0 GmTime->tm_hour =3D (int)(DayRemainder / SECSPERHOUR); >> +=C2=A0 GmTime->tm_wday =3D (int)((DayNo + 4) % 7); >> + >> +=C2=A0 for (Year =3D 1970, YearNo =3D 0; DayNo > 0; Year++) { >> +=C2=A0=C2=A0=C2=A0 TotalDays =3D (UINT16)(IsLeap (Year) ? 366 : 365); >> +=C2=A0=C2=A0=C2=A0 if (DayNo >=3D TotalDays) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DayNo =3D (UINT16)(DayNo - TotalDays); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 YearNo++; >> +=C2=A0=C2=A0=C2=A0 } else { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> +=C2=A0=C2=A0=C2=A0 } >> +=C2=A0 } >> + >> +=C2=A0 GmTime->tm_year =3D (int)(YearNo + (1970 - 1900)); >> +=C2=A0 GmTime->tm_yday =3D (int)DayNo; >> + >> +=C2=A0 for (MonthNo =3D 12; MonthNo > 1; MonthNo--) { >> +=C2=A0=C2=A0=C2=A0 if (DayNo >=3D CumulativeDays[IsLeap (Year)][MonthNo= ]) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DayNo =3D (UINT16)(DayNo - (UINT16)(Cumu= lativeDays[IsLeap=20 >> (Year)][MonthNo])); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> +=C2=A0=C2=A0=C2=A0 } >> +=C2=A0 } >> + >> +=C2=A0 GmTime->tm_mon=C2=A0 =3D (int)MonthNo - 1; >> +=C2=A0 GmTime->tm_mday =3D (int)DayNo + 1; >> + >> +=C2=A0 GmTime->tm_isdst=C2=A0 =3D 0; >> +=C2=A0 GmTime->tm_gmtoff =3D 0; >> +=C2=A0 GmTime->tm_zone=C2=A0=C2=A0 =3D NULL; >> + >> +=C2=A0 return GmTime; >> +} >> + >> +/**_time64 function. **/ >> +time_t >> +_time64 ( >> +=C2=A0 time_t=C2=A0 *t >> +=C2=A0 ) >> +{ >> +=C2=A0 return time (t); >> +} >> diff --git=20 >> a/CryptoPkg/Library/BaseCryptLibMbedTls/TestBaseCryptLib.inf=20 >> b/CryptoPkg/Library/BaseCryptLibMbedTls/TestBaseCryptLib.inf >> new file mode 100644 >> index 0000000000..def990b996 >> --- /dev/null >> +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/TestBaseCryptLib.inf >> @@ -0,0 +1,76 @@ >> +## @file >> +#=C2=A0 Cryptographic Library Instance for DXE_DRIVER. >> +# >> +#=C2=A0 Caution: This module requires additional review when modified. >> +#=C2=A0 This library will have external input - signature. >> +#=C2=A0 This external input must be validated carefully to avoid securi= ty=20 >> issues such as >> +#=C2=A0 buffer overflow or integer overflow. >> +# >> +#=C2=A0 Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +#=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +## >> + >> +[Defines] >> +=C2=A0 INF_VERSION=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0x00010= 005 >> +=C2=A0 BASE_NAME=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D BaseCryptLib >> +=C2=A0 FILE_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = =3D 9DD60CFE-9D05-41E2-8B9E-958E2A4C1913 >> +=C2=A0 MODULE_TYPE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D DXE_DRI= VER >> +=C2=A0 VERSION_STRING=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 1.0 >> +=C2=A0 LIBRARY_CLASS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D BaseCryptLib|DXE_DR= IVER DXE_CORE=20 >> UEFI_APPLICATION UEFI_DRIVER >> + >> +# >> +# The following information is for reference only and not required by= =20 >> the build tools. >> +# >> +#=C2=A0 VALID_ARCHITECTURES=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =3D IA32 X64 ARM AARCH64 >> +# >> + >> +[Sources] >> +=C2=A0 InternalCryptLib.h >> +=C2=A0 Cipher/CryptAeadAesGcmNull.c >> +=C2=A0 Cipher/CryptAes.c >> +=C2=A0 Hash/CryptSha256.c >> +=C2=A0 Hash/CryptSha512.c >> +=C2=A0 Hash/CryptSm3Null.c >> +=C2=A0 Hash/CryptMd5.c >> +=C2=A0 Hash/CryptSha1.c >> +=C2=A0 Hmac/CryptHmac.c >> +=C2=A0 Kdf/CryptHkdf.c >> +=C2=A0 Pk/CryptRsaBasic.c >> +=C2=A0 Pk/CryptRsaExtNull.c >> +=C2=A0 Pk/CryptRsaPss.c >> +=C2=A0 Pk/CryptRsaPssSignNull.c >> +=C2=A0 Bn/CryptBnNull.c >> +=C2=A0 Pem/CryptPemNull.c >> +=C2=A0 Pk/CryptDhNull.c >> +=C2=A0 Pk/CryptEcNull.c >> +=C2=A0 Pk/CryptPkcs1OaepNull.c >> +=C2=A0 Pk/CryptPkcs5Pbkdf2Null.c >> +=C2=A0 Pk/CryptPkcs7SignNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyNull.c >> +=C2=A0 Pk/CryptPkcs7VerifyEkuNull.c >> +=C2=A0 Pk/CryptX509Null.c >> +=C2=A0 Pk/CryptAuthenticodeNull.c >> +=C2=A0 Pk/CryptTsNull.c >> +=C2=A0 Rand/CryptRandNull.c >> +=C2=A0 SysCall/CrtWrapper.c >> + >> +[Packages] >> +=C2=A0 MdePkg/MdePkg.dec >> +=C2=A0 CryptoPkg/CryptoPkg.dec >> + >> +[LibraryClasses] >> +=C2=A0 BaseLib >> +=C2=A0 BaseMemoryLib >> +=C2=A0 MemoryAllocationLib >> +=C2=A0 UefiRuntimeServicesTableLib >> +=C2=A0 DebugLib >> +=C2=A0 MbedTlsLib >> +=C2=A0 PrintLib >> +=C2=A0 RngLib >> + >> +# >> +# Remove these [BuildOptions] after this library is cleaned up >> +# >> +[BuildOptions] >> +=C2=A0 MSFT:*_*_*_CC_FLAGS =3D /GL- >> diff --git a/CryptoPkg/Library/Include/stdint.h=20 >> b/CryptoPkg/Library/Include/stdint.h >> new file mode 100644 >> index 0000000000..17b8c767d7 >> --- /dev/null >> +++ b/CryptoPkg/Library/Include/stdint.h >> @@ -0,0 +1,19 @@ >> +/** @file >> +=C2=A0 Include file to support building the third-party cryptographic= =20 >> library. >> + >> +Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#include >> + >> +typedef INT8=C2=A0=C2=A0=C2=A0 int8_t; >> +typedef UINT8=C2=A0=C2=A0 uint8_t; >> +typedef INT16=C2=A0=C2=A0 int16_t; >> +typedef UINT16=C2=A0 uint16_t; >> +typedef INT32=C2=A0=C2=A0 int32_t; >> +typedef UINT32=C2=A0 uint32_t; >> +typedef INT64=C2=A0=C2=A0 int64_t; >> +typedef UINT64=C2=A0 uint64_t; >> +typedef UINTN=C2=A0=C2=A0 uintptr_t; >> diff --git a/CryptoPkg/Library/Include/stubs-32.h=20 >> b/CryptoPkg/Library/Include/stubs-32.h >> new file mode 100644 >> index 0000000000..786d57e8d5 >> --- /dev/null >> +++ b/CryptoPkg/Library/Include/stubs-32.h >> @@ -0,0 +1,9 @@ >> +/** @file >> +=C2=A0 Include file to support building the third-party cryptographic= =20 >> library. >> + >> +Copyright (c) 2023, Intel Corporation. All rights reserved.
>> +SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#include >> diff --git a/CryptoPkg/Library/MbedTlsLib/EcSm2Null.c=20 >> b/CryptoPkg/Library/MbedTlsLib/EcSm2Null.c >> index c7d5c393a1..1c9cd72b70 100644 >> --- a/CryptoPkg/Library/MbedTlsLib/EcSm2Null.c >> +++ b/CryptoPkg/Library/MbedTlsLib/EcSm2Null.c >> @@ -12,7 +12,7 @@ >> =C2=A0 #include >> =C2=A0 #include >> =C2=A0 #include >> -#include >> +#include >> =C2=A0 /* >> =C2=A0=C2=A0 * Get the curve info for the internal identifier >=20 --=20 Alexey -=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 (#112357): https://edk2.groups.io/g/devel/message/112357 Mute This Topic: https://groups.io/mt/101639981/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-