]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg OpalPasswordSmm: Always execute BlockSid command.
authorEric Dong <eric.dong@intel.com>
Wed, 4 May 2016 04:50:48 +0000 (12:50 +0800)
committerLiming Gao <liming.gao@intel.com>
Thu, 5 May 2016 04:52:48 +0000 (12:52 +0800)
The BlockSid feature is not depend on lock status,
so move the send BlockSid command out of unlock process.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.c

index 46311bd8a0d98f98d686625813c29a3e7e829a2a..47b570f343424feb118126bfeba49db26865d53c 100644 (file)
@@ -442,19 +442,19 @@ SmmUnlockOpalPassword (
       Session.MediaId = 0;\r
       Session.OpalBaseComId = OpalDev->OpalBaseComId;\r
 \r
-      if (mSendBlockSID && BlockSidSupport) {\r
-        Result = OpalBlockSid (&Session, TRUE);\r
-        if (Result != TcgResultSuccess) {\r
-          break;\r
-        }\r
-      }\r
-\r
       Result = OpalSupportUnlock (&Session, OpalDev->Password, OpalDev->PasswordLength, NULL);\r
       if (Result == TcgResultSuccess) {\r
         Status = EFI_SUCCESS;\r
       }\r
     }\r
 \r
+    if (mSendBlockSID && BlockSidSupport) {\r
+      Result = OpalBlockSid (&Session, TRUE);\r
+      if (Result != TcgResultSuccess) {\r
+        break;\r
+      }\r
+    }\r
+\r
     if (OpalDev->DeviceType == OPAL_DEVICE_TYPE_NVME) {\r
       if (SubClassCode == PCI_CLASS_MASS_STORAGE_NVM) {\r
         Status = NvmeControllerExit (&mNvmeContext);\r