PcdCryptoServiceFamilyEnable.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. /** @file
  2. Defines the PCD_CRYPTO_SERVICE_FAMILY_ENABLE structure associated with
  3. gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable that is used
  4. to enable/disable crypto services at either the family scope or the
  5. individual service scope. Platforms can minimize the number of enabled
  6. services to reduce size.
  7. The following services have been deprecated and must never be enabled.
  8. The associated fields in this data structure are never removed or replaced
  9. to preseve the binary layout of the data structure. New services are
  10. always added to the end of the data structure.
  11. * HmacMd5 family
  12. * HmacSha1 family
  13. * Md4 family
  14. * Md5 family
  15. * Tdes family
  16. * Arc4 family
  17. * Aes.Services.EcbEncrypt service
  18. * Aes.Services.EcbDecrypt service
  19. Is is recommended that the following services always be disabled and may
  20. be deprecated in the future.
  21. * Sha1 family
  22. Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.<BR>
  23. SPDX-License-Identifier: BSD-2-Clause-Patent
  24. **/
  25. #ifndef __PCD_CRYPTO_SERVICE_FAMILY_ENABLE_H__
  26. #define __PCD_CRYPTO_SERVICE_FAMILY_ENABLE_H__
  27. ///
  28. /// Define used to enable all the crypto services in a family
  29. ///
  30. #define PCD_CRYPTO_SERVICE_ENABLE_FAMILY 0xFFFFFFFF
  31. ///
  32. /// PCD_CRYPTO_SERVICE_FAMILY_ENABLE structure. Each field in this structure
  33. /// is associated with a service in the EDK II Crypto Protocol/PPI. This allows
  34. /// each individual service to be enabled/disabled in a DSC file. Services are
  35. /// also grouped into families. Unions are used to support enabling or
  36. /// disabling an entire family in a single DSC statement.
  37. ///
  38. typedef struct {
  39. union {
  40. struct {
  41. UINT8 New : 1; // Deprecated
  42. UINT8 Free : 1; // Deprecated
  43. UINT8 SetKey : 1; // Deprecated
  44. UINT8 Duplicate : 1; // Deprecated
  45. UINT8 Update : 1; // Deprecated
  46. UINT8 Final : 1; // Deprecated
  47. } Services;
  48. UINT32 Family; // Deprecated
  49. } HmacMd5;
  50. union {
  51. struct {
  52. UINT8 New : 1; // Deprecated
  53. UINT8 Free : 1; // Deprecated
  54. UINT8 SetKey : 1; // Deprecated
  55. UINT8 Duplicate : 1; // Deprecated
  56. UINT8 Update : 1; // Deprecated
  57. UINT8 Final : 1; // Deprecated
  58. } Services;
  59. UINT32 Family; // Deprecated
  60. } HmacSha1;
  61. union {
  62. struct {
  63. UINT8 New : 1;
  64. UINT8 Free : 1;
  65. UINT8 SetKey : 1;
  66. UINT8 Duplicate : 1;
  67. UINT8 Update : 1;
  68. UINT8 Final : 1;
  69. UINT8 All : 1;
  70. } Services;
  71. UINT32 Family;
  72. } HmacSha256;
  73. union {
  74. struct {
  75. UINT8 New : 1;
  76. UINT8 Free : 1;
  77. UINT8 SetKey : 1;
  78. UINT8 Duplicate : 1;
  79. UINT8 Update : 1;
  80. UINT8 Final : 1;
  81. UINT8 All : 1;
  82. } Services;
  83. UINT32 Family;
  84. } HmacSha384;
  85. union {
  86. struct {
  87. UINT8 GetContextSize : 1; // Deprecated
  88. UINT8 Init : 1; // Deprecated
  89. UINT8 Duplicate : 1; // Deprecated
  90. UINT8 Update : 1; // Deprecated
  91. UINT8 Final : 1; // Deprecated
  92. UINT8 HashAll : 1; // Deprecated
  93. } Services;
  94. UINT32 Family; // Deprecated
  95. } Md4;
  96. union {
  97. struct {
  98. UINT8 GetContextSize : 1; // Deprecated
  99. UINT8 Init : 1; // Deprecated
  100. UINT8 Duplicate : 1; // Deprecated
  101. UINT8 Update : 1; // Deprecated
  102. UINT8 Final : 1; // Deprecated
  103. UINT8 HashAll : 1; // Deprecated
  104. } Services;
  105. UINT32 Family;
  106. } Md5; // Deprecated
  107. union {
  108. struct {
  109. UINT8 Pkcs1v2Encrypt : 1;
  110. UINT8 Pkcs5HashPassword : 1;
  111. UINT8 Pkcs7Verify : 1;
  112. UINT8 VerifyEKUsInPkcs7Signature : 1;
  113. UINT8 Pkcs7GetSigners : 1;
  114. UINT8 Pkcs7FreeSigners : 1;
  115. UINT8 Pkcs7Sign : 1;
  116. UINT8 Pkcs7GetAttachedContent : 1;
  117. UINT8 Pkcs7GetCertificatesList : 1;
  118. UINT8 AuthenticodeVerify : 1;
  119. UINT8 ImageTimestampVerify : 1;
  120. } Services;
  121. UINT32 Family;
  122. } Pkcs;
  123. union {
  124. struct {
  125. UINT8 New : 1;
  126. UINT8 Free : 1;
  127. UINT8 GenerateParameter : 1;
  128. UINT8 SetParameter : 1;
  129. UINT8 GenerateKey : 1;
  130. UINT8 ComputeKey : 1;
  131. } Services;
  132. UINT32 Family;
  133. } Dh;
  134. union {
  135. struct {
  136. UINT8 Seed : 1;
  137. UINT8 Bytes : 1;
  138. } Services;
  139. UINT32 Family;
  140. } Random;
  141. union {
  142. struct {
  143. UINT8 VerifyPkcs1 : 1;
  144. UINT8 New : 1;
  145. UINT8 Free : 1;
  146. UINT8 SetKey : 1;
  147. UINT8 GetKey : 1;
  148. UINT8 GenerateKey : 1;
  149. UINT8 CheckKey : 1;
  150. UINT8 Pkcs1Sign : 1;
  151. UINT8 Pkcs1Verify : 1;
  152. UINT8 GetPrivateKeyFromPem : 1;
  153. UINT8 GetPublicKeyFromX509 : 1;
  154. } Services;
  155. UINT32 Family;
  156. } Rsa;
  157. union {
  158. struct {
  159. UINT8 GetContextSize : 1; // Recommend disable
  160. UINT8 Init : 1; // Recommend disable
  161. UINT8 Duplicate : 1; // Recommend disable
  162. UINT8 Update : 1; // Recommend disable
  163. UINT8 Final : 1; // Recommend disable
  164. UINT8 HashAll : 1; // Recommend disable
  165. } Services;
  166. UINT32 Family; // Recommend disable
  167. } Sha1;
  168. union {
  169. struct {
  170. UINT8 GetContextSize : 1;
  171. UINT8 Init : 1;
  172. UINT8 Duplicate : 1;
  173. UINT8 Update : 1;
  174. UINT8 Final : 1;
  175. UINT8 HashAll : 1;
  176. } Services;
  177. UINT32 Family;
  178. } Sha256;
  179. union {
  180. struct {
  181. UINT8 GetContextSize : 1;
  182. UINT8 Init : 1;
  183. UINT8 Duplicate : 1;
  184. UINT8 Update : 1;
  185. UINT8 Final : 1;
  186. UINT8 HashAll : 1;
  187. } Services;
  188. UINT32 Family;
  189. } Sha384;
  190. union {
  191. struct {
  192. UINT8 GetContextSize : 1;
  193. UINT8 Init : 1;
  194. UINT8 Duplicate : 1;
  195. UINT8 Update : 1;
  196. UINT8 Final : 1;
  197. UINT8 HashAll : 1;
  198. } Services;
  199. UINT32 Family;
  200. } Sha512;
  201. union {
  202. struct {
  203. UINT8 GetSubjectName : 1;
  204. UINT8 GetCommonName : 1;
  205. UINT8 GetOrganizationName : 1;
  206. UINT8 VerifyCert : 1;
  207. UINT8 ConstructCertificate : 1;
  208. UINT8 ConstructCertificateStack : 1;
  209. UINT8 ConstructCertificateStackV : 1;
  210. UINT8 Free : 1;
  211. UINT8 StackFree : 1;
  212. UINT8 GetTBSCert : 1;
  213. UINT8 GetVersion : 1;
  214. UINT8 GetSerialNumber : 1;
  215. UINT8 GetIssuerName : 1;
  216. UINT8 GetSignatureAlgorithm : 1;
  217. UINT8 GetExtensionData : 1;
  218. UINT8 GetExtendedKeyUsage : 1;
  219. UINT8 GetValidity : 1;
  220. UINT8 FormatDateTime : 1;
  221. UINT8 CompareDateTime : 1;
  222. UINT8 GetKeyUsage : 1;
  223. UINT8 VerifyCertChain : 1;
  224. UINT8 GetCertFromCertChain : 1;
  225. UINT8 Asn1GetTag : 1;
  226. UINT8 GetExtendedBasicConstraints : 1;
  227. } Services;
  228. UINT32 Family;
  229. } X509;
  230. union {
  231. struct {
  232. UINT8 GetContextSize : 1; // Deprecated
  233. UINT8 Init : 1; // Deprecated
  234. UINT8 EcbEncrypt : 1; // Deprecated
  235. UINT8 EcbDecrypt : 1; // Deprecated
  236. UINT8 CbcEncrypt : 1; // Deprecated
  237. UINT8 CbcDecrypt : 1; // Deprecated
  238. } Services;
  239. UINT32 Family; // Deprecated
  240. } Tdes;
  241. union {
  242. struct {
  243. UINT8 GetContextSize : 1;
  244. UINT8 Init : 1;
  245. UINT8 EcbEncrypt : 1; // Deprecated
  246. UINT8 EcbDecrypt : 1; // Deprecated
  247. UINT8 CbcEncrypt : 1;
  248. UINT8 CbcDecrypt : 1;
  249. } Services;
  250. UINT32 Family;
  251. } Aes;
  252. union {
  253. struct {
  254. UINT8 GetContextSize : 1; // Deprecated
  255. UINT8 Init : 1; // Deprecated
  256. UINT8 Encrypt : 1; // Deprecated
  257. UINT8 Decrypt : 1; // Deprecated
  258. UINT8 Reset : 1; // Deprecated
  259. } Services;
  260. UINT32 Family; // Deprecated
  261. } Arc4;
  262. union {
  263. struct {
  264. UINT8 GetContextSize : 1;
  265. UINT8 Init : 1;
  266. UINT8 Duplicate : 1;
  267. UINT8 Update : 1;
  268. UINT8 Final : 1;
  269. UINT8 HashAll : 1;
  270. } Services;
  271. UINT32 Family;
  272. } Sm3;
  273. union {
  274. struct {
  275. UINT8 Sha256ExtractAndExpand : 1;
  276. UINT8 Sha256Extract : 1;
  277. UINT8 Sha256Expand : 1;
  278. UINT8 Sha384ExtractAndExpand : 1;
  279. UINT8 Sha384Extract : 1;
  280. UINT8 Sha384Expand : 1;
  281. } Services;
  282. UINT32 Family;
  283. } Hkdf;
  284. union {
  285. struct {
  286. UINT8 Initialize : 1;
  287. UINT8 CtxFree : 1;
  288. UINT8 CtxNew : 1;
  289. UINT8 Free : 1;
  290. UINT8 New : 1;
  291. UINT8 InHandshake : 1;
  292. UINT8 DoHandshake : 1;
  293. UINT8 HandleAlert : 1;
  294. UINT8 CloseNotify : 1;
  295. UINT8 CtrlTrafficOut : 1;
  296. UINT8 CtrlTrafficIn : 1;
  297. UINT8 Read : 1;
  298. UINT8 Write : 1;
  299. UINT8 Shutdown : 1;
  300. } Services;
  301. UINT32 Family;
  302. } Tls;
  303. union {
  304. struct {
  305. UINT8 Version : 1;
  306. UINT8 ConnectionEnd : 1;
  307. UINT8 CipherList : 1;
  308. UINT8 CompressionMethod : 1;
  309. UINT8 Verify : 1;
  310. UINT8 VerifyHost : 1;
  311. UINT8 SessionId : 1;
  312. UINT8 CaCertificate : 1;
  313. UINT8 HostPublicCert : 1;
  314. UINT8 HostPrivateKey : 1;
  315. UINT8 CertRevocationList : 1;
  316. UINT8 HostPrivateKeyEx : 1;
  317. UINT8 SignatureAlgoList : 1;
  318. UINT8 EcCurve : 1;
  319. } Services;
  320. UINT32 Family;
  321. } TlsSet;
  322. union {
  323. struct {
  324. UINT8 Version : 1;
  325. UINT8 ConnectionEnd : 1;
  326. UINT8 CurrentCipher : 1;
  327. UINT8 CurrentCompressionId : 1;
  328. UINT8 Verify : 1;
  329. UINT8 SessionId : 1;
  330. UINT8 ClientRandom : 1;
  331. UINT8 ServerRandom : 1;
  332. UINT8 KeyMaterial : 1;
  333. UINT8 CaCertificate : 1;
  334. UINT8 HostPublicCert : 1;
  335. UINT8 HostPrivateKey : 1;
  336. UINT8 CertRevocationList : 1;
  337. UINT8 ExportKey : 1;
  338. } Services;
  339. UINT32 Family;
  340. } TlsGet;
  341. union {
  342. struct {
  343. UINT8 Sign : 1;
  344. UINT8 Verify : 1;
  345. } Services;
  346. UINT32 Family;
  347. } RsaPss;
  348. union {
  349. struct {
  350. UINT8 HashAll : 1;
  351. } Services;
  352. UINT32 Family;
  353. } ParallelHash;
  354. union {
  355. struct {
  356. UINT8 Encrypt : 1;
  357. UINT8 Decrypt : 1;
  358. } Services;
  359. UINT32 Family;
  360. } AeadAesGcm;
  361. union {
  362. struct {
  363. UINT8 Init : 1;
  364. UINT8 FromBin : 1;
  365. UINT8 ToBin : 1;
  366. UINT8 Free : 1;
  367. UINT8 Add : 1;
  368. UINT8 Sub : 1;
  369. UINT8 Mod : 1;
  370. UINT8 ExpMod : 1;
  371. UINT8 InverseMod : 1;
  372. UINT8 Div : 1;
  373. UINT8 MulMod : 1;
  374. UINT8 Cmp : 1;
  375. UINT8 Bits : 1;
  376. UINT8 Bytes : 1;
  377. UINT8 IsWord : 1;
  378. UINT8 IsOdd : 1;
  379. UINT8 Copy : 1;
  380. UINT8 ValueOne : 1;
  381. UINT8 RShift : 1;
  382. UINT8 ConstTime : 1;
  383. UINT8 SqrMod : 1;
  384. UINT8 NewContext : 1;
  385. UINT8 ContextFree : 1;
  386. UINT8 SetUint : 1;
  387. UINT8 AddMod : 1;
  388. } Services;
  389. UINT32 Family;
  390. } Bn;
  391. union {
  392. struct {
  393. UINT8 GroupInit : 1;
  394. UINT8 GroupGetCurve : 1;
  395. UINT8 GroupGetOrder : 1;
  396. UINT8 GroupFree : 1;
  397. UINT8 PointInit : 1;
  398. UINT8 PointDeInit : 1;
  399. UINT8 PointGetAffineCoordinates : 1;
  400. UINT8 PointSetAffineCoordinates : 1;
  401. UINT8 PointAdd : 1;
  402. UINT8 PointMul : 1;
  403. UINT8 PointInvert : 1;
  404. UINT8 PointIsOnCurve : 1;
  405. UINT8 PointIsAtInfinity : 1;
  406. UINT8 PointEqual : 1;
  407. UINT8 PointSetCompressedCoordinates : 1;
  408. UINT8 NewByNid : 1;
  409. UINT8 Free : 1;
  410. UINT8 GenerateKey : 1;
  411. UINT8 GetPubKey : 1;
  412. UINT8 DhComputeKey : 1;
  413. UINT8 GetPublicKeyFromX509 : 1;
  414. UINT8 GetPrivateKeyFromPem : 1;
  415. UINT8 DsaSign : 1;
  416. UINT8 DsaVerify : 1;
  417. } Services;
  418. UINT32 Family;
  419. } Ec;
  420. } PCD_CRYPTO_SERVICE_FAMILY_ENABLE;
  421. #endif