* [edk2-devel] [PATCH] SecurityPkg/SecureBootConfigDxe: Update UI according to UEFI spec
@ 2024-02-26 14:36 Tan, Ming
0 siblings, 0 replies; only message in thread
From: Tan, Ming @ 2024-02-26 14:36 UTC (permalink / raw)
To: devel; +Cc: Min Xu, Jiewen Yao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4713
In UEFI_Spec_2_10_Aug29.pdf page 1694 section 35.5.4 for
EFI_BROWSER_ACTION_FORM_OPEN:
NOTE: EFI_FORM_BROWSER2_PROTOCOL.BrowserCallback() cannot be used with
this browser action because question values have not been retrieved yet.
So should not call HiiGetBrowserData() and HiiSetBrowserData() in FORM_OPEN
call back function.
Now call SecureBootExtractConfigFromVariable() to save the change to EFI
variable, then HII use EFI variable to control the UI.
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Ming Tan <ming.tan@intel.com>
---
.../SecureBootConfigImpl.c | 21 ++++++++++---------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index 2c11129526..c7ddbbd9e9 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
@@ -3365,6 +3365,7 @@ SecureBootExtractConfigFromVariable (
} else {
ConfigData->FileEnrollType = UNKNOWN_FILE_TYPE;
}
+ ConfigData->ListCount = Private->ListCount;
//
// If it is Physical Presence User, set the PhysicalPresent to true.
@@ -4547,6 +4548,7 @@ SecureBootCallback (
SetupMode = NULL;
File = NULL;
EnrollKeyErrorCode = None_Error;
+ GetBrowserDataResult = FALSE;
if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -4565,15 +4567,12 @@ SecureBootCallback (
return EFI_OUT_OF_RESOURCES;
}
- GetBrowserDataResult = HiiGetBrowserData (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, (UINT8 *)IfrNvData);
-
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
if (QuestionId == KEY_SECURE_BOOT_MODE) {
//
// Update secure boot strings when opening this form
//
Status = UpdateSecureBootString (Private);
- SecureBootExtractConfigFromVariable (Private, IfrNvData);
mIsEnterSecureBootForm = TRUE;
} else {
//
@@ -4587,23 +4586,21 @@ SecureBootCallback (
(QuestionId == KEY_SECURE_BOOT_DBT_OPTION))
{
CloseEnrolledFile (Private->FileContext);
- } else if (QuestionId == KEY_SECURE_BOOT_DELETE_ALL_LIST) {
- //
- // Update ListCount field in varstore
- // Button "Delete All Signature List" is
- // enable when ListCount is greater than 0.
- //
- IfrNvData->ListCount = Private->ListCount;
}
}
goto EXIT;
}
+ GetBrowserDataResult = HiiGetBrowserData (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, (UINT8 *)IfrNvData);
+
if (Action == EFI_BROWSER_ACTION_RETRIEVE) {
Status = EFI_UNSUPPORTED;
if (QuestionId == KEY_SECURE_BOOT_MODE) {
if (mIsEnterSecureBootForm) {
+ if (GetBrowserDataResult) {
+ SecureBootExtractConfigFromVariable (Private, IfrNvData);
+ }
Value->u8 = SECURE_BOOT_MODE_STANDARD;
Status = EFI_SUCCESS;
}
@@ -5179,6 +5176,10 @@ SecureBootCallback (
}
}
+ if (GetBrowserDataResult) {
+ SecureBootExtractConfigFromVariable (Private, IfrNvData);
+ }
+
EXIT:
if (!EFI_ERROR (Status) && GetBrowserDataResult) {
--
2.31.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115966): https://edk2.groups.io/g/devel/message/115966
Mute This Topic: https://groups.io/mt/104582842/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-02-26 14:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-26 14:36 [edk2-devel] [PATCH] SecurityPkg/SecureBootConfigDxe: Update UI according to UEFI spec Tan, Ming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox