/** @file\r
The functions for identification policy modification.\r
- \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
+\r
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
provider can't appear twice in one identity policy.\r
\r
@param[in] NewGuid Points to the credential provider guid.\r
- \r
+\r
@retval TRUE The NewGuid was found in the identity policy.\r
@retval FALSE The NewGuid was not found.\r
\r
}\r
Offset += Identity->Length;\r
}\r
- \r
+\r
return FALSE;\r
}\r
\r
EFI_STATUS\r
EnrollUserOnProvider (\r
IN EFI_USER_INFO_IDENTITY_POLICY *Identity,\r
- IN EFI_USER_PROFILE_HANDLE User \r
+ IN EFI_USER_PROFILE_HANDLE User\r
)\r
{\r
UINTN Index;\r
EFI_USER_CREDENTIAL2_PROTOCOL *UserCredential;\r
- \r
+\r
//\r
// Find the specified credential provider.\r
//\r
}\r
}\r
\r
- return EFI_NOT_FOUND; \r
+ return EFI_NOT_FOUND;\r
}\r
\r
\r
EFI_STATUS\r
DeleteUserOnProvider (\r
IN EFI_USER_INFO_IDENTITY_POLICY *Identity,\r
- IN EFI_USER_PROFILE_HANDLE User \r
+ IN EFI_USER_PROFILE_HANDLE User\r
)\r
{\r
UINTN Index;\r
EFI_USER_CREDENTIAL2_PROTOCOL *UserCredential;\r
- \r
+\r
//\r
// Find the specified credential provider.\r
//\r
}\r
}\r
\r
- return EFI_NOT_FOUND; \r
+ return EFI_NOT_FOUND;\r
}\r
\r
\r
/**\r
Delete User's credental from all the providers that exist in User's identity policy.\r
- \r
+\r
@param[in] IdentityPolicy Point to User's identity policy.\r
@param[in] IdentityPolicyLen The length of the identity policy.\r
@param[in] User Points to user profile.\r
DeleteCredentialFromProviders (\r
IN UINT8 *IdentityPolicy,\r
IN UINTN IdentityPolicyLen,\r
- IN EFI_USER_PROFILE_HANDLE User \r
+ IN EFI_USER_PROFILE_HANDLE User\r
)\r
{\r
EFI_USER_INFO_IDENTITY_POLICY *Identity;\r
\r
/**\r
Remove the provider specified by Offset from the new user identification record.\r
- \r
+\r
@param[in] IdentityPolicy Point to user identity item in new identification policy.\r
@param[in] Offset The item offset in the new identification policy.\r
\r
if ((Offset + IdentityPolicy->Length) != mUserInfo.NewIdentityPolicyLen) {\r
//\r
// This provider is not the last item in the identification policy, delete it and the connector.\r
- // \r
+ //\r
RemainingLen = mUserInfo.NewIdentityPolicyLen - Offset - DeleteLen;\r
CopyMem ((UINT8 *) IdentityPolicy, (UINT8 *) IdentityPolicy + DeleteLen, RemainingLen);\r
}\r
- mUserInfo.NewIdentityPolicyLen -= DeleteLen; \r
+ mUserInfo.NewIdentityPolicyLen -= DeleteLen;\r
}\r
\r
\r
It is invoked when 'add option' in UI is pressed.\r
\r
@param[in] NewGuid Points to the credential provider guid.\r
- \r
+\r
**/\r
VOID\r
AddProviderToPolicy (\r
NewPolicyInfoLen = mUserInfo.NewIdentityPolicyLen + Policy->Length;\r
FreePool (mUserInfo.NewIdentityPolicy);\r
}\r
- \r
+\r
//\r
// Save credential provider.\r
//\r
\r
@retval TRUE The policy is a valid identity policy.\r
@retval FALSE The policy is not a valid identity policy.\r
- \r
+\r
**/\r
BOOLEAN\r
CheckNewIdentityPolicy (\r
EFI_INPUT_KEY Key;\r
UINTN Offset;\r
UINT32 OpCode;\r
- \r
+\r
//\r
// Check policy expression.\r
//\r
//\r
Identity = (EFI_USER_INFO_IDENTITY_POLICY *) (PolicyInfo + Offset);\r
switch (Identity->Type) {\r
- \r
+\r
case EFI_USER_INFO_IDENTITY_TRUE:\r
break;\r
\r
\r
/**\r
Save the identity policy and update UI with it.\r
- \r
- This function will verify the new identity policy, in current implementation, \r
+\r
+ This function will verify the new identity policy, in current implementation,\r
the identity policy can be: T, P & P & P & ..., P | P | P | ...\r
Here, "T" means "True", "P" means "Credential Provider", "&" means "and", "|" means "or".\r
- Other identity policies are not supported. \r
+ Other identity policies are not supported.\r
\r
**/\r
VOID\r
if (EFI_ERROR (Status)) {\r
return ;\r
}\r
- \r
+\r
//\r
// Update the informantion on credential provider.\r
//\r
if (EFI_ERROR (Status)) {\r
return ;\r
}\r
- \r
+\r
//\r
// Save new identification policy.\r
//\r
\r
Status = mUserManager->SetInfo (mUserManager, mModifyUser, &UserInfo, Info, Info->InfoSize);\r
FreePool (Info);\r
- \r
+\r
//\r
// Update the mUserInfo.IdentityPolicy by mUserInfo.NewIdentityPolicy\r
//\r
\r
mUserInfo.NewIdentityPolicy = NULL;\r
mUserInfo.NewIdentityPolicyLen = 0;\r
- mUserInfo.NewIdentityPolicyModified = FALSE; \r
+ mUserInfo.NewIdentityPolicyModified = FALSE;\r
\r
//\r
// Update identity policy choice.\r
if (mProviderInfo->Count == 0) {\r
return ;\r
}\r
- \r
+\r
//\r
// Check the identity policy.\r
//\r