X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=SecurityPkg%2FUserIdentification%2FUserProfileManagerDxe%2FUserProfileDelete.c;h=8be302e1ccb4fff3052e680e65c295a9a0869068;hb=c0cb1e1a72bccb5c83d7a36a8e52a38002b18671;hp=fffc93beab9a7e269e9e815da4c5c7d20d029646;hpb=a0c56a8219ec268d8ac4e051035f1636545cc478;p=mirror_edk2.git diff --git a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c index fffc93beab..8be302e1cc 100644 --- a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c +++ b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c @@ -185,6 +185,9 @@ DeleteUser ( EFI_STATUS Status; EFI_USER_PROFILE_HANDLE User; EFI_INPUT_KEY Key; + EFI_USER_INFO_HANDLE UserInfo; + EFI_USER_INFO *Info; + UINTN InfoSize; // // Find specified user profile and delete it. @@ -204,6 +207,32 @@ DeleteUser ( } if (UserIndex == 1) { + // + // Get the identification policy. + // + Status = FindInfoByType (User, EFI_USER_INFO_IDENTITY_POLICY_RECORD, &UserInfo); + if (EFI_ERROR (Status)) { + goto Done; + } + + InfoSize = 0; + Info = NULL; + Status = mUserManager->GetInfo (mUserManager, User, UserInfo, Info, &InfoSize); + if (Status == EFI_BUFFER_TOO_SMALL) { + Info = AllocateZeroPool (InfoSize); + if (Info == NULL) { + goto Done; + } + Status = mUserManager->GetInfo (mUserManager, User, UserInfo, Info, &InfoSize); + } + + // + // Delete the user on the credential providers by its identification policy. + // + ASSERT (Info != NULL); + DeleteCredentialFromProviders ((UINT8 *)(Info + 1), Info->InfoSize - sizeof (EFI_USER_INFO), User); + FreePool (Info); + Status = mUserManager->Delete (mUserManager, User); if (EFI_ERROR (Status)) { goto Done;