From f71ed839e1b59b8e1036c5d8a6f1153be1f32053 Mon Sep 17 00:00:00 2001 From: sfu5 Date: Wed, 9 Jan 2013 05:19:43 +0000 Subject: =?UTF-8?q?1.=20Set=20the=20secure=20boot=20state=20to=20Standard?= =?UTF-8?q?=20Mode=20when=20user=20leaving=20secure=20boot=20setup=20page.?= =?UTF-8?q?=202.=20Add=20=E2=80=9CCurrent=20SecureBoot=20State=E2=80=9D=20?= =?UTF-8?q?field=20to=20reflect=20current=20secure=20boot=20status=20of=20?= =?UTF-8?q?the=20platform.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fu Siyuan Reviewed-by: Dong Guo Reviewed-by: Yao Jiewen git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14042 6f19259b-4bc3-4df7-8a09-765794883524 --- .../VariableAuthenticated/RuntimeDxe/AuthService.c | 37 +++++++++------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'SecurityPkg/VariableAuthenticated/RuntimeDxe') diff --git a/SecurityPkg/VariableAuthenticated/RuntimeDxe/AuthService.c b/SecurityPkg/VariableAuthenticated/RuntimeDxe/AuthService.c index 1ba934b922..8552d31b25 100644 --- a/SecurityPkg/VariableAuthenticated/RuntimeDxe/AuthService.c +++ b/SecurityPkg/VariableAuthenticated/RuntimeDxe/AuthService.c @@ -356,30 +356,23 @@ AutenticatedVariableServiceInitialize ( DEBUG ((EFI_D_INFO, "Variable %s is %x\n", EFI_SECURE_BOOT_ENABLE_NAME, SecureBootEnable)); // - // Check "CustomMode" variable's existence. + // Initialize "CustomMode" in STANDARD_SECURE_BOOT_MODE state. // FindVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid, &Variable, &mVariableModuleGlobal->VariableGlobal, FALSE); - if (Variable.CurrPtr != NULL) { - CustomMode = *(GetVariableDataPtr (Variable.CurrPtr)); - } else { - // - // "CustomMode" not exist, initialize it in STANDARD_SECURE_BOOT_MODE. - // - CustomMode = STANDARD_SECURE_BOOT_MODE; - Status = UpdateVariable ( - EFI_CUSTOM_MODE_NAME, - &gEfiCustomModeEnableGuid, - &CustomMode, - sizeof (UINT8), - EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, - 0, - 0, - &Variable, - NULL - ); - if (EFI_ERROR (Status)) { - return Status; - } + CustomMode = STANDARD_SECURE_BOOT_MODE; + Status = UpdateVariable ( + EFI_CUSTOM_MODE_NAME, + &gEfiCustomModeEnableGuid, + &CustomMode, + sizeof (UINT8), + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, + 0, + 0, + &Variable, + NULL + ); + if (EFI_ERROR (Status)) { + return Status; } DEBUG ((EFI_D_INFO, "Variable %s is %x\n", EFI_CUSTOM_MODE_NAME, CustomMode)); -- cgit v1.2.3