SecurityPkg Tcg2ConfigDxe: Add setup option to configure PPI version
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=288 gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer was introduced to configure physical presence interface version. but test or user needs to build different images to support different versions separately as the PCD does not support Dynamic types. This patch is to extend the PCD to support Dynamic types and add a setup option in Tcg2ConfigDxe driver to configure the physical presence interface version, the PCD needs to be DynamicHii type and maps to the setup option. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
This commit is contained in:
@@ -455,6 +455,62 @@ GetTpm2HID(
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
This function processes the results of changes in configuration
|
||||
for TCG2 version information.
|
||||
|
||||
@param[in] Action Specifies the type of action taken by the browser.
|
||||
ASSERT if the Action is not EFI_BROWSER_ACTION_SUBMITTED.
|
||||
@param[in] QuestionId A unique value which is sent to the original
|
||||
exporting driver so that it can identify the type
|
||||
of data to expect.
|
||||
@param[in] Type The type of value for the question.
|
||||
@param[in] Value A pointer to the data being sent to the original
|
||||
exporting driver.
|
||||
|
||||
@retval EFI_SUCCESS The callback successfully handled the action.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
Tcg2VersionInfoCallback (
|
||||
IN EFI_BROWSER_ACTION Action,
|
||||
IN EFI_QUESTION_ID QuestionId,
|
||||
IN UINT8 Type,
|
||||
IN EFI_IFR_TYPE_VALUE *Value
|
||||
)
|
||||
{
|
||||
EFI_INPUT_KEY Key;
|
||||
UINT64 PcdTcg2PpiVersion;
|
||||
|
||||
ASSERT (Action == EFI_BROWSER_ACTION_SUBMITTED);
|
||||
|
||||
if (QuestionId == KEY_TCG2_PPI_VERSION) {
|
||||
//
|
||||
// Get the PCD value after EFI_BROWSER_ACTION_SUBMITTED,
|
||||
// the SetVariable to TCG2_VERSION_NAME should have been done.
|
||||
// If the PCD value is not equal to the value set to variable,
|
||||
// the PCD is not DynamicHii type and maps to the setup option.
|
||||
//
|
||||
PcdTcg2PpiVersion = 0;
|
||||
CopyMem (
|
||||
&PcdTcg2PpiVersion,
|
||||
PcdGetPtr (PcdTcgPhysicalPresenceInterfaceVer),
|
||||
AsciiStrSize (PcdGetPtr (PcdTcgPhysicalPresenceInterfaceVer))
|
||||
);
|
||||
if (PcdTcg2PpiVersion != Value->u64) {
|
||||
CreatePopUp (
|
||||
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
|
||||
&Key,
|
||||
L"WARNING: PcdTcgPhysicalPresenceInterfaceVer is not DynamicHii type and maps to this option!",
|
||||
L"The version configuring by this setup option will not work!",
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
This function processes the results of changes in configuration.
|
||||
|
||||
@@ -546,7 +602,13 @@ Tcg2Callback (
|
||||
return SaveTcg2PpRequestParameter (Value->u32);
|
||||
}
|
||||
if ((QuestionId >= KEY_TPM2_PCR_BANKS_REQUEST_0) && (QuestionId <= KEY_TPM2_PCR_BANKS_REQUEST_4)) {
|
||||
SaveTcg2PCRBanksRequest (QuestionId - KEY_TPM2_PCR_BANKS_REQUEST_0, Value->b);
|
||||
return SaveTcg2PCRBanksRequest (QuestionId - KEY_TPM2_PCR_BANKS_REQUEST_0, Value->b);
|
||||
}
|
||||
}
|
||||
|
||||
if (Action == EFI_BROWSER_ACTION_SUBMITTED) {
|
||||
if (QuestionId == KEY_TCG2_PPI_VERSION) {
|
||||
return Tcg2VersionInfoCallback (Action, QuestionId, Type, Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user