X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=SecurityPkg%2FUserIdentification%2FUserIdentifyManagerDxe%2FUserIdentifyManager.c;h=e846b71f035903562258638bc6dcbd8279c451b5;hb=bfbe0beec10e391464a16e7d38bf8936955547a0;hp=e105579115a89cf1864dfc5fb7962f4677049a79;hpb=0c18794ea4289f03fefc7117b56740414cc0536c;p=mirror_edk2.git diff --git a/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c b/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c index e105579115..e846b71f03 100644 --- a/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c +++ b/SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c @@ -14,11 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "UserIdentifyManager.h" -// -// Guid used in user profile saving and in form browser. -// -EFI_GUID mUserManagerGuid = USER_IDENTIFY_MANAGER_GUID; - // // Default user name. // @@ -54,10 +49,7 @@ HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath = { (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) } }, - // - // {ACA7C06F-743C-454f-9C6D-692138482498} - // - { 0xaca7c06f, 0x743c, 0x454f, { 0x9c, 0x6d, 0x69, 0x21, 0x38, 0x48, 0x24, 0x98 } } + USER_IDENTIFY_MANAGER_GUID }, { END_DEVICE_PATH_TYPE, @@ -1152,7 +1144,7 @@ SaveNvUserProfile ( // Status = gRT->SetVariable ( User->UserVarName, - &mUserManagerGuid, + &gUserIdentifyManagerGuid, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, Delete ? 0 : User->UserProfileSize, User->ProfileInfo @@ -2319,7 +2311,7 @@ GetIdentifyType ( Identify the User by the specfied provider. @param[in] User Handle of a user profile. - @param[in] Provider Points to the identifir of credential provider. + @param[in] Provider Points to the identifier of credential provider. @retval EFI_INVALID_PARAMETER Provider is NULL. @retval EFI_NOT_FOUND Fail to identify the specified user. @@ -2340,7 +2332,6 @@ IdentifyByProviderId ( EFI_GUID FormSetId; EFI_FORM_ID FormId; EFI_USER_CREDENTIAL_PROTOCOL *UserCredential; - EFI_USER_INFO *IdInfo; if (Provider == NULL) { return EFI_INVALID_PARAMETER; @@ -2398,24 +2389,7 @@ IdentifyByProviderId ( if (EFI_ERROR (Status)) { return Status; } - - if (User == NULL) { - return EFI_SUCCESS; - } - // - // Get user ID information. - // - IdInfo = NULL; - Status = FindUserInfoByType (User, &IdInfo, EFI_USER_INFO_IDENTIFIER_RECORD); - ASSERT (IdInfo != NULL); - - if (CompareMem ((UINT8 *) (IdInfo + 1), UserId, sizeof (EFI_USER_INFO_IDENTIFIER)) != 0) { - // - // One user name is selected, but the other's credential is given. Here no user passed. - // - break; - } return EFI_SUCCESS; } } @@ -2830,7 +2804,7 @@ IdentifyOrTypeUser ( HiiUpdateForm ( mCallbackInfo->HiiHandle, // HII handle - &mUserManagerGuid, // Formset GUID + &gUserIdentifyManagerGuid,// Formset GUID FORMID_PROVIDER_FORM, // Form ID StartOpCodeHandle, // Label for where to insert opcodes EndOpCodeHandle // Replace data @@ -2934,7 +2908,7 @@ UserIdentifyManagerCallback ( HiiUpdateForm ( mCallbackInfo->HiiHandle, // HII handle - &mUserManagerGuid, // Formset GUID + &gUserIdentifyManagerGuid,// Formset GUID FORMID_USER_FORM, // Form ID StartOpCodeHandle, // Label for where to insert opcodes EndOpCodeHandle // Replace data @@ -3076,7 +3050,7 @@ InitUserProfileDb ( // Get variable value. // VarSize = CurVarSize; - Status = gRT->GetVariable (VarName, &mUserManagerGuid, &VarAttr, &VarSize, VarData); + Status = gRT->GetVariable (VarName, &gUserIdentifyManagerGuid, &VarAttr, &VarSize, VarData); if (Status == EFI_BUFFER_TOO_SMALL) { FreePool (VarData); VarData = AllocatePool (VarSize); @@ -3086,7 +3060,7 @@ InitUserProfileDb ( } CurVarSize = VarSize; - Status = gRT->GetVariable (VarName, &mUserManagerGuid, &VarAttr, &VarSize, VarData); + Status = gRT->GetVariable (VarName, &gUserIdentifyManagerGuid, &VarAttr, &VarSize, VarData); } if (EFI_ERROR (Status)) { @@ -3100,7 +3074,7 @@ InitUserProfileDb ( // Check variable attributes. // if (VarAttr != (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)) { - Status = gRT->SetVariable (VarName, &mUserManagerGuid, VarAttr, 0, NULL); + Status = gRT->SetVariable (VarName, &gUserIdentifyManagerGuid, VarAttr, 0, NULL); continue; } @@ -3113,7 +3087,7 @@ InitUserProfileDb ( // // Delete invalid user profile // - gRT->SetVariable (VarName, &mUserManagerGuid, VarAttr, 0, NULL); + gRT->SetVariable (VarName, &gUserIdentifyManagerGuid, VarAttr, 0, NULL); } else if (Status == EFI_OUT_OF_RESOURCES) { break; } @@ -3122,7 +3096,7 @@ InitUserProfileDb ( // Delete and save the profile again if some invalid profiles are deleted. // if (mUserProfileDb->UserProfileNum < Index) { - gRT->SetVariable (VarName, &mUserManagerGuid, VarAttr, 0, NULL); + gRT->SetVariable (VarName, &gUserIdentifyManagerGuid, VarAttr, 0, NULL); SaveNvUserProfile (mUserProfileDb->UserProfile[mUserProfileDb->UserProfileNum - 1], FALSE); } } @@ -3367,7 +3341,7 @@ InitFormBrowser ( // Publish HII data. // CallbackInfo->HiiHandle = HiiAddPackages ( - &mUserManagerGuid, + &gUserIdentifyManagerGuid, CallbackInfo->DriverHandle, UserIdentifyManagerStrings, UserIdentifyManagerVfrBin, @@ -3608,7 +3582,7 @@ IdentifyUser ( mCallbackInfo->FormBrowser2, &mCallbackInfo->HiiHandle, 1, - &mUserManagerGuid, + &gUserIdentifyManagerGuid, 0, NULL, NULL