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>
This commit is contained in:
Dandan Bi 2016-05-09 19:53:00 +08:00 committed by Star Zeng
parent ad319b9307
commit eafbd7a232
1 changed files with 15 additions and 0 deletions

View File

@ -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( )
//