From 04ae0ce7ee697616aff25cce4501e91c6fd10a42 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Fri, 26 Apr 2024 14:31:03 -0700 Subject: [PATCH] Fixed the rogues? --- MfciPkg/MfciDxe/MfciTargeting.c | 13 +++++++++++++ MfciPkg/Private/MfciPolicyFields.h | 10 +--------- .../MfciPolicyParsingUnitTestApp.inf | 4 ++++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/MfciPkg/MfciDxe/MfciTargeting.c b/MfciPkg/MfciDxe/MfciTargeting.c index b2618f029d..95082e6d41 100644 --- a/MfciPkg/MfciDxe/MfciTargeting.c +++ b/MfciPkg/MfciDxe/MfciTargeting.c @@ -21,6 +21,19 @@ #include "MfciDxe.h" +/** + The strings of the names in the MFCI Policy name/value pairs +**/ +CONST CHAR16 gPolicyBlobFieldName[MFCI_POLICY_FIELD_COUNT][MFCI_POLICY_FIELD_MAX_LEN] = { + L"Target\\Manufacturer", + L"Target\\Product", + L"Target\\SerialNumber", + L"Target\\OEM_01", + L"Target\\OEM_02", + L"Target\\Nonce", // this is nonce targeted by the binary policy blob + L"UEFI\\Policy" +}; + CONST CHAR16 gPolicyTargetFieldVarNames[TARGET_POLICY_COUNT][MFCI_VAR_NAME_MAX_LENGTH] = { MFCI_MANUFACTURER_VARIABLE_NAME, MFCI_PRODUCT_VARIABLE_NAME, diff --git a/MfciPkg/Private/MfciPolicyFields.h b/MfciPkg/Private/MfciPolicyFields.h index deba381296..07b4e237fe 100644 --- a/MfciPkg/Private/MfciPolicyFields.h +++ b/MfciPkg/Private/MfciPolicyFields.h @@ -46,15 +46,7 @@ typedef enum { /** The strings of the names in the MFCI Policy name/value pairs **/ -STATIC CONST CHAR16 gPolicyBlobFieldName[MFCI_POLICY_FIELD_COUNT][MFCI_POLICY_FIELD_MAX_LEN] = { - L"Target\\Manufacturer", - L"Target\\Product", - L"Target\\SerialNumber", - L"Target\\OEM_01", - L"Target\\OEM_02", - L"Target\\Nonce", // this is nonce targeted by the binary policy blob - L"UEFI\\Policy" -}; +extern CONST CHAR16 gPolicyBlobFieldName[MFCI_POLICY_FIELD_COUNT][MFCI_POLICY_FIELD_MAX_LEN]; /** A helper that maps static MFCI Policy targeting fields to their corresponding UEFI variable names diff --git a/MfciPkg/UnitTests/MfciPolicyParsingUnitTest/MfciPolicyParsingUnitTestApp.inf b/MfciPkg/UnitTests/MfciPolicyParsingUnitTest/MfciPolicyParsingUnitTestApp.inf index 9e0bf7dfd8..b467a392ae 100644 --- a/MfciPkg/UnitTests/MfciPolicyParsingUnitTest/MfciPolicyParsingUnitTestApp.inf +++ b/MfciPkg/UnitTests/MfciPolicyParsingUnitTest/MfciPolicyParsingUnitTestApp.inf @@ -21,12 +21,16 @@ [Sources] MfciPolicyParsingUnitTestApp.c + ../../MfciDxe/MfciTargeting.c [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec MfciPkg/MfciPkg.dec +[Guids] + gMfciVendorGuid ## CONSUMES + [Pcd] gMfciPkgTokenSpaceGuid.PcdMfciPkcs7CertBufferXdr ## CONSUMES gMfciPkgTokenSpaceGuid.PcdMfciPkcs7RequiredLeafEKU ## CONSUMES