summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2016-05-25 08:28:46 +0800
committerHao Wu <hao.a.wu@intel.com>2016-07-07 11:21:20 +0800
commit6c327875e81b6007647071209ab05a9af843cdab (patch)
treef2845e846b101b10a7b554c7d4b571b536beac2e
parentca4c38816fed056fd6fc5db723eac62a9a43c556 (diff)
downloadedk2-platforms-6c327875e81b6007647071209ab05a9af843cdab.tar.xz
SecurityPkg OpalPasswordDxe: gray out menu instead of suppress it.
For current implementation, if the device is pyrite type, driver will suppress the "keep user data" option. Base on the feedback from user, they prefer to keep the menu but gray out it. Now base on this feedback to update the driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> (cherry picked from commit 0efc3be0af3dafffb99e29c569a2c230910678de)
-rw-r--r--SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
index 3fb3553f27..4c72df35b4 100644
--- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
+++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
@@ -327,13 +327,7 @@ HiiSelectDiskAction (
case HII_KEY_ID_GOTO_REVERT:
gHiiConfiguration.AvailableFields |= HII_FIELD_PASSWORD;
- if (OpalDisk->SupportedAttributes.PyriteSsc != 1) {
- //
- // According to current Pyrite SSC Spec 1.00, there is no parameter for RevertSP method.
- // So issue RevertSP method without any parameter by suppress KeepUserData option.
- //
- gHiiConfiguration.AvailableFields |= HII_FIELD_KEEP_USER_DATA;
- }
+ gHiiConfiguration.AvailableFields |= HII_FIELD_KEEP_USER_DATA;
if (AvailActions.RevertKeepDataForced) {
gHiiConfiguration.AvailableFields |= HII_FIELD_KEEP_USER_DATA_FORCED;
}
@@ -571,14 +565,6 @@ HiiPopulateDiskInfoForm(
// Default initialize keep user Data to be true
//
gHiiConfiguration.KeepUserData = 1;
- if (OpalDisk->SupportedAttributes.PyriteSsc == 1) {
- //
- // According to current Pyrite SSC Spec 1.00, there is no parameter for RevertSP method.
- // So issue RevertSP method without any parameter by set default value to FALSE.
- //
- gHiiConfiguration.KeepUserData = 0;
- }
-
}
}
}
@@ -1071,8 +1057,15 @@ HiiPasswordEntered(
} else if (gHiiConfiguration.SelectedAction == HII_KEY_ID_GOTO_DISABLE_USER) {
Status = HiiDisableUser (OpalDisk, Password, PassLength);
} else if (gHiiConfiguration.SelectedAction == HII_KEY_ID_GOTO_REVERT) {
- DEBUG ((DEBUG_INFO, "gHiiConfiguration.KeepUserData %u\n", gHiiConfiguration.KeepUserData));
- Status = HiiRevert(OpalDisk, Password, PassLength, gHiiConfiguration.KeepUserData);
+ if (OpalDisk->SupportedAttributes.PyriteSsc == 1 && OpalDisk->LockingFeature.MediaEncryption == 0) {
+ //
+ // For pyrite type device which also not supports media encryption, it not accept "Keep User Data" parameter.
+ // So here hardcode a FALSE for this case.
+ //
+ Status = HiiRevert(OpalDisk, Password, PassLength, FALSE);
+ } else {
+ Status = HiiRevert(OpalDisk, Password, PassLength, gHiiConfiguration.KeepUserData);
+ }
} else {
Status = HiiSetPassword(OpalDisk, Password, PassLength);
}