]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update for SecurityPkg.
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Dec 2011 02:59:03 +0000 (02:59 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Dec 2011 02:59:03 +0000 (02:59 +0000)
Per UEFI spec, on CallBack action EFI_BROWSER_ACTION_CHANGING, the return value of ActionRequest will be ignored, but on CallBack action EFI_BROWSER_ACTION_CHANGED, the return value of ActionRequest will be used.
But, EDKII browser still processes the got ActionRequest. And, all HII drivers in EDKII project also returns their expected ActionRequest value on action EFI_BROWSER_ACTION_CHANGING.
Now update the browser to follow the spec, and update all core Hii drivers to keep old working modal.

Signed-off-by: ydong10
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12868 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c
SecurityPkg/UserIdentification/PwdCredentialProviderDxe/PwdCredentialProvider.c
SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c
SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManagerData.h
SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManager.c
SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileManagerVfr.Vfr
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c

index 20eb3eee084e5fba4411a9d411952fe7f6b39280..f884226d97ceca9fa036b0b47ba18464e3612335 100644 (file)
@@ -404,7 +404,7 @@ TcgCallback (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if ((Action != EFI_BROWSER_ACTION_CHANGING) || (QuestionId != KEY_TPM_ACTION)) {\r
+  if ((Action != EFI_BROWSER_ACTION_CHANGED) || (QuestionId != KEY_TPM_ACTION)) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
index afb090a919425fa013874cc3a1c447b467d4eda7..cf7fe4079ad88dfa146e8362a65cff82fae48c03 100644 (file)
@@ -548,7 +548,7 @@ CredentialDriverCallback (
   CHAR8         Password[CREDENTIAL_LEN];\r
   CHAR16        *PromptStr;\r
 \r
-  if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
+  if (Action == EFI_BROWSER_ACTION_CHANGED) {\r
     if (QuestionId == KEY_GET_PASSWORD) {\r
       //\r
       // Get and check password.\r
index 268dfab469992b0470d86e8a49ed0b2177e9b42b..adcf9bf6528d235914cec2dbcc64fe13033a44a0 100644 (file)
@@ -2411,8 +2411,7 @@ UserIdentifyManagerCallback (
     Status = EFI_SUCCESS;\r
     break;\r
 \r
-  case EFI_BROWSER_ACTION_CHANGING:\r
-  {\r
+  case EFI_BROWSER_ACTION_CHANGED:\r
     if (QuestionId >= LABEL_PROVIDER_NAME) {\r
       //\r
       // QuestionId comes from the second Form (Select a Credential Provider if identity  \r
@@ -2425,10 +2424,16 @@ UserIdentifyManagerCallback (
       }\r
       return EFI_SUCCESS;\r
     }\r
-\r
+    break;\r
+    \r
+  case EFI_BROWSER_ACTION_CHANGING:\r
     //\r
     // QuestionId comes from the first Form (Select a user to identify).\r
     //\r
+    if (QuestionId >= LABEL_PROVIDER_NAME) {\r
+      return EFI_SUCCESS;\r
+    }\r
+\r
     User   = (USER_PROFILE_ENTRY *) mUserProfileDb->UserProfile[QuestionId & 0xFFF];\r
     Status = GetIdentifyType (User, &PolicyType);\r
     if (EFI_ERROR (Status)) {\r
@@ -2456,9 +2461,10 @@ UserIdentifyManagerCallback (
 \r
       mCurrentUser    = (EFI_USER_PROFILE_HANDLE) User;\r
       mIdentified     = TRUE;\r
-      *ActionRequest  = EFI_BROWSER_ACTION_REQUEST_EXIT;\r
+      if (Type == EFI_IFR_TYPE_REF) {\r
+        Value->ref.FormId = FORMID_INVALID_FORM;\r
+      }\r
     }\r
-  }\r
   break;\r
 \r
   default:\r
index 5efc50d16bdbde8ca46f0ec7271e67e4b99e04b1..b08ac46437f5d5bf97b783766f21502a97fc2fb9 100644 (file)
@@ -22,6 +22,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 #define FORMID_USER_FORM      1\r
 #define FORMID_PROVIDER_FORM  2\r
+#define FORMID_INVALID_FORM   0x0FFF\r
 \r
 //\r
 // Labels definition.\r
index 6e5bd06502140399f023c3c1c5f348c54e6b9978..4b1eabaaed0d50375c4fc89bdd098657604d9d13 100644 (file)
@@ -309,7 +309,7 @@ UserProfileManagerCallback (
     Status = EFI_SUCCESS;\r
     break;\r
 \r
-  case EFI_BROWSER_ACTION_CHANGING:\r
+  case EFI_BROWSER_ACTION_CHANGED:\r
   {  \r
     //\r
     // Handle the request from form.\r
@@ -337,13 +337,6 @@ UserProfileManagerCallback (
       // Judge next 2 bits.\r
       //\r
       switch (QuestionId & KEY_SECOND_FORM_MASK) {\r
-      //\r
-      // Enter delete user profile form.\r
-      //\r
-      case KEY_ENTER_NEXT_FORM:\r
-        SelectUserToDelete ();\r
-        break;\r
-\r
       //\r
       // Delete specified user profile.\r
       //\r
@@ -368,13 +361,6 @@ UserProfileManagerCallback (
       // Judge next 2 bits.\r
       //\r
       switch (QuestionId & KEY_SECOND_FORM_MASK) {\r
-      //\r
-      // Enter modify user profile form.\r
-      //\r
-      case KEY_ENTER_NEXT_FORM:\r
-        SelectUserToModify ();\r
-        break;\r
-\r
       //\r
       // Enter user profile information form.\r
       //\r
@@ -383,13 +369,6 @@ UserProfileManagerCallback (
         // Judge next 3 bits.\r
         //\r
         switch (QuestionId & KEY_MODIFY_INFO_MASK) {\r
-        //\r
-        // Display user information form.\r
-        //\r
-        case KEY_ENTER_NEXT_FORM:\r
-          ModifyUserInfo ((UINT8) QuestionId);\r
-          break;\r
-\r
         //\r
         // Modify user name.\r
         //\r
@@ -409,13 +388,6 @@ UserProfileManagerCallback (
           // Judge next 3 bits\r
           //\r
           switch (QuestionId & KEY_MODIFY_IP_MASK) {\r
-          //\r
-          // Display identity policy modify form.\r
-          //\r
-          case KEY_ENTER_NEXT_FORM:\r
-            ModifyIdentityPolicy ();\r
-            break;\r
-\r
           //\r
           // Change credential provider option.\r
           //\r
@@ -442,7 +414,7 @@ UserProfileManagerCallback (
           //\r
           case KEY_IP_RETURN_UIF:\r
             SaveIdentityPolicy ();\r
-            *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
+            *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;\r
             break;\r
 \r
           default:\r
@@ -458,13 +430,6 @@ UserProfileManagerCallback (
           // Judge next 3 bits.\r
           //\r
           switch (QuestionId & KEY_MODIFY_AP_MASK) {\r
-          //\r
-          // Display access policy modify form.\r
-          //\r
-          case KEY_ENTER_NEXT_FORM:\r
-            ModidyAccessPolicy ();\r
-            break;\r
-\r
           //\r
           // Change access right choice.\r
           //\r
@@ -545,7 +510,7 @@ UserProfileManagerCallback (
           //\r
           case KEY_AP_RETURN_UIF:\r
             SaveAccessPolicy ();\r
-            *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
+            *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;\r
             break;\r
 \r
           default:\r
@@ -642,6 +607,126 @@ UserProfileManagerCallback (
   }\r
   break;\r
 \r
+\r
+  case EFI_BROWSER_ACTION_CHANGING:\r
+  {  \r
+    //\r
+    // Handle the request from form.\r
+    //\r
+    if (Value == NULL) {\r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
+    \r
+    //\r
+    // Judge first 2 bits.\r
+    //\r
+    switch (QuestionId & KEY_FIRST_FORM_MASK) {\r
+    //\r
+    // Delete user profile operation.\r
+    //\r
+    case KEY_DEL_USER:\r
+      //\r
+      // Judge next 2 bits.\r
+      //\r
+      switch (QuestionId & KEY_SECOND_FORM_MASK) {\r
+      //\r
+      // Enter delete user profile form.\r
+      //\r
+      case KEY_ENTER_NEXT_FORM:\r
+        SelectUserToDelete ();\r
+        break;\r
+\r
+      default:\r
+        break;\r
+      }\r
+      break;\r
+\r
+    //\r
+    // Modify user profile operation.\r
+    //\r
+    case KEY_MODIFY_USER:\r
+      //\r
+      // Judge next 2 bits.\r
+      //\r
+      switch (QuestionId & KEY_SECOND_FORM_MASK) {\r
+      //\r
+      // Enter modify user profile form.\r
+      //\r
+      case KEY_ENTER_NEXT_FORM:\r
+        SelectUserToModify ();\r
+        break;\r
+\r
+      //\r
+      // Enter user profile information form.\r
+      //\r
+      case KEY_SELECT_USER:\r
+        //\r
+        // Judge next 3 bits.\r
+        //\r
+        switch (QuestionId & KEY_MODIFY_INFO_MASK) {\r
+        //\r
+        // Display user information form.\r
+        //\r
+        case KEY_ENTER_NEXT_FORM:\r
+          ModifyUserInfo ((UINT8) QuestionId);\r
+          break;\r
+\r
+        //\r
+        // Modify identity policy.\r
+        //\r
+        case KEY_MODIFY_IP:\r
+          //\r
+          // Judge next 3 bits\r
+          //\r
+          switch (QuestionId & KEY_MODIFY_IP_MASK) {\r
+          //\r
+          // Display identity policy modify form.\r
+          //\r
+          case KEY_ENTER_NEXT_FORM:\r
+            ModifyIdentityPolicy ();\r
+            break;\r
+\r
+          default:\r
+            break;\r
+          }\r
+          break;\r
+\r
+        //\r
+        // Modify access policy.\r
+        //\r
+        case KEY_MODIFY_AP:\r
+          //\r
+          // Judge next 3 bits.\r
+          //\r
+          switch (QuestionId & KEY_MODIFY_AP_MASK) {\r
+          //\r
+          // Display access policy modify form.\r
+          //\r
+          case KEY_ENTER_NEXT_FORM:\r
+            ModidyAccessPolicy ();\r
+            break;\r
+\r
+          default:\r
+            break;\r
+          }\r
+          break;\r
+\r
+        default:\r
+          break;\r
+        }\r
+        break;\r
+\r
+      default:\r
+        break;\r
+      }\r
+      break;\r
+\r
+    default:\r
+      break;\r
+    }\r
+  }\r
+  break;\r
+\r
   default:\r
     //\r
     // All other action return unsupported.\r
index d094d78a7625d497f62ff7caa3ae3283fb6e2206..fa6d9e4a8720b728ccdd286e9a69583ca7b79dad 100644 (file)
@@ -114,12 +114,12 @@ formset
     subtitle \r
       text   = STRING_TOKEN(STR_NULL_STRING);\r
 \r
-    goto FORMID_USER_INFO,\r
-      prompt  = STRING_TOKEN(STR_SAVE),\r
-      help    = STRING_TOKEN(STR_IDENTIFY_SAVE_HELP),\r
-      flags   = INTERACTIVE,\r
-      key     = KEY_IP_RETURN;\r
-      \r
+    text\r
+      help   = STRING_TOKEN(STR_IDENTIFY_SAVE_HELP),\r
+      text   = STRING_TOKEN(STR_SAVE),\r
+      flags  = INTERACTIVE,\r
+      key    = KEY_IP_RETURN;\r
+\r
   endform;\r
   \r
   //\r
@@ -146,12 +146,12 @@ formset
     subtitle \r
       text   = STRING_TOKEN(STR_NULL_STRING);\r
    \r
-    goto FORMID_USER_INFO,\r
-      prompt  = STRING_TOKEN(STR_SAVE),\r
-      help    = STRING_TOKEN(STR_ACCESS_SAVE_HELP),\r
-      flags   = INTERACTIVE,\r
-      key     = KEY_AP_RETURN;\r
-    \r
+    text\r
+      help   = STRING_TOKEN(STR_ACCESS_SAVE_HELP),\r
+      text   = STRING_TOKEN(STR_SAVE),\r
+      flags  = INTERACTIVE,\r
+      key    = KEY_AP_RETURN;\r
+\r
   endform;\r
 \r
   //\r
index 1d6d7aa2ce93cc93fc6851314e889708b98ab283..f846a72ca95b5b9b4af7ea3b8489b697210b6a79 100644 (file)
@@ -314,7 +314,7 @@ SecureBootCallback (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if ((Action != EFI_BROWSER_ACTION_CHANGING) || (QuestionId != KEY_SECURE_BOOT_ENABLE)) {\r
+  if ((Action != EFI_BROWSER_ACTION_CHANGED) || (QuestionId != KEY_SECURE_BOOT_ENABLE)) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r