]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.h
ArmPkg/ArmMmuLib ARM: fix thinko in second level page table handling
[mirror_edk2.git] / SecurityPkg / UserIdentification / UserProfileManagerDxe / UserProfileManager.h
index bff953960267974807967c0dbf5c8ffbb9ce4d54..aff1e28d9d361e4642d235b39747cd1883217834 100644 (file)
@@ -1,13 +1,13 @@
 /** @file\r
   The header file for user profile manager driver.\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
@@ -21,8 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/MdeModuleHii.h>\r
 \r
 #include <Protocol/HiiConfigAccess.h>\r
-#include <Protocol/DevicePathToText.h>\r
-#include <Protocol/UserCredential.h>\r
+#include <Protocol/UserCredential2.h>\r
 #include <Protocol/UserManager.h>\r
 \r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
@@ -44,7 +43,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 typedef struct {\r
   UINTN                         Count;\r
-  EFI_USER_CREDENTIAL_PROTOCOL  *Provider[1];\r
+  EFI_USER_CREDENTIAL2_PROTOCOL *Provider[1];\r
 } CREDENTIAL_PROVIDER_INFO;\r
 \r
 //\r
@@ -56,7 +55,7 @@ typedef struct {
   EFI_TIME  UsageDate;\r
   UINTN     AccessPolicyLen;\r
   UINTN     IdentityPolicyLen;\r
-  UINTN     NewIdentityPolicyLen;    \r
+  UINTN     NewIdentityPolicyLen;\r
   UINT8     *AccessPolicy;\r
   UINT8     *IdentityPolicy;\r
   UINT8     *NewIdentityPolicy;\r
@@ -140,6 +139,7 @@ extern USER_INFO                           mUserInfo;
 \r
 extern USER_PROFILE_MANAGER_CALLBACK_INFO  *mCallbackInfo;\r
 \r
+extern EFI_USER_PROFILE_HANDLE             mModifyUser;\r
 \r
 /**\r
   Get string by string id from HII Interface.\r
@@ -197,7 +197,7 @@ DeleteUser (
 /**\r
   Add a username item in form.\r
 \r
-  @param[in]  User             Points to the user profile whose username is added. \r
+  @param[in]  User             Points to the user profile whose username is added.\r
   @param[in]  Index            The index of the user in the user name list.\r
   @param[in]  OpCodeHandle     Points to container for dynamic created opcodes.\r
 \r
@@ -216,7 +216,7 @@ AddUserToForm (
   and access policy are displayed.\r
 \r
   @param[in] UserIndex       The index of the user in display list to modify.\r
-  \r
+\r
 **/\r
 VOID\r
 ModifyUserInfo (\r
@@ -224,7 +224,7 @@ ModifyUserInfo (
   );\r
 \r
 /**\r
-  Get the username from user input and update username string in Hii \r
+  Get the username from user input and update username string in Hii\r
   database with it.\r
 \r
 **/\r
@@ -253,11 +253,11 @@ AddIdentityPolicyItem (
 \r
 /**\r
   Save the identity policy and update UI with it.\r
-  \r
-  This funciton 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
@@ -270,7 +270,7 @@ SaveIdentityPolicy (
 \r
   In this form, access right, access setu,p and access boot order are dynamically\r
   added. Load devicepath and connect devicepath are displayed too.\r
-  \r
+\r
 **/\r
 VOID\r
 ModidyAccessPolicy (\r
@@ -278,7 +278,7 @@ ModidyAccessPolicy (
   );\r
 \r
 /**\r
-  Collect all the access policy data to mUserInfo.AccessPolicy, \r
+  Collect all the access policy data to mUserInfo.AccessPolicy,\r
   and save it to user profile.\r
 \r
 **/\r
@@ -338,23 +338,23 @@ DisplayConnectForbid (
   );\r
 \r
 /**\r
-  Delete the specified device path by DriverIndex from the forbid device path \r
+  Delete the specified device path by DriverIndex from the forbid device path\r
   list (mAccessInfo.LoadForbid).\r
 \r
   @param[in]  DriverIndex   The index of driver in a forbidden device path list.\r
-  \r
+\r
 **/\r
 VOID\r
 DeleteFromForbidLoad (\r
   IN  UINT16                                    DriverIndex\r
   );\r
-  \r
+\r
 /**\r
-  Add the specified device path by DriverIndex to the forbid device path \r
+  Add the specified device path by DriverIndex to the forbid device path\r
   list (mAccessInfo.LoadForbid).\r
 \r
   @param[in]  DriverIndex   The index of driver saved in driver options.\r
-  \r
+\r
 **/\r
 VOID\r
 AddToForbidLoad (\r
@@ -363,11 +363,11 @@ AddToForbidLoad (
 \r
 /**\r
   Get user name from the popup windows.\r
-  \r
+\r
   @param[in, out]  UserNameLen   On entry, point to the buffer lengh of UserName.\r
                                  On exit, point to the input user name length.\r
   @param[out]      UserName      The buffer to hold the input user name.\r
\r
+\r
   @retval EFI_ABORTED            It is given up by pressing 'ESC' key.\r
   @retval EFI_NOT_READY          Not a valid input at all.\r
   @retval EFI_SUCCESS            Get a user name successfully.\r
@@ -378,5 +378,67 @@ GetUserNameInput (
   IN OUT  UINTN         *UserNameLen,\r
      OUT  CHAR16        *UserName\r
   );\r
-  \r
+\r
+/**\r
+  Find the specified info in User profile by the InfoType.\r
+\r
+  @param[in]  User         Handle of the user whose information will be searched.\r
+  @param[in]  InfoType     The user information type to find.\r
+  @param[out] UserInfo     Points to user information handle found.\r
+\r
+  @retval EFI_SUCCESS      Find the user information successfully.\r
+  @retval Others           Fail to find the user information.\r
+\r
+**/\r
+EFI_STATUS\r
+FindInfoByType (\r
+  IN  EFI_USER_PROFILE_HANDLE                   User,\r
+  IN  UINT8                                     InfoType,\r
+  OUT EFI_USER_INFO_HANDLE                      *UserInfo\r
+  );\r
+\r
+/**\r
+  Convert the identity policy to a unicode string and update the Hii database\r
+  IpStringId string with it.\r
+\r
+  @param[in]  Ip         Points to identity policy.\r
+  @param[in]  IpLen      The identity policy length.\r
+  @param[in]  IpStringId String ID in the HII database to be replaced.\r
+\r
+**/\r
+VOID\r
+ResolveIdentityPolicy (\r
+  IN  UINT8                                     *Ip,\r
+  IN  UINTN                                     IpLen,\r
+  IN  EFI_STRING_ID                             IpStringId\r
+  );\r
+\r
+/**\r
+  Expand access policy memory size.\r
+\r
+  @param[in] ValidLen       The valid access policy length.\r
+  @param[in] ExpandLen      The length that is needed to expand.\r
+\r
+**/\r
+VOID\r
+ExpandMemory (\r
+  IN      UINTN                                 ValidLen,\r
+  IN      UINTN                                 ExpandLen\r
+  );\r
+\r
+/**\r
+  Delete User's credental from all the providers that exist in User's identity policy.\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
+\r
+**/\r
+VOID\r
+DeleteCredentialFromProviders (\r
+  IN     UINT8                                *IdentityPolicy,\r
+  IN     UINTN                                 IdentityPolicyLen,\r
+  IN     EFI_USER_PROFILE_HANDLE               User\r
+  );\r
+\r
 #endif\r