From nobody Mon Dec 23 05:08:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 152109937321739.55216909113017; Thu, 15 Mar 2018 00:36:13 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4DB90223FCF2B; Thu, 15 Mar 2018 00:29:34 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 8EB72223FCF21 for ; Thu, 15 Mar 2018 00:29:31 -0700 (PDT) Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2018 00:35:55 -0700 Received: from czhan46-mobl1.ccr.corp.intel.com ([10.239.192.117]) by orsmga007.jf.intel.com with ESMTP; 15 Mar 2018 00:35:54 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=chao.b.zhang@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,308,1517904000"; d="scan'208";a="24860160" From: "Zhang, Chao B" To: edk2-devel@lists.01.org Date: Thu, 15 Mar 2018 15:35:33 +0800 Message-Id: <20180315073537.16692-12-chao.b.zhang@intel.com> X-Mailer: git-send-email 2.11.0.windows.1 In-Reply-To: <20180315073537.16692-1-chao.b.zhang@intel.com> References: <20180315073537.16692-1-chao.b.zhang@intel.com> Subject: [edk2] [PATCH 11/15] SecurityPkg/Tpm2DeviceLibTrEE: remove TrEE. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiewen Yao , Chao B Zhang MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Jiewen Yao TrEE is deprecated. We need use Tcg2. Cc: Chao B Zhang Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao --- SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.c | 125 --------= ------------ SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.inf | 46 ------- SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.uni | 22 ---- 3 files changed, 193 deletions(-) diff --git a/SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.c b/Se= curityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.c deleted file mode 100644 index dc7b270705..0000000000 --- a/SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.c +++ /dev/null @@ -1,125 +0,0 @@ -/** @file - This library is TPM2 TREE protocol lib. - -Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD = License -which accompanies this distribution. The full text of the license may be = found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. - -**/ - -#include -#include -#include -#include -#include -#include -#include - -EFI_TREE_PROTOCOL *mTreeProtocol =3D NULL;=20 - -/** - This service enables the sending of commands to the TPM2. - - @param[in] InputParameterBlockSize Size of the TPM2 input paramete= r block. - @param[in] InputParameterBlock Pointer to the TPM2 input param= eter block. - @param[in,out] OutputParameterBlockSize Size of the TPM2 output paramet= er block. - @param[in] OutputParameterBlock Pointer to the TPM2 output para= meter block. - - @retval EFI_SUCCESS The command byte stream was successfully = sent to the device and a response was successfully received. - @retval EFI_DEVICE_ERROR The command was not successfully sent to = the device or a response was not successfully received from the device. - @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small.=20 -**/ -EFI_STATUS -EFIAPI -Tpm2SubmitCommand ( - IN UINT32 InputParameterBlockSize, - IN UINT8 *InputParameterBlock, - IN OUT UINT32 *OutputParameterBlockSize, - IN UINT8 *OutputParameterBlock - ) -{ - EFI_STATUS Status; - TPM2_RESPONSE_HEADER *Header; - - if (mTreeProtocol =3D=3D NULL) { - Status =3D gBS->LocateProtocol (&gEfiTrEEProtocolGuid, NULL, (VOID **)= &mTreeProtocol); - if (EFI_ERROR (Status)) { - // - // TrEE protocol is not installed. So, TPM2 is not present. - // - DEBUG ((EFI_D_ERROR, "Tpm2SubmitCommand - TrEE - %r\n", Status)); - return EFI_NOT_FOUND; - } - } - // - // Assume when TrEE Protocol is ready, RequestUseTpm already done. - // - Status =3D mTreeProtocol->SubmitCommand ( - mTreeProtocol, - InputParameterBlockSize, - InputParameterBlock, - *OutputParameterBlockSize, - OutputParameterBlock - ); - if (EFI_ERROR (Status)) { - return Status; - } - Header =3D (TPM2_RESPONSE_HEADER *)OutputParameterBlock; - *OutputParameterBlockSize =3D SwapBytes32 (Header->paramSize); - - return EFI_SUCCESS; -} - -/** - This service requests use TPM2. - - @retval EFI_SUCCESS Get the control of TPM2 chip. - @retval EFI_NOT_FOUND TPM2 not found. - @retval EFI_DEVICE_ERROR Unexpected device behavior. -**/ -EFI_STATUS -EFIAPI -Tpm2RequestUseTpm ( - VOID - ) -{ - EFI_STATUS Status; - - if (mTreeProtocol =3D=3D NULL) { - Status =3D gBS->LocateProtocol (&gEfiTrEEProtocolGuid, NULL, (VOID **)= &mTreeProtocol); - if (EFI_ERROR (Status)) { - // - // TrEE protocol is not installed. So, TPM2 is not present. - // - DEBUG ((EFI_D_ERROR, "Tpm2RequestUseTpm - TrEE - %r\n", Status)); - return EFI_NOT_FOUND; - } - } - // - // Assume when TrEE Protocol is ready, RequestUseTpm already done. - // - return EFI_SUCCESS; -} - -/** - This service register TPM2 device. - - @param Tpm2Device TPM2 device - - @retval EFI_SUCCESS This TPM2 device is registered successfully. - @retval EFI_UNSUPPORTED System does not support register this TPM2 = device. - @retval EFI_ALREADY_STARTED System already register this TPM2 device. -**/ -EFI_STATUS -EFIAPI -Tpm2RegisterTpm2DeviceLib ( - IN TPM2_DEVICE_INTERFACE *Tpm2Device - ) -{ - return EFI_UNSUPPORTED; -} diff --git a/SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.inf b/= SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.inf deleted file mode 100644 index 81195e6704..0000000000 --- a/SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.inf +++ /dev/null @@ -1,46 +0,0 @@ -## @file -# Provides function interfaces to communicate with TPM 2.0 device -# -# This library helps to use TPM 2.0 device in library function API -# based on TrEE protocol. -# -# Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BS= D License -# which accompanies this distribution. The full text of the license may be= found at -# http://opensource.org/licenses/bsd-license.php -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D Tpm2DeviceLibTrEE - MODULE_UNI_FILE =3D Tpm2DeviceLibTrEE.uni - FILE_GUID =3D BBCB6F85-303C-4eb9-8182-AF98D4B3020C - MODULE_TYPE =3D DXE_DRIVER - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D Tpm2DeviceLib|DXE_DRIVER DXE_RUNTIME_= DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER=20 - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 IPF -# - -[Sources] - Tpm2DeviceLibTrEE.c - -[Packages] - MdePkg/MdePkg.dec - SecurityPkg/SecurityPkg.dec - -[LibraryClasses] - BaseLib - BaseMemoryLib - DebugLib - UefiBootServicesTableLib - -[Protocols] - gEfiTrEEProtocolGuid ## CONSUMES diff --git a/SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.uni b/= SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.uni deleted file mode 100644 index d6defd04c8..0000000000 --- a/SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.uni +++ /dev/null @@ -1,22 +0,0 @@ -// /** @file -// Provides function interfaces to communicate with TPM 2.0 device -// -// This library helps to use TPM 2.0 device in library function API -// based on TrEE protocol. -// -// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the B= SD License -// which accompanies this distribution. The full text of the license may b= e found at -// http://opensource.org/licenses/bsd-license.php -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "Provides function= interfaces to communicate with TPM 2.0 device" - -#string STR_MODULE_DESCRIPTION #language en-US "This library help= s to use TPM 2.0 device in library function API based on TrEE protocol." - --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel