diff options
author | Eric Dong <eric.dong@intel.com> | 2016-05-25 08:28:46 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-06-16 10:41:37 +0800 |
commit | 0efc3be0af3dafffb99e29c569a2c230910678de (patch) | |
tree | 8cdf8574ca11b3cee496169e49ffe7547e175307 | |
parent | 9fb16e2143009c3158ab4be11adc3380bdab44ff (diff) | |
download | edk2-platforms-0efc3be0af3dafffb99e29c569a2c230910678de.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>
-rw-r--r-- | SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c index 33f74dd4a3..7a4b872048 100644 --- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c +++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c @@ -329,13 +329,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;
}
@@ -573,14 +567,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;
- }
-
}
}
}
@@ -1073,8 +1059,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);
}
|