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 20eb3ee..f884226 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 afb090a..cf7fe40 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 268dfab..adcf9bf 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 5efc50d..b08ac46 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 6e5bd06..4b1eaba 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 d094d78..fa6d9e4 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 1d6d7aa..f846a72 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