summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/Tcg
diff options
context:
space:
mode:
authorChu, Maggie <maggie.chu@intel.com>2019-01-30 14:40:51 +0800
committerEric Dong <eric.dong@intel.com>2019-01-31 10:49:16 +0800
commit8a9301cdd75439e781754014f514fa06d99140d1 (patch)
tree535149cb5db428117273818dc305c0f320930c14 /SecurityPkg/Tcg
parentb566259c8a2447cc3db9979d815d955a90431520 (diff)
downloadedk2-8a9301cdd75439e781754014f514fa06d99140d1.tar.gz
edk2-8a9301cdd75439e781754014f514fa06d99140d1.tar.bz2
edk2-8a9301cdd75439e781754014f514fa06d99140d1.zip
SecurityPkg: Add a PCD to skip Opal password prompt
https://bugzilla.tianocore.org/show_bug.cgi?id=1484 Add a PCD for skipping password prompt and device unlock flow. so that other pre-OS applications are able to take over Opal devices unlock flow. Cc: Chao Zhang <chao.b.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Maggie Chu <maggie.chu@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
Diffstat (limited to 'SecurityPkg/Tcg')
-rw-r--r--SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c4
-rw-r--r--SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf3
2 files changed, 7 insertions, 0 deletions
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
index 38268539fb..734c5f06ff 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
@@ -988,6 +988,10 @@ OpalDriverRequestPassword (
IsLocked = OpalDeviceLocked (&Dev->OpalDisk.SupportedAttributes, &Dev->OpalDisk.LockingFeature);
+ if (IsLocked && PcdGetBool (PcdSkipOpalDxeUnlock)) {
+ return;
+ }
+
while (Count < MAX_PASSWORD_TRY_COUNT) {
Password = OpalDriverPopUpPasswordInput (Dev, PopUpString, NULL, &PressEsc);
if (PressEsc) {
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf
index cfa55dded7..11e58b95cd 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf
@@ -75,5 +75,8 @@
[Guids]
gEfiEndOfDxeEventGroupGuid ## CONSUMES ## Event
+[Pcd]
+ gEfiSecurityPkgTokenSpaceGuid.PcdSkipOpalDxeUnlock ## CONSUMES
+
[Depex]
gEfiHiiStringProtocolGuid AND gEfiHiiDatabaseProtocolGuid