From: Eric Dong Date: Tue, 10 Jul 2018 02:30:20 +0000 (+0800) Subject: SecurityPkg/OpalPassword: Fixed input correct password not works issue X-Git-Tag: edk2-stable201903~1432 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=e4e314b1b6b74c46da3c0493e7a807df28cb9aed;ds=inline 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 --- 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 {