]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c
ArmPkg/ArmMmuLib ARM: fix thinko in second level page table handling
[mirror_edk2.git] / SecurityPkg / UserIdentification / UserProfileManagerDxe / UserProfileManager.c
index 4b1eabaaed0d50375c4fc89bdd098657604d9d13..e73ba3a8fc50703abd3116e6b692775831d52c76 100644 (file)
@@ -1,16 +1,17 @@
 /** @file\r
-  This driver is a configuration tool for adding, deleting or modifying user \r
-  profiles, including gathering the necessary information to ascertain their \r
-  identity in the future, updating user access policy and identification \r
+  This driver is a configuration tool for adding, deleting or modifying user\r
+  profiles, including gathering the necessary information to ascertain their\r
+  identity in the future, updating user access policy and identification\r
   policy, etc.\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
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP<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
@@ -70,12 +71,12 @@ GetStringById (
 \r
 \r
 /**\r
-  This function gets all the credential providers in the system and saved them \r
+  This function gets all the credential providers in the system and saved them\r
   to mProviderInfo.\r
 \r
   @retval EFI_SUCESS     Init credential provider database successfully.\r
   @retval Others         Fail to init credential provider database.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 InitProviderInfo (\r
@@ -85,8 +86,8 @@ InitProviderInfo (
   EFI_STATUS  Status;\r
   UINTN       HandleCount;\r
   EFI_HANDLE  *HandleBuf;\r
-  UINTN       Index;  \r
-  \r
+  UINTN       Index;\r
+\r
   //\r
   // Try to find all the user credential provider driver.\r
   //\r
@@ -102,7 +103,7 @@ InitProviderInfo (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Get provider infomation.\r
   //\r
@@ -110,7 +111,7 @@ InitProviderInfo (
     FreePool (mProviderInfo);\r
   }\r
   mProviderInfo = AllocateZeroPool (\r
-                    sizeof (CREDENTIAL_PROVIDER_INFO) - \r
+                    sizeof (CREDENTIAL_PROVIDER_INFO) -\r
                     sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) +\r
                     HandleCount * sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *)\r
                     );\r
@@ -191,7 +192,7 @@ UserProfileManagerCallback (
       if (QuestionId != QUESTIONID_USER_MANAGE) {\r
         return EFI_SUCCESS;\r
       }\r
-  \r
+\r
       //\r
       // Get current user\r
       //\r
@@ -201,7 +202,7 @@ UserProfileManagerCallback (
         DEBUG ((DEBUG_ERROR, "Error: current user does not exist!\n"));\r
         return EFI_NOT_READY;\r
       }\r
-      \r
+\r
       //\r
       // Get current user's right information.\r
       //\r
@@ -209,7 +210,7 @@ UserProfileManagerCallback (
       if (EFI_ERROR (Status)) {\r
         CurrentAccessRight = EFI_USER_INFO_ACCESS_ENROLL_SELF;\r
       }\r
-  \r
+\r
       //\r
       // Init credential provider information.\r
       //\r
@@ -217,16 +218,16 @@ UserProfileManagerCallback (
       if (EFI_ERROR (Status)) {\r
         return Status;\r
       }\r
-      \r
+\r
       //\r
       // Initialize the container for dynamic opcodes.\r
       //\r
       StartOpCodeHandle = HiiAllocateOpCodeHandle ();\r
       ASSERT (StartOpCodeHandle != NULL);\r
-  \r
+\r
       EndOpCodeHandle = HiiAllocateOpCodeHandle ();\r
       ASSERT (EndOpCodeHandle != NULL);\r
-  \r
+\r
       //\r
       // Create Hii Extend Label OpCode.\r
       //\r
@@ -238,7 +239,7 @@ UserProfileManagerCallback (
                                             );\r
       StartLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;\r
       StartLabel->Number        = LABEL_USER_MANAGE_FUNC;\r
-  \r
+\r
       EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (\r
                                           EndOpCodeHandle,\r
                                           &gEfiIfrTianoGuid,\r
@@ -247,7 +248,7 @@ UserProfileManagerCallback (
                                           );\r
       EndLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;\r
       EndLabel->Number        = LABEL_END;\r
-  \r
+\r
       //\r
       // Add user profile option.\r
       //\r
@@ -263,7 +264,7 @@ UserProfileManagerCallback (
           0                                   // Action String ID\r
           );\r
       }\r
-      \r
+\r
       //\r
       // Add modify user profile option.\r
       //\r
@@ -275,7 +276,7 @@ UserProfileManagerCallback (
         EFI_IFR_FLAG_CALLBACK,                // Question flag\r
         KEY_MODIFY_USER                       // Question ID\r
         );\r
-  \r
+\r
       //\r
       // Add delete user profile option\r
       //\r
@@ -289,7 +290,7 @@ UserProfileManagerCallback (
           KEY_DEL_USER                          // Question ID\r
           );\r
       }\r
-  \r
+\r
       HiiUpdateForm (\r
         mCallbackInfo->HiiHandle,               // HII handle\r
         &gUserProfileManagerGuid,               // Formset GUID\r
@@ -297,10 +298,10 @@ UserProfileManagerCallback (
         StartOpCodeHandle,                      // Label for where to insert opcodes\r
         EndOpCodeHandle                         // Replace data\r
         );\r
-  \r
+\r
       HiiFreeOpCodeHandle (StartOpCodeHandle);\r
       HiiFreeOpCodeHandle (EndOpCodeHandle);\r
-  \r
+\r
       return EFI_SUCCESS;\r
     }\r
     break;\r
@@ -310,14 +311,14 @@ UserProfileManagerCallback (
     break;\r
 \r
   case EFI_BROWSER_ACTION_CHANGED:\r
-  {  \r
+  {\r
     //\r
     // Handle the request from form.\r
     //\r
     if ((Value == NULL) || (ActionRequest == NULL)) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
-    \r
+\r
     //\r
     // Judge first 2 bits.\r
     //\r
@@ -391,7 +392,7 @@ UserProfileManagerCallback (
           //\r
           // Change credential provider option.\r
           //\r
-          case KEY_MODIFY_PROV:         \r
+          case KEY_MODIFY_PROV:\r
             mProviderChoice = Value->u8;\r
             break;\r
 \r
@@ -451,60 +452,6 @@ UserProfileManagerCallback (
             mAccessInfo.AccessBootOrder = Value->u32;\r
             break;\r
 \r
-          //\r
-          // Load device path form.\r
-          //\r
-          case KEY_MODIFY_LOAD:\r
-            //\r
-            // Judge next 2 bits.\r
-            //\r
-            switch (QuestionId & KEY_DISPLAY_DP_MASK) {\r
-            //\r
-            // Permit load device path.\r
-            //\r
-            case KEY_PERMIT_MODIFY:\r
-              DisplayLoadPermit ();\r
-              break;\r
-\r
-            //\r
-            // Forbid load device path.\r
-            //\r
-            case KEY_FORBID_MODIFY:\r
-              DisplayLoadForbid ();\r
-              break;\r
-\r
-            default:\r
-              break;\r
-            }\r
-            break;\r
-\r
-          //\r
-          // Connect device path form.\r
-          //\r
-          case KEY_MODIFY_CONNECT:\r
-            //\r
-            // Judge next 2 bits.\r
-            //\r
-            switch (QuestionId & KEY_DISPLAY_DP_MASK) {\r
-            //\r
-            // Permit connect device path.\r
-            //\r
-            case KEY_PERMIT_MODIFY:\r
-              DisplayConnectPermit ();\r
-              break;\r
-\r
-            //\r
-            // Forbid connect device path.\r
-            //\r
-            case KEY_FORBID_MODIFY:\r
-              DisplayConnectForbid ();\r
-              break;\r
-\r
-            default:\r
-              break;\r
-            }\r
-            break;\r
-\r
           //\r
           // Return to user profile information form.\r
           //\r
@@ -609,14 +556,14 @@ UserProfileManagerCallback (
 \r
 \r
   case EFI_BROWSER_ACTION_CHANGING:\r
-  {  \r
+  {\r
     //\r
     // Handle the request from form.\r
     //\r
     if (Value == NULL) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
-    \r
+\r
     //\r
     // Judge first 2 bits.\r
     //\r
@@ -705,6 +652,59 @@ UserProfileManagerCallback (
           case KEY_ENTER_NEXT_FORM:\r
             ModidyAccessPolicy ();\r
             break;\r
+          //\r
+          // Load device path form.\r
+          //\r
+          case KEY_MODIFY_LOAD:\r
+            //\r
+            // Judge next 2 bits.\r
+            //\r
+            switch (QuestionId & KEY_DISPLAY_DP_MASK) {\r
+            //\r
+            // Permit load device path.\r
+            //\r
+            case KEY_PERMIT_MODIFY:\r
+              DisplayLoadPermit ();\r
+              break;\r
+\r
+            //\r
+            // Forbid load device path.\r
+            //\r
+            case KEY_FORBID_MODIFY:\r
+              DisplayLoadForbid ();\r
+              break;\r
+\r
+            default:\r
+              break;\r
+            }\r
+            break;\r
+\r
+          //\r
+          // Connect device path form.\r
+          //\r
+          case KEY_MODIFY_CONNECT:\r
+            //\r
+            // Judge next 2 bits.\r
+            //\r
+            switch (QuestionId & KEY_DISPLAY_DP_MASK) {\r
+            //\r
+            // Permit connect device path.\r
+            //\r
+            case KEY_PERMIT_MODIFY:\r
+              DisplayConnectPermit ();\r
+              break;\r
+\r
+            //\r
+            // Forbid connect device path.\r
+            //\r
+            case KEY_FORBID_MODIFY:\r
+              DisplayConnectForbid ();\r
+              break;\r
+\r
+            default:\r
+              break;\r
+            }\r
+            break;\r
 \r
           default:\r
             break;\r
@@ -806,6 +806,8 @@ FakeRouteConfig (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  *Progress = Configuration;\r
+\r
   return EFI_NOT_FOUND;\r
 }\r
 \r
@@ -837,7 +839,7 @@ UserProfileManagerInit (
   if (EFI_ERROR (Status)) {\r
     return EFI_SUCCESS;\r
   }\r
-  \r
+\r
   //\r
   // Initialize driver private data.\r
   //\r
@@ -845,14 +847,14 @@ UserProfileManagerInit (
   ZeroMem (&mAccessInfo, sizeof (mAccessInfo));\r
 \r
   CallbackInfo = AllocateZeroPool (sizeof (USER_PROFILE_MANAGER_CALLBACK_INFO));\r
-  ASSERT (CallbackInfo != NULL);  \r
+  ASSERT (CallbackInfo != NULL);\r
 \r
   CallbackInfo->Signature                   = USER_PROFILE_MANAGER_SIGNATURE;\r
   CallbackInfo->ConfigAccess.ExtractConfig  = FakeExtractConfig;\r
   CallbackInfo->ConfigAccess.RouteConfig    = FakeRouteConfig;\r
   CallbackInfo->ConfigAccess.Callback       = UserProfileManagerCallback;\r
   CallbackInfo->DriverHandle                = NULL;\r
-  \r
+\r
   //\r
   // Install Device Path Protocol and Config Access protocol to driver handle.\r
   //\r
@@ -876,10 +878,10 @@ UserProfileManagerInit (
                               UserProfileManagerVfrBin,\r
                               NULL\r
                               );\r
-  ASSERT (CallbackInfo->HiiHandle != NULL);                              \r
+  ASSERT (CallbackInfo->HiiHandle != NULL);\r
   mCallbackInfo = CallbackInfo;\r
 \r
   return Status;\r
 }\r
 \r
-  \r
+\r