SecurityPkg OpalPasswordSmm: Always execute BlockSid command.

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>
This commit is contained in:
Eric Dong 2016-05-04 12:50:48 +08:00 committed by Liming Gao
parent 69cd129471
commit 3f250a944d
1 changed files with 7 additions and 7 deletions

View File

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