summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;