From cdfe4310dda2a30b0ca05c8ede6896edce37a656 Mon Sep 17 00:00:00 2001 From: Linus Liu Date: Tue, 12 Sep 2023 09:41:59 +0800 Subject: Pyrite support - Secure erase is only available if encryption is supported. https://bugzilla.tianocore.org/show_bug.cgi?id=3004 Cc: Qi Zhang Cc: Rahul Kumar Cc: Jiewen Yao Cc: Tina Chen Cc: Xiao X Chen Signed-off-by: Linus Liu Reviewed-by: Jiewen Yao --- SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3