diff options
author | gdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-11-01 09:18:30 +0000 |
---|---|---|
committer | gdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-11-01 09:18:30 +0000 |
commit | 44a957c6079de6bf6c40d1782bcea07f9866fd58 (patch) | |
tree | 00270389e56d47374ed33bea675e8948ddff76e4 /SecurityPkg/UserIdentification | |
parent | 2972b50ca22611bc63be80176b0f391dbd29be17 (diff) | |
download | edk2-platforms-44a957c6079de6bf6c40d1782bcea07f9866fd58.tar.xz |
Enhance drivers for sanity check and coding style alignment.
Signed-off-by: gdong1
Reviewed-by: ydong10
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12622 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SecurityPkg/UserIdentification')
3 files changed, 15 insertions, 16 deletions
diff --git a/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c b/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c index 613751e023..d73f77eeec 100644 --- a/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c +++ b/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c @@ -167,7 +167,7 @@ SaveAccessPolicy ( //
// Save access policy.
//
- if (mUserInfo.AccessPolicyModified && (mUserInfo.AccessPolicyLen > 0)) {
+ if (mUserInfo.AccessPolicyModified && (mUserInfo.AccessPolicyLen > 0) && (mUserInfo.AccessPolicy != NULL)) {
Info = AllocateZeroPool (sizeof (EFI_USER_INFO) + mUserInfo.AccessPolicyLen);
if (Info == NULL) {
return ;
diff --git a/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyIdentityPolicy.c b/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyIdentityPolicy.c index 2e2d67edfc..eaf53c9678 100644 --- a/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyIdentityPolicy.c +++ b/SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyIdentityPolicy.c @@ -58,7 +58,7 @@ ProviderAlreadyInPolicy ( /**
- Add or delete the user's credential record in the provider.
+ Add the user's credential record in the provider.
@param[in] ProviderGuid Point to credential provider guid.
@param[in] User Points to user profile.
@@ -157,17 +157,13 @@ DeleteCredentialFromProviders ( /**
- Remove the provider in FindIdentity from the user identification information record.
+ Remove the provider specified by Offset from the new user identification record.
- @param[in, out] NewInfo On entry, points to the user information to remove provider.
- On return, points to the user information the provider is removed.
- @param[in] FindIdentity Point to the user identity policy.
-
- @retval TRUE The provider is removed successfully.
- @retval FALSE Fail to remove the provider.
+ @param[in] IdentityPolicy Point to user identity item in new identification policy.
+ @param[in] Offset The item offset in the new identification policy.
**/
-BOOLEAN
+VOID
DeleteProviderFromPolicy (
IN EFI_USER_INFO_IDENTITY_POLICY *IdentityPolicy,
IN UINTN Offset
@@ -184,7 +180,7 @@ DeleteProviderFromPolicy ( IdentityPolicy->Type = EFI_USER_INFO_IDENTITY_TRUE;
IdentityPolicy->Length = sizeof (EFI_USER_INFO_IDENTITY_POLICY);
mUserInfo.NewIdentityPolicyLen = IdentityPolicy->Length;
- return TRUE;
+ return ;
}
DeleteLen = IdentityPolicy->Length + sizeof(EFI_USER_INFO_IDENTITY_POLICY);
@@ -196,17 +192,19 @@ DeleteProviderFromPolicy ( CopyMem ((UINT8 *) IdentityPolicy, (UINT8 *) IdentityPolicy + DeleteLen, RemainingLen);
}
mUserInfo.NewIdentityPolicyLen -= DeleteLen;
-
- return FALSE;
}
/**
- Update the mUserInfo.NewIdentityPolicy, and UI when 'add option' is pressed.
+ Add a new provider to the mUserInfo.NewIdentityPolicy.
+
+ It is invoked when 'add option' in UI is pressed.
+ @param[in] NewGuid Points to the credential provider guid.
+
**/
VOID
- AddProviderToPolicy (
+AddProviderToPolicy (
IN EFI_GUID *NewGuid
)
{
@@ -489,7 +487,7 @@ SaveIdentityPolicy ( **/
VOID
- AddIdentityPolicyItem (
+AddIdentityPolicyItem (
VOID
)
{
diff --git a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c index 3fe403106b..8be302e1cc 100644 --- a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c +++ b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileDelete.c @@ -229,6 +229,7 @@ DeleteUser ( //
// 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);
|