]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
SecurityPkg/OpalPassword: Add warning message for Secure Erase
[mirror_edk2.git] / SecurityPkg / Tcg / Opal / OpalPassword / OpalHii.c
index 8abb3d028b2f5b77b61548218935ca5edef88acc..d0f3eda1e8437e3ec908aa0bd8d77a5f13ca1602 100644 (file)
@@ -511,13 +511,15 @@ GetDiskNameStringId(
 /**\r
   Confirm whether user truly want to do the revert action.\r
 \r
-  @param     OpalDisk            The device which need to do the revert action.\r
+  @param     OpalDisk            The device which need to perform data removal action.\r
+  @param     ActionString        Specifies the action name shown on pop up menu.\r
 \r
   @retval  EFI_SUCCESS           Confirmed user want to do the revert action.\r
 **/\r
 EFI_STATUS\r
-HiiConfirmRevertAction (\r
-  IN OPAL_DISK                  *OpalDisk\r
+HiiConfirmDataRemovalAction (\r
+  IN OPAL_DISK                  *OpalDisk,\r
+  IN CHAR16                     *ActionString\r
 \r
   )\r
 {\r
@@ -537,14 +539,14 @@ HiiConfirmRevertAction (
   ApproveResponse = L'Y';\r
   RejectResponse  = L'N';\r
 \r
-  UnicodeSPrint(Unicode, StrSize(L"WARNING: Revert device needs about ####### seconds"), L"WARNING: Revert device needs about %d seconds", OpalDisk->EstimateTimeCost);\r
+  UnicodeSPrint(Unicode, StrSize(L"WARNING: ############# action needs about ####### seconds"), L"WARNING: %s action needs about %d seconds", ActionString, OpalDisk->EstimateTimeCost);\r
 \r
   do {\r
     CreatePopUp(\r
         EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
         &Key,\r
         Unicode,\r
-        L" System should not be powered off until revert completion ",\r
+        L" System should not be powered off until action completion ",\r
         L" ",\r
         L" Press 'Y/y' to continue, press 'N/n' to cancal ",\r
         NULL\r
@@ -634,7 +636,16 @@ DriverCallback(
       case HII_KEY_ID_PSID_REVERT:\r
         OpalDisk = HiiGetOpalDiskCB(gHiiConfiguration.SelectedDiskIndex);\r
         if (OpalDisk != NULL) {\r
-          return HiiConfirmRevertAction (OpalDisk);\r
+          return HiiConfirmDataRemovalAction (OpalDisk, L"Revert");\r
+        } else {\r
+          ASSERT (FALSE);\r
+          return EFI_SUCCESS;\r
+        }\r
+\r
+      case HII_KEY_ID_SECURE_ERASE:\r
+        OpalDisk = HiiGetOpalDiskCB(gHiiConfiguration.SelectedDiskIndex);\r
+        if (OpalDisk != NULL) {\r
+          return HiiConfirmDataRemovalAction (OpalDisk, L"Secure erase");\r
         } else {\r
           ASSERT (FALSE);\r
           return EFI_SUCCESS;\r