SecureBootConfig: Restore keys and reset
Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
committed by
Jeremy Soller
parent
860c29c923
commit
2f21eddfb8
@ -4332,8 +4332,6 @@ SecureBootCallback (
|
|||||||
SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData;
|
SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData;
|
||||||
BOOLEAN GetBrowserDataResult;
|
BOOLEAN GetBrowserDataResult;
|
||||||
ENROLL_KEY_ERROR EnrollKeyErrorCode;
|
ENROLL_KEY_ERROR EnrollKeyErrorCode;
|
||||||
EFI_HII_POPUP_PROTOCOL *HiiPopup;
|
|
||||||
EFI_HII_POPUP_SELECTION UserSelection;
|
|
||||||
|
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
SecureBootEnable = NULL;
|
SecureBootEnable = NULL;
|
||||||
@ -4875,31 +4873,17 @@ SecureBootCallback (
|
|||||||
FreePool (SetupMode);
|
FreePool (SetupMode);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case KEY_SECURE_BOOT_RESET_TO_DEFAULT:
|
//case KEY_SECURE_BOOT_RESET_TO_DEFAULT:
|
||||||
{
|
case KEY_RESTORE_KEYS:
|
||||||
Status = gBS->LocateProtocol (&gEfiHiiPopupProtocolGuid, NULL, (VOID **) &HiiPopup);
|
Status = KeyEnrollReset();
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
Status = HiiPopup->CreatePopup (
|
|
||||||
HiiPopup,
|
|
||||||
EfiHiiPopupStyleInfo,
|
|
||||||
EfiHiiPopupTypeYesNo,
|
|
||||||
Private->HiiHandle,
|
|
||||||
STRING_TOKEN (STR_RESET_TO_DEFAULTS_POPUP),
|
|
||||||
&UserSelection
|
|
||||||
);
|
|
||||||
if (UserSelection == EfiHiiPopupSelectionYes) {
|
|
||||||
Status = KeyEnrollReset ();
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// Update secure boot strings after key reset
|
// Update secure boot strings after key reset
|
||||||
//
|
|
||||||
if (Status == EFI_SUCCESS) {
|
if (Status == EFI_SUCCESS) {
|
||||||
Status = UpdateSecureBootString (Private);
|
Status = UpdateSecureBootString(Private);
|
||||||
SecureBootExtractConfigFromVariable (Private, IfrNvData);
|
SecureBootExtractConfigFromVariable(Private, IfrNvData);
|
||||||
|
// XXX: Is this safe?
|
||||||
|
gRT->ResetSystem(EfiResetCold, Status, 0, NULL);
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user