From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EBB8D202E5303 for ; Mon, 9 Jul 2018 21:01:55 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2018 21:01:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,332,1526367600"; d="scan'208";a="55297589" Received: from ydong10-win10.ccr.corp.intel.com ([10.239.9.24]) by orsmga007.jf.intel.com with ESMTP; 09 Jul 2018 21:01:54 -0700 From: Eric Dong To: edk2-devel@lists.01.org Cc: Hao, Wu Date: Tue, 10 Jul 2018 12:01:51 +0800 Message-Id: <20180710040152.5812-2-eric.dong@intel.com> X-Mailer: git-send-email 2.15.0.windows.1 In-Reply-To: <20180710040152.5812-1-eric.dong@intel.com> References: <20180710040152.5812-1-eric.dong@intel.com> Subject: [Patch 1/2] SecurityPkg/TcgStorageOpalLib: Return AUTHORITY_LOCKED_OUT error. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2018 04:01:56 -0000 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 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong --- 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