public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Eric Dong <eric.dong@intel.com>
To: edk2-devel@lists.01.org
Cc: Hao, Wu <hao.a.wu@intel.com>
Subject: [Patch 1/2] SecurityPkg/TcgStorageOpalLib: Return AUTHORITY_LOCKED_OUT error.
Date: Tue, 10 Jul 2018 12:01:51 +0800	[thread overview]
Message-ID: <20180710040152.5812-2-eric.dong@intel.com> (raw)
In-Reply-To: <20180710040152.5812-1-eric.dong@intel.com>

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>
---
 SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c b/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c
index 756f9b8f2d..b738ab91ee 100644
--- a/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c
+++ b/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c
@@ -788,7 +788,15 @@ OpalUtilUpdateGlobalLockingRange(
 
 done:
   if (MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS) {
-    Ret = TcgResultFailure;
+    if (MethodStatus == TCG_METHOD_STATUS_CODE_AUTHORITY_LOCKED_OUT) {
+      //
+      // Caller need to know this special error, but return status not has type for it.
+      // so here use TcgResultFailureInvalidType as an replacement.
+      //
+      Ret = TcgResultFailureInvalidType;
+    } else {
+      Ret = TcgResultFailure;
+    }
   }
   return Ret;
 }
-- 
2.15.0.windows.1



  reply	other threads:[~2018-07-10  4:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-10  4:01 [Patch 0/2] Fixed correct password not works issue Eric Dong
2018-07-10  4:01 ` Eric Dong [this message]
2018-07-10  4:01 ` [Patch 2/2] SecurityPkg/OpalPassword: Fixed input " Eric Dong
2018-07-10  7:21 ` [Patch 0/2] Fixed " Wu, Hao A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180710040152.5812-2-eric.dong@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox