X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=SecurityPkg%2FUserIdentification%2FUserProfileManagerDxe%2FUserProfileManager.c;h=4bba0824c7abcf5effb5bf11684d5f50dfe906bc;hb=c0cb1e1a72bccb5c83d7a36a8e52a38002b18671;hp=c41fe973bd950eea545347a7e63f965c9d689686;hpb=43e615983e2b68fc257ed19b4b6b4ff75c707e54;p=mirror_edk2.git diff --git a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c index c41fe973bd..4bba0824c7 100644 --- a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c +++ b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c @@ -17,7 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "UserProfileManager.h" -EFI_GUID mUserProfileManagerGuid = USER_PROFILE_MANAGER_GUID; EFI_USER_MANAGER_PROTOCOL *mUserManager = NULL; CREDENTIAL_PROVIDER_INFO *mProviderInfo = NULL; UINT8 mProviderChoice; @@ -35,7 +34,7 @@ HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath = { (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) } }, - {0xad2e3474, 0x93e6, 0x488b, {0x93, 0x19, 0x64, 0x88, 0xfc, 0x68, 0x1f, 0x16}} + USER_PROFILE_MANAGER_GUID }, { END_DEVICE_PATH_TYPE, @@ -95,7 +94,7 @@ InitProviderInfo ( HandleBuf = NULL; Status = gBS->LocateHandleBuffer ( ByProtocol, - &gEfiUserCredentialProtocolGuid, + &gEfiUserCredential2ProtocolGuid, NULL, &HandleCount, &HandleBuf @@ -112,8 +111,8 @@ InitProviderInfo ( } mProviderInfo = AllocateZeroPool ( sizeof (CREDENTIAL_PROVIDER_INFO) - - sizeof (EFI_USER_CREDENTIAL_PROTOCOL *) + - HandleCount * sizeof (EFI_USER_CREDENTIAL_PROTOCOL *) + sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) + + HandleCount * sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) ); if (mProviderInfo == NULL) { FreePool (HandleBuf); @@ -124,7 +123,7 @@ InitProviderInfo ( for (Index = 0; Index < HandleCount; Index++) { Status = gBS->HandleProtocol ( HandleBuf[Index], - &gEfiUserCredentialProtocolGuid, + &gEfiUserCredential2ProtocolGuid, (VOID **) &mProviderInfo->Provider[Index] ); if (EFI_ERROR (Status)) { @@ -293,7 +292,7 @@ UserProfileManagerCallback ( HiiUpdateForm ( mCallbackInfo->HiiHandle, // HII handle - &mUserProfileManagerGuid, // Formset GUID + &gUserProfileManagerGuid, // Formset GUID FORMID_USER_MANAGE, // Form ID StartOpCodeHandle, // Label for where to insert opcodes EndOpCodeHandle // Replace data @@ -310,7 +309,7 @@ UserProfileManagerCallback ( Status = EFI_SUCCESS; break; - case EFI_BROWSER_ACTION_CHANGING: + case EFI_BROWSER_ACTION_CHANGED: { // // Handle the request from form. @@ -338,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. // @@ -369,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. // @@ -384,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. // @@ -410,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. // @@ -443,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: @@ -459,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. // @@ -487,66 +451,12 @@ 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. // case KEY_AP_RETURN_UIF: SaveAccessPolicy (); - *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY; + *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT; break; default: @@ -643,6 +553,179 @@ 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; + // + // 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; + } + break; + + default: + break; + } + break; + + default: + break; + } + break; + + default: + break; + } + } + break; + default: // // All other action return unsupported. @@ -786,7 +869,7 @@ UserProfileManagerInit ( // Publish HII data. // CallbackInfo->HiiHandle = HiiAddPackages ( - &mUserProfileManagerGuid, + &gUserProfileManagerGuid, CallbackInfo->DriverHandle, UserProfileManagerStrings, UserProfileManagerVfrBin,