summaryrefslogtreecommitdiffstats
path: root/SecurityPkg
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2018-07-10 10:30:20 +0800
committerEric Dong <eric.dong@intel.com>2018-07-11 11:16:06 +0800
commite4e314b1b6b74c46da3c0493e7a807df28cb9aed (patch)
treecc2ab6318a022663dc6a08e67813df2045b6cbee /SecurityPkg
parent54ae532cd4fded97a2a9f55eb87fab86063a0f07 (diff)
downloadedk2-e4e314b1b6b74c46da3c0493e7a807df28cb9aed.tar.gz
edk2-e4e314b1b6b74c46da3c0493e7a807df28cb9aed.tar.bz2
edk2-e4e314b1b6b74c46da3c0493e7a807df28cb9aed.zip
SecurityPkg/OpalPassword: Fixed input correct password not works issue
When user input error password exceed the max allowed times, opal device will return Invalid type error code even user input the correct password. In this case, opal driver needs to force user shutdown the system before let user input new password. Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Diffstat (limited to 'SecurityPkg')
-rw-r--r--SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
index 5d1638d5cf..e3f5056953 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
@@ -1076,6 +1076,15 @@ OpalDriverRequestPassword (
break;
}
+ //
+ // Check whether opal device's Tries value has reach the TryLimit value, if yes, force a shutdown
+ // before accept new password.
+ //
+ if (Ret == TcgResultFailureInvalidType) {
+ Count = MAX_PASSWORD_TRY_COUNT;
+ break;
+ }
+
Count++;
do {