From 0c5b25f021a815d4ddce306139cc077db9afddfd Mon Sep 17 00:00:00 2001 From: gdong1 Date: Wed, 26 Oct 2011 02:03:57 +0000 Subject: Update UID drivers to align with latest UEFI spec 2.3.1. Signed-off-by: gdong1 Reviewed-by: tye Reviewed-by: qianouyang git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12567 6f19259b-4bc3-4df7-8a09-765794883524 --- .../UserProfileManagerDxe/UserProfileDelete.c | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c') diff --git a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c index fffc93beab..3fe403106b 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,31 @@ 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. + // + DeleteCredentialFromProviders ((UINT8 *)(Info + 1), Info->InfoSize - sizeof (EFI_USER_INFO), User); + FreePool (Info); + Status = mUserManager->Delete (mUserManager, User); if (EFI_ERROR (Status)) { goto Done; -- cgit v1.2.3