]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/HddPassword/HddPasswordDxe.c
SecurityPkg: Fix spelling errors
[mirror_edk2.git] / SecurityPkg / HddPassword / HddPasswordDxe.c
index 253af9f78fa4145c3af7d0c4cbad1c7e379e953a..a25b3471d073449e6bb99d753be80c412c7355b6 100644 (file)
@@ -120,7 +120,7 @@ BuildHddPasswordDeviceInfo (
 \r
     //\r
     // 1. Handle device which already set password.\r
-    // 2. When request to send freeze comamnd, driver also needs to handle device\r
+    // 2. When request to send freeze command, driver also needs to handle device\r
     //    which support security feature.\r
     //\r
     if ((!PasswordIsFullZero (ConfigFormEntry->Password)) ||\r
@@ -1345,6 +1345,22 @@ HddPasswordRequestPassword (
   //\r
   if ((ConfigFormEntry->IfrData.SecurityStatus.Supported) &&\r
       (ConfigFormEntry->IfrData.SecurityStatus.Enabled)) {\r
+\r
+     //\r
+     // Add PcdSkipHddPasswordPrompt to determin whether to skip password prompt.\r
+     // Due to board design, device may not power off during system warm boot, which result in\r
+     // security status remain unlocked status, hence we add device security status check here.\r
+     //\r
+     // If device is in the locked status, device keeps locked and system continues booting.\r
+     // If device is in the unlocked status, system is forced shutdown for security concern.\r
+     //\r
+     if (PcdGetBool (PcdSkipHddPasswordPrompt)) {\r
+       if (ConfigFormEntry->IfrData.SecurityStatus.Locked) {\r
+         return;\r
+       } else {\r
+         gRT->ResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL);\r
+       }\r
+    }\r
     //\r
     // As soon as the HDD password is in enabled state, we pop up a window to unlock hdd\r
     // no matter it's really in locked or unlocked state.\r
@@ -1992,9 +2008,9 @@ SaveHddPasswordRequest (
 }\r
 \r
 /**\r
-  Get the HDD Password configuration form entry by the index of the goto opcode actived.\r
+  Get the HDD Password configuration form entry by the index of the goto opcode activated.\r
 \r
-  @param[in]  Index The 0-based index of the goto opcode actived.\r
+  @param[in]  Index The 0-based index of the goto opcode activated.\r
 \r
   @return The HDD Password configuration form entry found.\r
 **/\r
@@ -2742,7 +2758,7 @@ HddPasswordConfigFormInit (
   @param ImageHandle     Image handle this driver.\r
   @param SystemTable     Pointer to SystemTable.\r
 \r
-  @retval EFI_SUCESS     This function always complete successfully.\r
+  @retval EFI_SUCCESS     This function always complete successfully.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -2754,7 +2770,7 @@ HddPasswordDxeInit (
 {\r
   EFI_STATUS                     Status;\r
   HDD_PASSWORD_DXE_PRIVATE_DATA  *Private;\r
-  EFI_EVENT                      Registration;\r
+  VOID                           *Registration;\r
   EFI_EVENT                      EndOfDxeEvent;\r
   EDKII_VARIABLE_LOCK_PROTOCOL   *VariableLock;\r
 \r
@@ -2790,7 +2806,7 @@ HddPasswordDxeInit (
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
-  // Make HDD_PASSWORD_VARIABLE_NAME varible read-only.\r
+  // Make HDD_PASSWORD_VARIABLE_NAME variable read-only.\r
   //\r
   Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock);\r
   if (!EFI_ERROR (Status)) {\r