X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=SecurityPkg%2FUserIdentification%2FUserProfileManagerDxe%2FUserProfileManager.c;h=e73ba3a8fc50703abd3116e6b692775831d52c76;hp=4bba0824c7abcf5effb5bf11684d5f50dfe906bc;hb=b3548d32ddb553a9e95503457c66d11462622d16;hpb=dc458c90b357db2f1793d36bb1965f47f4e45382 diff --git a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c index 4bba0824c7..e73ba3a8fc 100644 --- a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c +++ b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c @@ -1,16 +1,17 @@ /** @file - This driver is a configuration tool for adding, deleting or modifying user - profiles, including gathering the necessary information to ascertain their - identity in the future, updating user access policy and identification + This driver is a configuration tool for adding, deleting or modifying user + profiles, including gathering the necessary information to ascertain their + identity in the future, updating user access policy and identification policy, etc. -Copyright (c) 2009 - 2011, 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 +Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP
+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 http://opensource.org/licenses/bsd-license.php -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ @@ -70,12 +71,12 @@ GetStringById ( /** - This function gets all the credential providers in the system and saved them + This function gets all the credential providers in the system and saved them to mProviderInfo. @retval EFI_SUCESS Init credential provider database successfully. @retval Others Fail to init credential provider database. - + **/ EFI_STATUS InitProviderInfo ( @@ -85,8 +86,8 @@ InitProviderInfo ( EFI_STATUS Status; UINTN HandleCount; EFI_HANDLE *HandleBuf; - UINTN Index; - + UINTN Index; + // // Try to find all the user credential provider driver. // @@ -102,7 +103,7 @@ InitProviderInfo ( if (EFI_ERROR (Status)) { return Status; } - + // // Get provider infomation. // @@ -110,7 +111,7 @@ InitProviderInfo ( FreePool (mProviderInfo); } mProviderInfo = AllocateZeroPool ( - sizeof (CREDENTIAL_PROVIDER_INFO) - + sizeof (CREDENTIAL_PROVIDER_INFO) - sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) + HandleCount * sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) ); @@ -191,7 +192,7 @@ UserProfileManagerCallback ( if (QuestionId != QUESTIONID_USER_MANAGE) { return EFI_SUCCESS; } - + // // Get current user // @@ -201,7 +202,7 @@ UserProfileManagerCallback ( DEBUG ((DEBUG_ERROR, "Error: current user does not exist!\n")); return EFI_NOT_READY; } - + // // Get current user's right information. // @@ -209,7 +210,7 @@ UserProfileManagerCallback ( if (EFI_ERROR (Status)) { CurrentAccessRight = EFI_USER_INFO_ACCESS_ENROLL_SELF; } - + // // Init credential provider information. // @@ -217,16 +218,16 @@ UserProfileManagerCallback ( if (EFI_ERROR (Status)) { return Status; } - + // // Initialize the container for dynamic opcodes. // StartOpCodeHandle = HiiAllocateOpCodeHandle (); ASSERT (StartOpCodeHandle != NULL); - + EndOpCodeHandle = HiiAllocateOpCodeHandle (); ASSERT (EndOpCodeHandle != NULL); - + // // Create Hii Extend Label OpCode. // @@ -238,7 +239,7 @@ UserProfileManagerCallback ( ); StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL; StartLabel->Number = LABEL_USER_MANAGE_FUNC; - + EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode ( EndOpCodeHandle, &gEfiIfrTianoGuid, @@ -247,7 +248,7 @@ UserProfileManagerCallback ( ); EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL; EndLabel->Number = LABEL_END; - + // // Add user profile option. // @@ -263,7 +264,7 @@ UserProfileManagerCallback ( 0 // Action String ID ); } - + // // Add modify user profile option. // @@ -275,7 +276,7 @@ UserProfileManagerCallback ( EFI_IFR_FLAG_CALLBACK, // Question flag KEY_MODIFY_USER // Question ID ); - + // // Add delete user profile option // @@ -289,7 +290,7 @@ UserProfileManagerCallback ( KEY_DEL_USER // Question ID ); } - + HiiUpdateForm ( mCallbackInfo->HiiHandle, // HII handle &gUserProfileManagerGuid, // Formset GUID @@ -297,10 +298,10 @@ UserProfileManagerCallback ( StartOpCodeHandle, // Label for where to insert opcodes EndOpCodeHandle // Replace data ); - + HiiFreeOpCodeHandle (StartOpCodeHandle); HiiFreeOpCodeHandle (EndOpCodeHandle); - + return EFI_SUCCESS; } break; @@ -310,14 +311,14 @@ UserProfileManagerCallback ( break; case EFI_BROWSER_ACTION_CHANGED: - { + { // // Handle the request from form. // if ((Value == NULL) || (ActionRequest == NULL)) { return EFI_INVALID_PARAMETER; } - + // // Judge first 2 bits. // @@ -391,7 +392,7 @@ UserProfileManagerCallback ( // // Change credential provider option. // - case KEY_MODIFY_PROV: + case KEY_MODIFY_PROV: mProviderChoice = Value->u8; break; @@ -555,14 +556,14 @@ UserProfileManagerCallback ( case EFI_BROWSER_ACTION_CHANGING: - { + { // // Handle the request from form. // if (Value == NULL) { return EFI_INVALID_PARAMETER; } - + // // Judge first 2 bits. // @@ -665,19 +666,19 @@ UserProfileManagerCallback ( case KEY_PERMIT_MODIFY: DisplayLoadPermit (); break; - + // // Forbid load device path. // case KEY_FORBID_MODIFY: DisplayLoadForbid (); break; - + default: break; } break; - + // // Connect device path form. // @@ -692,14 +693,14 @@ UserProfileManagerCallback ( case KEY_PERMIT_MODIFY: DisplayConnectPermit (); break; - + // // Forbid connect device path. // case KEY_FORBID_MODIFY: DisplayConnectForbid (); break; - + default: break; } @@ -805,6 +806,8 @@ FakeRouteConfig ( return EFI_INVALID_PARAMETER; } + *Progress = Configuration; + return EFI_NOT_FOUND; } @@ -836,7 +839,7 @@ UserProfileManagerInit ( if (EFI_ERROR (Status)) { return EFI_SUCCESS; } - + // // Initialize driver private data. // @@ -844,14 +847,14 @@ UserProfileManagerInit ( ZeroMem (&mAccessInfo, sizeof (mAccessInfo)); CallbackInfo = AllocateZeroPool (sizeof (USER_PROFILE_MANAGER_CALLBACK_INFO)); - ASSERT (CallbackInfo != NULL); + ASSERT (CallbackInfo != NULL); CallbackInfo->Signature = USER_PROFILE_MANAGER_SIGNATURE; CallbackInfo->ConfigAccess.ExtractConfig = FakeExtractConfig; CallbackInfo->ConfigAccess.RouteConfig = FakeRouteConfig; CallbackInfo->ConfigAccess.Callback = UserProfileManagerCallback; CallbackInfo->DriverHandle = NULL; - + // // Install Device Path Protocol and Config Access protocol to driver handle. // @@ -875,10 +878,10 @@ UserProfileManagerInit ( UserProfileManagerVfrBin, NULL ); - ASSERT (CallbackInfo->HiiHandle != NULL); + ASSERT (CallbackInfo->HiiHandle != NULL); mCallbackInfo = CallbackInfo; return Status; } - +