summaryrefslogtreecommitdiffstats
path: root/SecurityPkg
diff options
context:
space:
mode:
authorLinus Liu <linus.liu@intel.com>2023-09-12 09:41:59 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-09-13 06:35:02 +0000
commitcdfe4310dda2a30b0ca05c8ede6896edce37a656 (patch)
tree865d31a072af7563e6209fa1ad26d7a4592f8da5 /SecurityPkg
parent4a1afea6f7361fd65e9d4ba34eaac48ec8bb2867 (diff)
downloadedk2-cdfe4310dda2a30b0ca05c8ede6896edce37a656.tar.gz
edk2-cdfe4310dda2a30b0ca05c8ede6896edce37a656.tar.bz2
edk2-cdfe4310dda2a30b0ca05c8ede6896edce37a656.zip
Pyrite support - Secure erase is only available if encryption is supported.
https://bugzilla.tianocore.org/show_bug.cgi?id=3004 Cc: Qi Zhang <qi1.zhang@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tina Chen <tina.chen@intel.com> Cc: Xiao X Chen <xiao.x.chen@intel.com> Signed-off-by: Linus Liu <linus.liu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'SecurityPkg')
-rw-r--r--SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
index e2e77cbc24..ba9fa66c60 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
@@ -87,7 +87,11 @@ OpalSupportGetAvailableActions (
// Secure erase is performed by generating a new encryption key
// this is only available if encryption is supported
//
- AvalDiskActions->SecureErase = 1;
+ if (SupportedAttributes->MediaEncryption) {
+ AvalDiskActions->SecureErase = 1;
+ } else {
+ AvalDiskActions->SecureErase = 0;
+ }
} else {
AvalDiskActions->PsidRevert = 0;
AvalDiskActions->SecureErase = 0;