summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/Tcg/Opal
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2016-05-09 19:53:00 +0800
committerStar Zeng <star.zeng@intel.com>2016-05-11 11:25:52 +0800
commiteafbd7a2325e39480c5be71cc8f456c78f1bfed0 (patch)
treec2fedffca4221f02b3a6f4e626f3be15337976b2 /SecurityPkg/Tcg/Opal
parentad319b9307aaf37ffaf27890ae03dcbfd12087ce (diff)
downloadedk2-eafbd7a2325e39480c5be71cc8f456c78f1bfed0.tar.gz
edk2-eafbd7a2325e39480c5be71cc8f456c78f1bfed0.tar.bz2
edk2-eafbd7a2325e39480c5be71cc8f456c78f1bfed0.zip
Security/OpalPasswordDxe: Enhance the logic in RouteConfig/ExtractConfig
Make the implementation of RouteConfig/ExtractConfig function follow the UEFI spec. Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
Diffstat (limited to 'SecurityPkg/Tcg/Opal')
-rw-r--r--SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
index 3fb3553f27..33f74dd4a3 100644
--- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
+++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
@@ -30,6 +30,8 @@ extern UINT8 OpalPasswordFormBin[];
//
extern UINT8 OpalPasswordDxeStrings[];
+CHAR16 OpalPasswordStorageName[] = L"OpalHiiConfig";
+
EFI_HII_CONFIG_ACCESS_PROTOCOL gHiiConfigAccessProtocol;
//
@@ -1145,6 +1147,13 @@ RouteConfig(
return (EFI_INVALID_PARAMETER);
}
+ *Progress = Configuration;
+ if (!HiiIsConfigHdrMatch (Configuration, &gHiiSetupVariableGuid, OpalPasswordStorageName)) {
+ return EFI_NOT_FOUND;
+ }
+
+ *Progress = Configuration + StrLen (Configuration);
+
return EFI_SUCCESS;
}
@@ -1192,6 +1201,12 @@ ExtractConfig(
return (EFI_INVALID_PARAMETER);
}
+ *Progress = Request;
+ if ((Request != NULL) &&
+ !HiiIsConfigHdrMatch (Request, &gHiiSetupVariableGuid, OpalPasswordStorageName)) {
+ return EFI_NOT_FOUND;
+ }
+
//
// Convert Buffer Data to <ConfigResp> by helper function BlockToConfig( )
//