Reviewed-by: Eric Dong <[email protected]>

> -----Original Message-----
> From: edk2-devel [mailto:[email protected]] On Behalf Of Dandan 
> Bi
> Sent: Tuesday, May 10, 2016 10:52 AM
> To: [email protected]
> Cc: Dong, Eric
> Subject: [edk2] [PATCH v2] Security/OpalPasswordDxe: Enhance the logic in 
> RouteConfig/ExtractConfig
> 
> Make the implementation of RouteConfig/ExtractConfig function
> follow the UEFI spec.
> 
> Notes:
>   v1->v2:
>   - Correct the storage name.
> 
> Cc: Eric Dong <[email protected]>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <[email protected]>
> ---
>  SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c 
> b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
> index 3fb3553..33f74dd 100644
> --- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
> +++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
> @@ -28,10 +28,12 @@ extern UINT8  OpalPasswordFormBin[];
>  // This Data array is ready to be used as input of HiiAddPackages() to
>  // create a packagelist (which contains Form packages, String packages, etc).
>  //
>  extern UINT8  OpalPasswordDxeStrings[];
> 
> +CHAR16  OpalPasswordStorageName[] = L"OpalHiiConfig";
> +
>  EFI_HII_CONFIG_ACCESS_PROTOCOL gHiiConfigAccessProtocol;
> 
>  //
>  // Handle to the list of HII packages (forms and strings) for this driver
>  //
> @@ -1143,10 +1145,17 @@ RouteConfig(
>  {
>    if (Configuration == NULL || Progress == NULL) {
>      return (EFI_INVALID_PARAMETER);
>    }
> 
> +  *Progress = Configuration;
> +  if (!HiiIsConfigHdrMatch (Configuration, &gHiiSetupVariableGuid, 
> OpalPasswordStorageName)) {
> +    return EFI_NOT_FOUND;
> +  }
> +
> +  *Progress = Configuration + StrLen (Configuration);
> +
>    return EFI_SUCCESS;
>  }
> 
>  /**
>    This function allows a caller to extract the current configuration for one
> @@ -1190,10 +1199,16 @@ ExtractConfig(
>    //
>    if (Progress == NULL || Results == NULL) {
>      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( )
>    //
>    Status = gHiiConfigRouting->BlockToConfig(
>                 gHiiConfigRouting,
> --
> 1.9.5.msysgit.1
> 
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to