From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.6203.1597108832246188077 for ; Mon, 10 Aug 2020 18:20:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=D6lMO6qT; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: liming.gao@intel.com) IronPort-SDR: IH9ZrkmWCSM3w829UEG6o7CiUhW7QqsITDulpiPjg9D0su/zd4GAwpJVoS9DA0YtCnQcfmxN0q YzHO1rTNhoAw== X-IronPort-AV: E=McAfee;i="6000,8403,9709"; a="141260434" X-IronPort-AV: E=Sophos;i="5.75,458,1589266800"; d="scan'208";a="141260434" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2020 18:20:31 -0700 IronPort-SDR: iV+X2LeM9lh107+aM0esDNTxmXLdBth4fXld8rGxfjdtMMQQPyFnlSyeTynwQoUOx79lky52UD fGeeJ3vNEUJQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,458,1589266800"; d="scan'208";a="469249207" Received: from orsmsx601-2.jf.intel.com (HELO ORSMSX601.amr.corp.intel.com) ([10.22.229.81]) by orsmga005.jf.intel.com with ESMTP; 10 Aug 2020 18:20:31 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 10 Aug 2020 18:20:31 -0700 Received: from orsmsx151.amr.corp.intel.com (10.22.226.38) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 10 Aug 2020 18:20:31 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX151.amr.corp.intel.com (10.22.226.38) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 10 Aug 2020 18:20:30 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.40) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 10 Aug 2020 18:20:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HIDlbAcWHrvRKh/LbMy2/VAAVKrylRLpMeU/qV2jLOY8ZdWok9Lv5gLjYQmXkZoi4hjFBjwjeap2HgX8iytB9nS/CI19I+J2Njw07Can+APIHDIB7oKuQIFaFmvPEmxD6m9PYxLYLvNd1/Wq6713krJRqEr/dukJMwHzFR2rmFZxJ4wTMm7SL8si/f9wrRZUT0laHgW8RHTHGQHtEvIniP3eTME6K7lQCjM5sMZJt8Snx6GAZB0ScODw39Qvad+ajfV63BLx6zBwejng9qnNHJuUiq7UXi2Il8lXS932/ITMpZpj/JtT3meg8MQM0VypS6tOekko50AYorg1N+8t6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wQm8xH39X2YszwAGJvJ7t7nLQKPcM96AaEY3yMDshk0=; b=FNCAy0sIRw462HxGIu0WO+eb9n3ZR+KNxm1PKkCPfyqKKEMWODETk6XoyeW/1R896TTHmYpjLqggpkWTWvdV42s/bI5DKdyM3a5O81TfJ6KdznWYKwTvYp4NlL0larzzYroOQtl9LouDZoNJyeLXO9R6ulLis1MhtYXjZAp+ZeVAj+QgogCLrJhVrZ/qKwTsdYfoyC4KivfJ6OH8BHcMNS3hJRszKpQA4RxEcxgTjkNGn1oJUQ9yndlC7p1pqdQ+ewrvYda02j7kqrq2vwWyxW4MjfIVDW+Xt+2OpiMiFjb01U4KncIkXreswK9Jucarjn6YZVx87uRQDcWVZ1uDsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wQm8xH39X2YszwAGJvJ7t7nLQKPcM96AaEY3yMDshk0=; b=D6lMO6qTAV/Yb13JTWbz9Okl87Wyr3exeLyrGjGP5jNtZfxuigxd+fC7iirMFarMrdU3Rs6sCk/volg3tYu1VebRP/5Wykk4jIyBIZuOAN5DNJWiBNrQiBcLxZK0jqMbib5pPdMqWSpoOS6P2Fp9rf24938xkLGwa9y52CjgQyI= Received: from CY4PR11MB1526.namprd11.prod.outlook.com (2603:10b6:910:7::10) by CY4PR11MB1559.namprd11.prod.outlook.com (2603:10b6:910:11::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.18; Tue, 11 Aug 2020 01:20:28 +0000 Received: from CY4PR11MB1526.namprd11.prod.outlook.com ([fe80::f8c4:711:84e3:4c97]) by CY4PR11MB1526.namprd11.prod.outlook.com ([fe80::f8c4:711:84e3:4c97%4]) with mapi id 15.20.3261.024; Tue, 11 Aug 2020 01:20:28 +0000 From: "Liming Gao" To: "Zhang, Qi1" , "devel@edk2.groups.io" CC: "Yao, Jiewen" , "Wang, Jian J" , "Kumar, Rahul1" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH v2 9/9] SecurityPkg/Tcg2: handle PRE HASH and LOG ONLY Thread-Topic: [edk2-devel] [PATCH v2 9/9] SecurityPkg/Tcg2: handle PRE HASH and LOG ONLY Thread-Index: AQHWa4lgEjQ11Vb/NEmTTsinXQ9dkakyEstggAAJ2QCAAAXtsA== Date: Tue, 11 Aug 2020 01:20:28 +0000 Message-ID: References: <20200806003342.17866-1-qi1.zhang@intel.com> <20200806003342.17866-10-qi1.zhang@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.194] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 40eb293c-7884-4be3-a801-08d83d94bbc4 x-ms-traffictypediagnostic: CY4PR11MB1559: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Iw+IfvbdZKToHWSoZ0FebpFRQOx/YLsDVK8erv9zufnxELN5EonHtvw7ZQTXWu+h1lGrpKB2oZVc+SgU12V198undr6QpF9cwXDfnfCfYX7k0MtyIblo/MIZAMP0DHMICFuF3Poyg+gvwauRrvpM3RC4DliJIgr6NgnGCLRqiQiV/q5Tgg7CAftp5IftHQwDXJg+deY8zJvtYJ8eVurTl4vxka8NpX6KgGfD5AyFSX8PcJhcoheBctvDuM7iSg3dKyl+M3vWEwtlLG0a2iCDuIysJsOz8AZPlZZ6hWUuxOig92WOr6VQBxt3RuilQQYlSiYMu/kedcl1FwRE0nrvEw/jJ2cfGt/agnkVJwVDnzKxzpzr2pX4fRlpW8fCPfryWzPHIQoYD1VKNdGm9dOqJw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR11MB1526.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(396003)(376002)(136003)(346002)(39860400002)(8936002)(7696005)(9686003)(966005)(55016002)(6506007)(83380400001)(71200400001)(53546011)(478600001)(86362001)(52536014)(107886003)(76116006)(8676002)(26005)(33656002)(2906002)(186003)(5660300002)(64756008)(66556008)(15650500001)(19627235002)(316002)(66946007)(66446008)(66476007)(54906003)(4326008)(110136005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: 3I5d6aHwHPWtWjbgF9x1YFohYoUrXnRQ5geKmTTSrmAnmAP3DyOAdmwfOTDweqzH8aAjP4aU5zRJ2N9d2kpZ1CWvxox1FUTc/jgk9MIx68d+FQnZT9GJJm7AiouxrR8a5IEc49C0/AlKYemvq0axHhHbNz6M9+3E2acrBATErY/A5uhlYXFGFDnUAMW0QutR1ueb+NEYooY26+u9LMwpZGFdUEEpqZwfN6fsKH45mZOpYQpx9fS7ic/zifdO5r+7dYiOOwGAcyFTIMNQ456ALqNVHk8IY6UmNReMx8kYdmJhkG5cXCinKkHybLASuSYhIFwH1Chjiz9LsZ3zZrz2uipLcbBbhSkuzvdzelDoiyQ5sSWSHJ8R2PUb/d+lL3pd9TXnsFhJwMSIa1ko62enZZ6DcfgVhPOW+Qrz5mcUwjQFbeSCOF5kFrJt4ytlY6k1Mh+Ki5IC1JRC6Hugm8P0prMB6W/sXBYSBaycQJFJAd9wvX55VAhLMNPmOlmXb82L0ucwFobtB+GyaVzDkw+FyHzX/HIZcwNjUWeXIg6y+lmg9ZBGGAR1rpYOL5vFmNW25eWPP3mmchMpk836TNnLus5AphGPfs2eSztXoQdBcQW7thxZK6Er6LFJ+buZVrMcURenhBMolp+DdkVdhvQHwQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB1526.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40eb293c-7884-4be3-a801-08d83d94bbc4 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Aug 2020 01:20:28.6557 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MhXZSmHcedj4ylO9Ej8jBxmXHeSkjSqgH9cytsM1NyMCNBeYebSlxFxeeb1sMNM26wkUl01rGmyyo98hCfwIIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1559 Return-Path: liming.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Qi: EccPlugin will be enabled in open CI. Then, ECC result can be checked in = open CI result. Now, I use the standalone EccCheck.py from https://github.c= om/shenglei10/edk2/tree/ecc_script to check the patch set.=20 Thanks Liming -----Original Message----- From: Zhang, Qi1 =20 Sent: 2020=1B$BG/=1B(B8=1B$B7n=1B(B11=1B$BF|=1B(B 8:54 To: Gao, Liming ; devel@edk2.groups.io Cc: Yao, Jiewen ; Wang, Jian J ; Kumar, Rahul1 Subject: RE: [edk2-devel] [PATCH v2 9/9] SecurityPkg/Tcg2: handle PRE HASH = and LOG ONLY Hi, Liming Thanks for your comments! Is there any wiki of how to run ECC plugin? BRs Qi Zhang > -----Original Message----- > From: Gao, Liming > Sent: Tuesday, August 11, 2020 8:19 AM > To: devel@edk2.groups.io; Zhang, Qi1 > Cc: Yao, Jiewen ; Wang, Jian J=20 > ; Kumar, Rahul1 > Subject: RE: [edk2-devel] [PATCH v2 9/9] SecurityPkg/Tcg2: handle PRE=20 > HASH and LOG ONLY >=20 > Qi: > I run ECC plugin (https://edk2.groups.io/g/devel/message/63271) for=20 > this patch set. It reports below issues. Can you help update the patches = to fix them? >=20 > EFI coding style error > *Error code: 3002 > *Non-Boolean comparisons should use a compare operator (=3D=3D, !=3D, >= , < >=3D, <=3D) > *file: D:\AllPkg\edk2\SecurityPkg\Tcg\Tcg2Pei\Tcg2Pei.c > *Line number: 456 > *Predicate Expression: (Flags & EDKII_TCG_PRE_HASH EFI coding style err= or > *Error code: 3002 > *Non-Boolean comparisons should use a compare operator (=3D=3D, !=3D, >= , < >=3D, <=3D) > *file: D:\AllPkg\edk2\SecurityPkg\Tcg\Tcg2Pei\Tcg2Pei.c > *Line number: 456 > *Predicate Expression: Flags & EDKII_TCG_PRE_HASH_LOG_ONLY EFI=20 > coding style error > *Error code: 3002 > *Non-Boolean comparisons should use a compare operator (=3D=3D, !=3D, >= , < >=3D, <=3D) > *file: D:\AllPkg\edk2\SecurityPkg\Tcg\Tcg2Pei\Tcg2Pei.c > *Line number: 459 > *Predicate Expression: Flags & EDKII_TCG_PRE_HASH EFI coding style erro= r > *Error code: 4002 > *Function header doesn't exist > *file: > D:\AllPkg\edk2\IntelFsp2WrapperPkg\Library\BaseFspMeasurementLib\FspMe > asurementLib.c > *Line number: 279 > *Function [mFspFindFspHeader] has NO comment immediately preceding it. > EFI coding style error > *Error code: 8005 > *Variable name does not follow the rules: 1. First character should=20 > be upper case 2. Must contain lower case characters 3. No white space cha= racters 4. > Global variable name must start with a 'g' > *file: > D:\AllPkg\edk2\IntelFsp2WrapperPkg\Library\BaseFspMeasurementLib\FspMe > asurementLib.c > *Line number: 178 > *The variable name [*UPDEventLo] does not follow the rules EFI=20 > coding style error > *Error code: 8006 > *Function name does not follow the rules: 1. First character should=20 > be upper case 2. Must contain lower case characters 3. No white space cha= racters > *file: > D:\AllPkg\edk2\IntelFsp2WrapperPkg\Library\BaseFspMeasurementLib\FspMe > asurementLib.c > *Line number: 279 > *The function name [mFspFindFspHeader] does not follow the rules EFI=20 > coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\IntelFsp2WrapperPkg\Library\BaseFspMeasurementLib\FspMe > asurementLib.c > *Line number: 149 > *Comment does NOT have tail **/ > EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\IntelFsp2WrapperPkg\Library\BaseFspMeasurementLib\FspMe > asurementLib.c > *Line number: 312 > *Comment does NOT have tail **/ > EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\SecurityPkg\Library\PeiTpmMeasurementLib\EventLogRecord.c > *Line number: 86 > *Comment does NOT have tail **/ > EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\SecurityPkg\Library\PeiTpmMeasurementLib\EventLogRecord.c > *Line number: 155 > *Comment does NOT have tail **/ > EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\SecurityPkg\Library\DxeTpmMeasurementLib\EventLogRecord. > c > *Line number: 86 > *Comment does NOT have tail **/ > EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\SecurityPkg\Library\DxeTpmMeasurementLib\EventLogRecord. > c > *Line number: 155 > *Comment does NOT have tail **/ > EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\MdeModulePkg\Library\TpmMeasurementLibNull\TpmMeasur > ementLibNull.c > *Line number: 43 > *Comment does NOT have tail **/ > EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\MdeModulePkg\Library\TpmMeasurementLibNull\TpmMeasur > ementLibNull.c > *Line number: 43 > *in Comment, <@param[in] Descrption> does NOT consistent with=20 > parameter name PcrIndex EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\MdeModulePkg\Library\TpmMeasurementLibNull\TpmMeasur > ementLibNull.c > *Line number: 43 > *in Comment, <@param[in] FirmwareBlobBase> does NOT consistent with=20 > parameter name Description EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\MdeModulePkg\Library\TpmMeasurementLibNull\TpmMeasur > ementLibNull.c > *Line number: 43 > *in Comment, <@param[in] FirmwareBlobLength> does NOT consistent=20 > with parameter name FirmwareBlobBase EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\MdeModulePkg\Library\TpmMeasurementLibNull\TpmMeasur > ementLibNull.c > *Line number: 43 > *in Comment, <@retval EFI_SUCCESS> does NOT consistent with=20 > parameter name FirmwareBlobLength EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation=20 > blocks in section 2.3.5 > *file: > D:\AllPkg\edk2\MdeModulePkg\Library\TpmMeasurementLibNull\TpmMeasur > ementLibNull.c > *Line number: 70 > *Comment does NOT have tail **/ >=20 > Thanks > Liming > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Qi=20 > Zhang > Sent: 2020=1B$BG/=1B(B8=1B$B7n=1B(B6=1B$BF|=1B(B 8:34 > To: devel@edk2.groups.io > Cc: Zhang, Qi1 ; Yao, Jiewen=20 > ; Wang, Jian J ; Kumar,=20 > Rahul1 > Subject: [edk2-devel] [PATCH v2 9/9] SecurityPkg/Tcg2: handle PRE HASH=20 > and LOG ONLY >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2376 >=20 > Cc: Jiewen Yao > Cc: Jian J Wang > Cc: Qi Zhang > Cc: Rahul Kumar > Signed-off-by: Qi Zhang > --- > SecurityPkg/Include/Ppi/Tcg.h | 5 +++++ > SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 12 +++++++----- > 2 files changed, 12 insertions(+), 5 deletions(-) >=20 > diff --git a/SecurityPkg/Include/Ppi/Tcg.h=20 > b/SecurityPkg/Include/Ppi/Tcg.h index > 0e943f2465..22f47f9817 100644 > --- a/SecurityPkg/Include/Ppi/Tcg.h > +++ b/SecurityPkg/Include/Ppi/Tcg.h > @@ -18,6 +18,11 @@ typedef struct _EDKII_TCG_PPI EDKII_TCG_PPI; //=20 > #define EDKII_TCG_PRE_HASH 0x0000000000000001 +//+// This bit is=20 > shall be set when HashData is the pre-hash digest and log only.+//+#defin= e > EDKII_TCG_PRE_HASH_LOG_ONLY 0x0000000000000002+ /** Tpm measure > and log data, and extend the measurement result into a specific PCR.=20 > diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c=20 > b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c > index 246968bb7f..b56b03746c 100644 > --- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c > +++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c > @@ -453,13 +453,15 @@ HashLogExtendEvent ( > return EFI_DEVICE_ERROR; } - if(Flags & EDKII_TCG_PRE_HASH) {+ i= f > ((Flags & EDKII_TCG_PRE_HASH) || (Flags & EDKII_TCG_PRE_HASH_LOG_ONLY)) > { ZeroMem (&DigestList, sizeof(DigestList)); CopyMem (&DigestList= , > HashData, sizeof(DigestList));- Status =3D Tpm2PcrExtend (- = 0,- > &DigestList- );+ if (Flags & EDKII_TCG_PRE_HASH) {+ S= tatus =3D > Tpm2PcrExtend (+ NewEventHdr->PCRIndex,+ > &DigestList+ );+ } } else { Status =3D HashAndExte= nd > ( NewEventHdr->PCRIndex,-- > 2.26.2.windows.1 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. >=20 > View/Reply Online (#63760):=20 > https://edk2.groups.io/g/devel/message/63760 > Mute This Topic: https://groups.io/mt/76019593/1759384 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub =20 > [liming.gao@intel.com] -=3D- =3D-=3D-=3D-=3D-=3D