SecurityPkg/TcgStorageOpalLib: Return AUTHORITY_LOCKED_OUT error.
authorEric Dong <eric.dong@intel.com>
Tue, 10 Jul 2018 02:24:30 +0000 (10:24 +0800)
committerEric Dong <eric.dong@intel.com>
Wed, 11 Jul 2018 03:12:20 +0000 (11:12 +0800)
Caller need to known this error to handle specially, but current
error status not has specified value for this type. In order to
keep compatibility, here use TcgResultFailureInvalidType as an
replacement.

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/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c

index ca8e7fb..3c4a8e9 100644 (file)
@@ -788,7 +788,15 @@ OpalUtilUpdateGlobalLockingRange(
 \r
 done:\r
   if (MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS) {\r
-    Ret = TcgResultFailure;\r
+    if (MethodStatus == TCG_METHOD_STATUS_CODE_AUTHORITY_LOCKED_OUT) {\r
+      //\r
+      // Caller need to know this special error, but return status not has type for it.\r
+      // so here use TcgResultFailureInvalidType as an replacement.\r
+      //\r
+      Ret = TcgResultFailureInvalidType;\r
+    } else {\r
+      Ret = TcgResultFailure;\r
+    }\r
   }\r
   return Ret;\r
 }\r