From e4e314b1b6b74c46da3c0493e7a807df28cb9aed Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Tue, 10 Jul 2018 10:30:20 +0800 Subject: [PATCH] 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 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong Reviewed-by: Hao Wu --- SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 { -- 2.39.2