From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 E4F9581B3C for ; Mon, 9 Jan 2017 23:12:31 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP; 09 Jan 2017 23:12:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,342,1477983600"; d="scan'208";a="51465541" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 09 Jan 2017 23:12:31 -0800 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 9 Jan 2017 23:12:31 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 9 Jan 2017 23:12:31 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Tue, 10 Jan 2017 15:12:29 +0800 From: "Zeng, Star" To: "Zhang, Chao B" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "Zeng, Star" Thread-Topic: [PATCH] SecurityPkg: Tcg2ConfigDxe/Tcg2Smm: Fix TPM2 HID issue Thread-Index: AQHSaw5q0NLwKtaqVkiV2CwNCYEB4KExS5HQ Date: Tue, 10 Jan 2017 07:12:28 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B7F828A@shsmsx102.ccr.corp.intel.com> References: <20170110065422.29472-1-chao.b.zhang@intel.com> In-Reply-To: <20170110065422.29472-1-chao.b.zhang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTc3OWQwNjUtZDFkMy00YTA4LWE1OGMtZmI2NjNiZTkxMDQ5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImU0RU0ybndYcTh2UUpha2dDdjdTK0hhclBJOFowd3hXZTQ2a0R3TGowOU09In0= x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] SecurityPkg: Tcg2ConfigDxe/Tcg2Smm: Fix TPM2 HID issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 07:12:32 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: Zhang, Chao B=20 Sent: Tuesday, January 10, 2017 2:54 PM To: edk2-devel@lists.01.org Cc: Yao, Jiewen ; Zeng, Star ; Z= hang, Chao B Subject: [PATCH] SecurityPkg: Tcg2ConfigDxe/Tcg2Smm: Fix TPM2 HID issue Fix wrong TPM2 HID generation logic. Cc: Star Zeng Cc: Yao Jiewen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang --- SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c | 4 ++-- SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c b/SecurityPkg/Tcg/= Tcg2Config/Tcg2ConfigImpl.c index a83000f..b3a849e 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c @@ -441,9 +441,9 @@ GetTpm2HID( // #### is Firmware Version 1 // if (PnpHID) { - AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVer= sion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF)); + AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVer= sion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 & 0x0000FFFF)); } else { - AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVe= rsion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF)); + AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVe= rsion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 & 0x0000FFFF)); } =20 } else { diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tc= g2Smm.c index fa0b6e6..1df2da8 100644 --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c @@ -369,9 +369,9 @@ UpdateHID ( // #### is Firmware Version 1 // if (PnpHID) { - AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVer= sion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF)); + AsciiSPrint(Hid + 3, TPM_HID_PNP_SIZE - 3, "%02d%02d", ((FirmwareVer= sion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 & 0x0000FFFF)); } else { - AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVe= rsion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 && 0x0000FFFF)); + AsciiSPrint(Hid + 4, TPM_HID_ACPI_SIZE - 4, "%02d%02d", ((FirmwareVe= rsion1 & 0xFFFF0000) >> 16), (FirmwareVersion1 & 0x0000FFFF)); } =20 } else { --=20 1.9.5.msysgit.1