Enable/Disable Secured Boot by 'Secure Boot Configuration' Page which is under Setup browser.

Signed-off-by: qianouyang
Reviewed-by: gdong1

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12586 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qianouyang
2011-10-28 03:46:20 +00:00
parent 23491d5cc2
commit beda2356f5
17 changed files with 1025 additions and 12 deletions

View File

@ -1117,7 +1117,6 @@ DxeImageVerificationHandler (
IN VOID *FileBuffer,
IN UINTN FileSize
)
{
EFI_STATUS Status;
UINT16 Magic;
@ -1130,6 +1129,7 @@ DxeImageVerificationHandler (
EFI_IMAGE_EXECUTION_ACTION Action;
WIN_CERTIFICATE *WinCertificate;
UINT32 Policy;
UINT8 *SecureBootEnable;
if (File == NULL) {
return EFI_INVALID_PARAMETER;
@ -1173,6 +1173,23 @@ DxeImageVerificationHandler (
} else if (Policy == NEVER_EXECUTE) {
return EFI_ACCESS_DENIED;
}
SecureBootEnable = GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid);
//
// Skip verification if SecureBootEnable variable doesn't exist.
//
if (SecureBootEnable == NULL) {
return EFI_SUCCESS;
}
//
// Skip verification if SecureBootEnable is disabled.
//
if (*SecureBootEnable == SECURE_BOOT_DISABLE) {
FreePool (SecureBootEnable);
return EFI_SUCCESS;
}
SetupMode = GetEfiGlobalVariable (EFI_SETUP_MODE_NAME);
//