]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg/OpalPassword: Fixed input correct password not works issue
authorEric Dong <eric.dong@intel.com>
Tue, 10 Jul 2018 02:30:20 +0000 (10:30 +0800)
committerEric Dong <eric.dong@intel.com>
Wed, 11 Jul 2018 03:16:06 +0000 (11:16 +0800)
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>
SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c

index 5d1638d5cf01f8ac8676e119eaf8373960ef3a0b..e3f5056953bb21809354364bb14ac11a37116cbb 100644 (file)
@@ -1076,6 +1076,15 @@ OpalDriverRequestPassword (
         break;\r
       }\r
 \r
+      //\r
+      // Check whether opal device's Tries value has reach the TryLimit value, if yes, force a shutdown\r
+      // before accept new password.\r
+      //\r
+      if (Ret == TcgResultFailureInvalidType) {\r
+        Count = MAX_PASSWORD_TRY_COUNT;\r
+        break;\r
+      }\r
+\r
       Count++;\r
 \r
       do {\r