VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/CryptoPkgMbedTls.dsc@ 108794

Last change on this file since 108794 was 108794, checked in by vboxsync, 2 weeks ago

Devices/EFI/FirmwareNew: Merge edk2-stable202502 from the vendor branch and make it build for the important platforms, bugref:4643

  • Property svn:eol-style set to native
File size: 15.6 KB
Line 
1## @file
2# Cryptographic Library Package for UEFI Security Implementation.
3# PEIM, DXE Driver, and SMM Driver with all crypto services enabled.
4#
5# Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
6# SPDX-License-Identifier: BSD-2-Clause-Patent
7#
8##
9
10################################################################################
11#
12# Defines Section - statements that will be processed to create a Makefile.
13#
14################################################################################
15[Defines]
16 PLATFORM_NAME = CryptoPkg
17 PLATFORM_GUID = E1063286-6C8C-4c25-AEF0-67A9A5B6E6B6
18 PLATFORM_VERSION = 0.98
19 DSC_SPECIFICATION = 0x00010005
20 OUTPUT_DIRECTORY = Build/CryptoPkgMbed
21 SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64
22 BUILD_TARGETS = DEBUG|RELEASE|NOOPT
23 SKUID_IDENTIFIER = DEFAULT
24
25!ifndef CRYPTO_IMG_TYPE
26 DEFINE CRYPTO_IMG_TYPE = DXE_SMM
27!endif
28
29!if $(CRYPTO_IMG_TYPE) IN "PEI_DEFAULT PEI_PREMEM DXE_SMM"
30!else
31 !error CRYPTO_IMG_TYPE must be set to one of PEI_DEFAULT PEI_PREMEM DXE_SMM.
32!endif
33
34################################################################################
35#
36# Library Class section - list of all Library Classes needed by this Platform.
37#
38################################################################################
39
40!include MdePkg/MdeLibs.dsc.inc
41[LibraryClasses]
42 BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
43 BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
44 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
45 DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
46 UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
47 UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
48 BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
49 TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
50 HashApiLib|CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf
51 RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
52 SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
53
54[LibraryClasses.common.PEIM]
55 PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
56 MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
57 PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
58 PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
59 HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
60
61[LibraryClasses.common.DXE_SMM_DRIVER]
62 SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
63 MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
64 MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
65 SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
66
67[LibraryClasses]
68 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
69 DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
70 DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
71 OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
72 PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
73 DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
74 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
75 TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
76 UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
77 IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
78 MbedTlsLib|CryptoPkg/Library/MbedTlsLib/MbedTlsLib.inf
79 OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
80 IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
81 SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
82
83[LibraryClasses.common.PEIM]
84 PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
85 ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
86 BaseCryptLib|CryptoPkg/Library/BaseCryptLibMbedTls/PeiCryptLib.inf
87 TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
88
89[LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM]
90 PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
91
92[LibraryClasses.ARM.PEIM, LibraryClasses.AARCH64.PEIM]
93 PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
94
95[LibraryClasses.common.DXE_DRIVER]
96 ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
97 BaseCryptLib|CryptoPkg/Library/BaseCryptLibMbedTls/BaseCryptLib.inf
98 TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
99
100[LibraryClasses.common.DXE_SMM_DRIVER]
101 ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf
102 BaseCryptLib|CryptoPkg/Library/BaseCryptLibMbedTls/SmmCryptLib.inf
103 TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
104
105################################################################################
106#
107# Pcd Section - list of all EDK II PCD Entries defined by this Platform
108#
109################################################################################
110[PcdsFixedAtBuild]
111 gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
112 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
113 gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x06
114
115!if $(CRYPTO_IMG_TYPE) IN "DXE_SMM"
116 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacMd5.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
117 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha1.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
118 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
119 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md4.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
120 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md5.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
121 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
122 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Dh.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
123 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Random.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
124 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
125 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
126 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
127 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
128 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
129 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.X509.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
130 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tdes.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
131 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
132 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Arc4.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
133 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
134 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Hkdf.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
135 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tls.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
136 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsSet.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
137 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsGet.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
138 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.ParallelHash.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
139!endif
140
141!if $(CRYPTO_IMG_TYPE) IN "PEI_DEFAULT"
142 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Aes.Family | PCD_CRYPTO_SERVICE_ENABLE_FAMILY
143
144 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Pkcs1Verify | TRUE
145 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.New | TRUE
146 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.SetKey | TRUE
147 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Rsa.Services.Free | TRUE
148
149 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Services.GetContextSize | TRUE
150 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Services.Init | TRUE
151 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Services.Update | TRUE
152 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha1.Services.Final | TRUE
153
154 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services.GetContextSize | TRUE
155 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services.Init | TRUE
156 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services.Update | TRUE
157 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services.Final | TRUE
158
159 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services.GetContextSize | TRUE
160 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services.Init | TRUE
161 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services.Update | TRUE
162 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services.Final | TRUE
163 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services.HashAll | TRUE
164
165 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.GetContextSize | TRUE
166 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.Init | TRUE
167 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.Update | TRUE
168 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.Final | TRUE
169 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.HashAll | TRUE
170 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sm3.Services.Duplicate | TRUE
171 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Services.New | TRUE
172 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Services.Free | TRUE
173 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Services.SetKey | TRUE
174 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Services.Duplicate | TRUE
175 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Services.Update | TRUE
176 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Services.Final | TRUE
177 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Hkdf.Services.Sha256ExtractAndExpand | TRUE
178!endif
179
180!if $(CRYPTO_IMG_TYPE) IN "PEI_PREMEM"
181 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services.GetContextSize | TRUE
182 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services.Init | TRUE
183 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services.Update | TRUE
184 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha256.Services.Final | TRUE
185
186 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services.GetContextSize | TRUE
187 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services.Init | TRUE
188 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services.Update | TRUE
189 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services.Final | TRUE
190 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha384.Services.HashAll | TRUE
191
192 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Services.GetContextSize | TRUE
193 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Services.Init | TRUE
194 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Services.Update | TRUE
195 gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Sha512.Services.Final | TRUE
196!endif
197
198###################################################################################################
199#
200# Components Section - list of the modules and components that will be processed by compilation
201# tools and the EDK II tools to generate PE32/PE32+/Coff image files.
202#
203# Note: The EDK II DSC file is not used to specify how compiled binary images get placed
204# into firmware volume images. This section is just a list of modules to compile from
205# source into UEFI-compliant binaries.
206# It is the FDF file that contains information on combining binary files into firmware
207# volume images, whose concept is beyond UEFI and is described in PI specification.
208# Binary modules do not need to be listed in this section, as they should be
209# specified in the FDF file. For example: Shell binary (Shell_Full.efi), FAT binary (Fat.efi),
210# Logo (Logo.bmp), and etc.
211# There may also be modules listed in this section that are not required in the FDF file,
212# When a module listed here is excluded from FDF file, then UEFI-compliant binary will be
213# generated for it, but the binary will not be put into any firmware volume.
214#
215###################################################################################################
216
217!if $(CRYPTO_IMG_TYPE) IN "PEI_DEFAULT PEI_PREMEM"
218[Components.IA32, Components.X64, Components.ARM, Components.AARCH64]
219 CryptoPkg/Driver/CryptoPei.inf {
220 <Defines>
221 !if "$(CRYPTO_SERVICES)" == "ALL"
222 FILE_GUID = 8DF53C2E-3380-495F-A8B7-370CFE28E1C6
223 !elseif "$(CRYPTO_SERVICES)" == "NONE"
224 FILE_GUID = E5A97EE3-71CC-407F-9DA9-6BE0C8A6C7DF
225 !elseif "$(CRYPTO_SERVICES)" == "MIN_PEI"
226 FILE_GUID = 0F5827A9-35FD-4F41-8D38-9BAFCE594D31
227 !endif
228 }
229!endif
230
231!if $(CRYPTO_IMG_TYPE) IN "DXE_SMM"
232[Components.IA32, Components.X64, Components.AARCH64]
233 CryptoPkg/Driver/CryptoDxe.inf {
234 <Defines>
235 !if "$(CRYPTO_SERVICES)" == "ALL"
236 FILE_GUID = D9444B06-060D-42C5-9344-F04707BE0169
237 !elseif "$(CRYPTO_SERVICES)" == "NONE"
238 FILE_GUID = C7A340F4-A6CC-4F95-A2DA-42BEA4C3944A
239 !elseif "$(CRYPTO_SERVICES)" == MIN_DXE_MIN_SMM
240 FILE_GUID = DDF5BE9E-159A-4B77-B6D7-82B84B5763A2
241 !endif
242 }
243
244[Components.IA32, Components.X64]
245 CryptoPkg/Driver/CryptoSmm.inf {
246 <Defines>
247 !if "$(CRYPTO_SERVICES)" == "ALL"
248 FILE_GUID = A3542CE8-77F7-49DC-A834-45D37D2EC1FA
249 !elseif "$(CRYPTO_SERVICES)" == "NONE"
250 FILE_GUID = 6DCB3127-01E7-4131-A487-DC77A965A541
251 !elseif "$(CRYPTO_SERVICES)" == MIN_DXE_MIN_SMM
252 FILE_GUID = 85F7EA15-3A2B-474A-8875-180542CD6BF3
253 !endif
254 }
255!endif
256
257[BuildOptions]
258 *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
259 MSFT:*_*_*_CC_FLAGS = /D ENABLE_MD5_DEPRECATED_INTERFACES
260 INTEL:*_*_*_CC_FLAGS = /D ENABLE_MD5_DEPRECATED_INTERFACES
261 GCC:*_*_*_CC_FLAGS = -D ENABLE_MD5_DEPRECATED_INTERFACES
262 RVCT:*_*_*_CC_FLAGS = -DENABLE_MD5_DEPRECATED_INTERFACES
263!if $(CRYPTO_IMG_TYPE) IN "DXE_SMM"
264 MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
265 GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000
266!endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette