From 599e70cf9ed153680e436babe7c0a4b02e175719 Mon Sep 17 00:00:00 2001 From: ydong10 Date: Thu, 15 Dec 2011 02:59:03 +0000 Subject: Update for SecurityPkg. Per UEFI spec, on CallBack action EFI_BROWSER_ACTION_CHANGING, the return value of ActionRequest will be ignored, but on CallBack action EFI_BROWSER_ACTION_CHANGED, the return value of ActionRequest will be used. But, EDKII browser still processes the got ActionRequest. And, all HII drivers in EDKII project also returns their expected ActionRequest value on action EFI_BROWSER_ACTION_CHANGING. Now update the browser to follow the spec, and update all core Hii drivers to keep old working modal. Signed-off-by: ydong10 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk@12868 6f19259b-4bc3-4df7-8a09-765794883524 --- .../PwdCredentialProvider.c | 2 +- .../UserIdentifyManagerDxe/UserIdentifyManager.c | 16 +- .../UserIdentifyManagerData.h | 1 + .../UserProfileManagerDxe/UserProfileManager.c | 161 ++++++++++++++++----- .../UserProfileManagerVfr.Vfr | 24 +-- 5 files changed, 148 insertions(+), 56 deletions(-) (limited to 'edk2/SecurityPkg/UserIdentification') diff --git a/edk2/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProvider.c b/edk2/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProvider.c index afb090a91..cf7fe4079 100644 --- a/edk2/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProvider.c +++ b/edk2/SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProvider.c @@ -548,7 +548,7 @@ CredentialDriverCallback ( CHAR8 Password[CREDENTIAL_LEN]; CHAR16 *PromptStr; - if (Action == EFI_BROWSER_ACTION_CHANGING) { + if (Action == EFI_BROWSER_ACTION_CHANGED) { if (QuestionId == KEY_GET_PASSWORD) { // // Get and check password. diff --git a/edk2/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c b/edk2/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c index 268dfab46..adcf9bf65 100644 --- a/edk2/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c +++ b/edk2/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c @@ -2411,8 +2411,7 @@ UserIdentifyManagerCallback ( Status = EFI_SUCCESS; break; - case EFI_BROWSER_ACTION_CHANGING: - { + case EFI_BROWSER_ACTION_CHANGED: if (QuestionId >= LABEL_PROVIDER_NAME) { // // QuestionId comes from the second Form (Select a Credential Provider if identity @@ -2425,10 +2424,16 @@ UserIdentifyManagerCallback ( } return EFI_SUCCESS; } - + break; + + case EFI_BROWSER_ACTION_CHANGING: // // QuestionId comes from the first Form (Select a user to identify). // + if (QuestionId >= LABEL_PROVIDER_NAME) { + return EFI_SUCCESS; + } + User = (USER_PROFILE_ENTRY *) mUserProfileDb->UserProfile[QuestionId & 0xFFF]; Status = GetIdentifyType (User, &PolicyType); if (EFI_ERROR (Status)) { @@ -2456,9 +2461,10 @@ UserIdentifyManagerCallback ( mCurrentUser = (EFI_USER_PROFILE_HANDLE) User; mIdentified = TRUE; - *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT; + if (Type == EFI_IFR_TYPE_REF) { + Value->ref.FormId = FORMID_INVALID_FORM; + } } - } break; default: diff --git a/edk2/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerData.h b/edk2/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerData.h index 5efc50d16..b08ac4643 100644 --- a/edk2/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerData.h +++ b/edk2/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerData.h @@ -22,6 +22,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // #define FORMID_USER_FORM 1 #define FORMID_PROVIDER_FORM 2 +#define FORMID_INVALID_FORM 0x0FFF // // Labels definition. diff --git a/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c b/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c index 6e5bd0650..4b1eabaae 100644 --- a/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c +++ b/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c @@ -309,7 +309,7 @@ UserProfileManagerCallback ( Status = EFI_SUCCESS; break; - case EFI_BROWSER_ACTION_CHANGING: + case EFI_BROWSER_ACTION_CHANGED: { // // Handle the request from form. @@ -337,13 +337,6 @@ UserProfileManagerCallback ( // Judge next 2 bits. // switch (QuestionId & KEY_SECOND_FORM_MASK) { - // - // Enter delete user profile form. - // - case KEY_ENTER_NEXT_FORM: - SelectUserToDelete (); - break; - // // Delete specified user profile. // @@ -368,13 +361,6 @@ UserProfileManagerCallback ( // Judge next 2 bits. // switch (QuestionId & KEY_SECOND_FORM_MASK) { - // - // Enter modify user profile form. - // - case KEY_ENTER_NEXT_FORM: - SelectUserToModify (); - break; - // // Enter user profile information form. // @@ -383,13 +369,6 @@ UserProfileManagerCallback ( // Judge next 3 bits. // switch (QuestionId & KEY_MODIFY_INFO_MASK) { - // - // Display user information form. - // - case KEY_ENTER_NEXT_FORM: - ModifyUserInfo ((UINT8) QuestionId); - break; - // // Modify user name. // @@ -409,13 +388,6 @@ UserProfileManagerCallback ( // Judge next 3 bits // switch (QuestionId & KEY_MODIFY_IP_MASK) { - // - // Display identity policy modify form. - // - case KEY_ENTER_NEXT_FORM: - ModifyIdentityPolicy (); - break; - // // Change credential provider option. // @@ -442,7 +414,7 @@ UserProfileManagerCallback ( // case KEY_IP_RETURN_UIF: SaveIdentityPolicy (); - *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY; + *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT; break; default: @@ -458,13 +430,6 @@ UserProfileManagerCallback ( // Judge next 3 bits. // switch (QuestionId & KEY_MODIFY_AP_MASK) { - // - // Display access policy modify form. - // - case KEY_ENTER_NEXT_FORM: - ModidyAccessPolicy (); - break; - // // Change access right choice. // @@ -545,7 +510,7 @@ UserProfileManagerCallback ( // case KEY_AP_RETURN_UIF: SaveAccessPolicy (); - *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY; + *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT; break; default: @@ -642,6 +607,126 @@ UserProfileManagerCallback ( } break; + + case EFI_BROWSER_ACTION_CHANGING: + { + // + // Handle the request from form. + // + if (Value == NULL) { + return EFI_INVALID_PARAMETER; + } + + // + // Judge first 2 bits. + // + switch (QuestionId & KEY_FIRST_FORM_MASK) { + // + // Delete user profile operation. + // + case KEY_DEL_USER: + // + // Judge next 2 bits. + // + switch (QuestionId & KEY_SECOND_FORM_MASK) { + // + // Enter delete user profile form. + // + case KEY_ENTER_NEXT_FORM: + SelectUserToDelete (); + break; + + default: + break; + } + break; + + // + // Modify user profile operation. + // + case KEY_MODIFY_USER: + // + // Judge next 2 bits. + // + switch (QuestionId & KEY_SECOND_FORM_MASK) { + // + // Enter modify user profile form. + // + case KEY_ENTER_NEXT_FORM: + SelectUserToModify (); + break; + + // + // Enter user profile information form. + // + case KEY_SELECT_USER: + // + // Judge next 3 bits. + // + switch (QuestionId & KEY_MODIFY_INFO_MASK) { + // + // Display user information form. + // + case KEY_ENTER_NEXT_FORM: + ModifyUserInfo ((UINT8) QuestionId); + break; + + // + // Modify identity policy. + // + case KEY_MODIFY_IP: + // + // Judge next 3 bits + // + switch (QuestionId & KEY_MODIFY_IP_MASK) { + // + // Display identity policy modify form. + // + case KEY_ENTER_NEXT_FORM: + ModifyIdentityPolicy (); + break; + + default: + break; + } + break; + + // + // Modify access policy. + // + case KEY_MODIFY_AP: + // + // Judge next 3 bits. + // + switch (QuestionId & KEY_MODIFY_AP_MASK) { + // + // Display access policy modify form. + // + case KEY_ENTER_NEXT_FORM: + ModidyAccessPolicy (); + break; + + default: + break; + } + break; + + default: + break; + } + break; + + default: + break; + } + break; + + default: + break; + } + } + break; + default: // // All other action return unsupported. diff --git a/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerVfr.Vfr b/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerVfr.Vfr index d094d78a7..fa6d9e4a8 100644 --- a/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerVfr.Vfr +++ b/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerVfr.Vfr @@ -114,12 +114,12 @@ formset subtitle text = STRING_TOKEN(STR_NULL_STRING); - goto FORMID_USER_INFO, - prompt = STRING_TOKEN(STR_SAVE), - help = STRING_TOKEN(STR_IDENTIFY_SAVE_HELP), - flags = INTERACTIVE, - key = KEY_IP_RETURN; - + text + help = STRING_TOKEN(STR_IDENTIFY_SAVE_HELP), + text = STRING_TOKEN(STR_SAVE), + flags = INTERACTIVE, + key = KEY_IP_RETURN; + endform; // @@ -146,12 +146,12 @@ formset subtitle text = STRING_TOKEN(STR_NULL_STRING); - goto FORMID_USER_INFO, - prompt = STRING_TOKEN(STR_SAVE), - help = STRING_TOKEN(STR_ACCESS_SAVE_HELP), - flags = INTERACTIVE, - key = KEY_AP_RETURN; - + text + help = STRING_TOKEN(STR_ACCESS_SAVE_HELP), + text = STRING_TOKEN(STR_SAVE), + flags = INTERACTIVE, + key = KEY_AP_RETURN; + endform; // -- cgit v1.2.3 From b630017a6924ea8f6184e2e535375bf7e7145124 Mon Sep 17 00:00:00 2001 From: ydong10 Date: Mon, 19 Dec 2011 06:57:49 +0000 Subject: Update the process of some question from EFI_BROWSER_ACTION_CHANGED to EFI_BROWSER_ACTION_CHANGING. Signed-off-by: ydong10 Reviewed-by: gdong1 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk@12885 6f19259b-4bc3-4df7-8a09-765794883524 --- .../UserProfileManagerDxe/UserProfileManager.c | 107 ++++++++++----------- 1 file changed, 53 insertions(+), 54 deletions(-) (limited to 'edk2/SecurityPkg/UserIdentification') diff --git a/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c b/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c index 4b1eabaae..4bba0824c 100644 --- a/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c +++ b/edk2/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c @@ -451,60 +451,6 @@ UserProfileManagerCallback ( mAccessInfo.AccessBootOrder = Value->u32; break; - // - // Load device path form. - // - case KEY_MODIFY_LOAD: - // - // Judge next 2 bits. - // - switch (QuestionId & KEY_DISPLAY_DP_MASK) { - // - // Permit load device path. - // - case KEY_PERMIT_MODIFY: - DisplayLoadPermit (); - break; - - // - // Forbid load device path. - // - case KEY_FORBID_MODIFY: - DisplayLoadForbid (); - break; - - default: - break; - } - break; - - // - // Connect device path form. - // - case KEY_MODIFY_CONNECT: - // - // Judge next 2 bits. - // - switch (QuestionId & KEY_DISPLAY_DP_MASK) { - // - // Permit connect device path. - // - case KEY_PERMIT_MODIFY: - DisplayConnectPermit (); - break; - - // - // Forbid connect device path. - // - case KEY_FORBID_MODIFY: - DisplayConnectForbid (); - break; - - default: - break; - } - break; - // // Return to user profile information form. // @@ -705,6 +651,59 @@ UserProfileManagerCallback ( case KEY_ENTER_NEXT_FORM: ModidyAccessPolicy (); break; + // + // Load device path form. + // + case KEY_MODIFY_LOAD: + // + // Judge next 2 bits. + // + switch (QuestionId & KEY_DISPLAY_DP_MASK) { + // + // Permit load device path. + // + case KEY_PERMIT_MODIFY: + DisplayLoadPermit (); + break; + + // + // Forbid load device path. + // + case KEY_FORBID_MODIFY: + DisplayLoadForbid (); + break; + + default: + break; + } + break; + + // + // Connect device path form. + // + case KEY_MODIFY_CONNECT: + // + // Judge next 2 bits. + // + switch (QuestionId & KEY_DISPLAY_DP_MASK) { + // + // Permit connect device path. + // + case KEY_PERMIT_MODIFY: + DisplayConnectPermit (); + break; + + // + // Forbid connect device path. + // + case KEY_FORBID_MODIFY: + DisplayConnectForbid (); + break; + + default: + break; + } + break; default: break; -- cgit v1.2.3 From 29dca17eb916702929e6ca30181603a7613998f0 Mon Sep 17 00:00:00 2001 From: gdong1 Date: Thu, 5 Jan 2012 08:11:49 +0000 Subject: Remove illegal TPL usage. Signed-off-by: gdong1 Reviewed-by: niruiyu Reviewed-by: tye1 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk@12908 6f19259b-4bc3-4df7-8a09-765794883524 --- .../UsbCredentialProviderDxe/UsbCredentialProvider.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'edk2/SecurityPkg/UserIdentification') diff --git a/edk2/SecurityPkg/UserIdentification/UsbCredentialProviderDxe/UsbCredentialProvider.c b/edk2/SecurityPkg/UserIdentification/UsbCredentialProviderDxe/UsbCredentialProvider.c index 327a2b038..f851bb2e2 100644 --- a/edk2/SecurityPkg/UserIdentification/UsbCredentialProviderDxe/UsbCredentialProvider.c +++ b/edk2/SecurityPkg/UserIdentification/UsbCredentialProviderDxe/UsbCredentialProvider.c @@ -1,7 +1,7 @@ /** @file Usb Credential Provider driver implemenetation. -Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -894,7 +894,6 @@ CredentialUser ( UINT8 *UserToken; UINT8 ReadToken[HASHED_CREDENTIAL_LEN]; EFI_INPUT_KEY Key; - EFI_TPL OldTpl; CHAR16 *QuestionStr; CHAR16 *PromptStr; @@ -943,8 +942,6 @@ CredentialUser ( if (EFI_ERROR (Status)) { QuestionStr = GetStringById (STRING_TOKEN (STR_READ_USB_TOKEN_ERROR)); PromptStr = GetStringById (STRING_TOKEN (STR_INSERT_USB_TOKEN)); - OldTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL); - gBS->RestoreTPL (TPL_APPLICATION); CreatePopUp ( EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, @@ -953,7 +950,6 @@ CredentialUser ( PromptStr, NULL ); - gBS->RaiseTPL (OldTpl); FreePool (QuestionStr); FreePool (PromptStr); return EFI_NOT_FOUND; -- cgit v1.2.3