From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.5773.1597107232454386541 for ; Mon, 10 Aug 2020 17:53:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=BtrQKt+5; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: qi1.zhang@intel.com) IronPort-SDR: KUBS06YpeuSw8/Zfr/CvcC+LamRJey2J498raDesjbWDpL4h8dXqO7V226niiWBf/lglgEiQPr QySdhV7JyC4w== X-IronPort-AV: E=McAfee;i="6000,8403,9709"; a="238474098" X-IronPort-AV: E=Sophos;i="5.75,458,1589266800"; d="scan'208";a="238474098" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2020 17:53:51 -0700 IronPort-SDR: 9rjBp86rykBkyov9Z8vKUMkQyhzxi/uQK48x3kaT12eRxh1u49Bn1N3Kf0URpmn4frfy5ZIEi+ wDz7H9EivPDA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,458,1589266800"; d="scan'208";a="277434750" Received: from orsmsx602-2.jf.intel.com (HELO ORSMSX602.amr.corp.intel.com) ([10.22.229.82]) by fmsmga008.fm.intel.com with ESMTP; 10 Aug 2020 17:53:51 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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 17:53:50 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx602.amr.corp.intel.com (10.22.229.15) 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 17:53:50 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.47) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 10 Aug 2020 17:53:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hlSoaC/H6N8FY2hERe4U7fNhgBv7hIl2F81GMtuWL8cRQv8UJyHcl+QOaE1szrLgjmjhkPJTyaabb8tUhqDt1/uw/jw9r3JyUuBinhBnkUMKrGgUjVt/PJKzUJQwEpq5uZ9EgPL6Gtabov1VPdEL3ilFUd15MJplCmTdJ6HHn4GFlGT8x9yqbxaNF5U8mEIbNtxSo0oJWkq8AFYxwR0ZXF5s6PmAKc4lDW+JlTTzC++ZUiSrtZ2m4lIhjRSupZk1qL6x/mpjDQCy07tlVJGDuLGylDej4+Wyoi4IL7xjGXfUt28ufHAyk3bLbXVqOOgA+QTSsEtsH50Nq6rhSov7xw== 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=DaF3DKHIz0w0YoQH6o4LMU6DUN+DlX9b6Q6MKjwWPRQ=; b=Vru1y/KlqLbYyk6ekKcM9nIjwqxxzcV2A4/1n18YWhTy5OZYyP4K0kRQHQ0FuveTDsc1tgVvQfDGipmwZod+ayPLabZ9DFRKA19Kv8bEGv4l+D0qvc/Fl6gSqWicupkfv7kRoEmB8Ba/BNlgUQzwCmjbKd1RDEn2ZBsXC/6+Gm190Ci62ATnpXpynwE+WqMemtBuF0d1g1OtOQmSwttio4/LShsBklBjQXuJ5mdEIinMi7GnOb8MfMO3JUNEjFIVON8BMymAnlH9PTnLtkJLLbGu+0PzEyI4OygtN6zlwtwcQ1KbKJ0+bksZwGJ9lkzbnicrw2G2yHyhOASOw5INew== 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=DaF3DKHIz0w0YoQH6o4LMU6DUN+DlX9b6Q6MKjwWPRQ=; b=BtrQKt+57A4GsxbrhJVxspAw0y+3fklKfUnvFjwhcXkyOlO6nS7sv57d9Su/nlVYXdUg5el4KHWAOMCzx7EEBIFzxx78RZ83frPNF+zmaDOS8hzgs2ZuG4b+FWTRfpWT90f64Bsy59N5rNz1xgMNQTNgAdBDqPzN5Ph0r4iWgJg= Received: from SN6PR11MB2797.namprd11.prod.outlook.com (2603:10b6:805:5a::32) by SN6PR11MB2973.namprd11.prod.outlook.com (2603:10b6:805:ce::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16; Tue, 11 Aug 2020 00:53:43 +0000 Received: from SN6PR11MB2797.namprd11.prod.outlook.com ([fe80::299e:89:dbe4:7e79]) by SN6PR11MB2797.namprd11.prod.outlook.com ([fe80::299e:89:dbe4:7e79%7]) with mapi id 15.20.3261.024; Tue, 11 Aug 2020 00:53:43 +0000 From: "Qi Zhang" 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 Thread-Topic: [edk2-devel] [PATCH v2 9/9] SecurityPkg/Tcg2: handle PRE HASH and LOG ONLY Thread-Index: AQHWa4lTFT+M3m5BPUKByn+PGgwneKkyEvcAgAAJO/A= Date: Tue, 11 Aug 2020 00:53:42 +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.221] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ef14df37-df26-4715-e0db-08d83d90feb4 x-ms-traffictypediagnostic: SN6PR11MB2973: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iouyuVtyo3QTSLONiJ8m05uEMwSsjZtE+nvrimSk7EGWL8LeiCS5RDsSDODHqXymgDh0x5GJN9lB41qZimzQthzQ6jshY6+PAKbydfNfxubRWxgbQr3jA7O0f5wCrGmoz4y+UUB0+WIpM1pe7SA3UVKYDQvxQX5EyoJpUNxUHy9uB4zBA9mC36tBV3d/NLp8sduxNFMd8bS1HI8iTOkWzNNwrTPah/WD8iiBaTQmyL6hRgzm4zaMBm6FTkshxBz1zAuqe9P/A1ZFXH35Pw7bU+6MBgYe/tUUyFzQ6uBSqIAKJOxG3xw3u9sdqkL12ap9Pj1CJ5yS2Tbdlya25v1Xi0l3z9SE4HRmh42po2Gh0zr3t23cwodQsuPbr047KRp+EW6nPF4lhYy3r9bJd8lvdg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB2797.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(346002)(39860400002)(376002)(366004)(136003)(396003)(2906002)(966005)(15650500001)(33656002)(83380400001)(52536014)(55016002)(9686003)(71200400001)(53546011)(8936002)(8676002)(478600001)(6506007)(26005)(7696005)(107886003)(66446008)(64756008)(76116006)(86362001)(66556008)(66946007)(66476007)(5660300002)(186003)(4326008)(19627235002)(54906003)(110136005)(316002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: 17dqwSredEyyJdF6cSzhYpgjjf5SVJ67JYh+uxSIUHujv+ja50cZOgetr10kiLnKKfZrwdhBdfHI/Tclfz5DVZutrIT1+guSSpgIXjPllnCND0bJCvGwc3Gj7NwH84z6R935IOlLD1Z5hZSzJlQpvyYzK8wm5oF6n1MiXtLRhhxrW6EqLygnlKFzBH2Vw0DkukOLgrEKuJGZqHlcKs4CHtJBgK2QqR9x2PJleI5mTCbrcjCL68Cir4zdIFzLWAM5kGCP33GsBX2AI7uzhPN2+/eoecNo8OmCOUyT27tRLVNaLmC3Cbsq33AmhkOoCHrxSt9EKQYv1psugGPPEKhqBuexeHwxfuWqV848NMrskeM4ojgaRJSpYwf7Js1xNNmxJQiKAw9kkz19yjsWWBUwusW+BoABDWJF9JStA8hqP/mk9iIig7w/xdqgU0HYKNi9jGHU+cTaFB5V4vY9FYrbb5OvTfYgyEXsa3JyKgSUknSHVoAjM3GnbPTqUCmOYJmn78Cfn13RZAFeblRsRe88rg8cz81uE4t1dtXSFECSMFZ9V5KDGz0ydd5H7EfDJm5DD5rqxVTIbysCNw5SsrZ58ly67M8lfdEejnSsiK30mdYGS4a8X7Krp9lqBUI/rlYDxh8toFVwZryGvWz1NpCQBA== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2797.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef14df37-df26-4715-e0db-08d83d90feb4 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Aug 2020 00:53:42.9487 (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: NDXOCieR+p9vDxnLBDw8/m5WYF8O5j13rKTeqP3SrJ6g317SuO97vF2sz38Il3VM5Rtd8ZVlS89Hco4njsy3Tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2973 Return-Path: qi1.zhang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable 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 > ; Kumar, Rahul1 > Subject: RE: [edk2-devel] [PATCH v2 9/9] SecurityPkg/Tcg2: handle PRE HAS= H > and LOG ONLY >=20 > Qi: > I run ECC plugin (https://edk2.groups.io/g/devel/message/63271) for thi= s > patch set. It reports below issues. Can you help update the patches to fi= x 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 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 be = upper > case 2. Must contain lower case characters 3. No white space characters 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 coding s= tyle > error > *Error code: 8006 > *Function name does not follow the rules: 1. First character should be = upper > case 2. Must contain lower case characters 3. No white space characters > *file: > D:\AllPkg\edk2\IntelFsp2WrapperPkg\Library\BaseFspMeasurementLib\FspMe > asurementLib.c > *Line number: 279 > *The function name [mFspFindFspHeader] does not follow the rules EFI co= ding > style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation block= s 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 block= s 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 block= s 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 block= s 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 block= s 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 block= s 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 block= s 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 block= s 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 parameter > name PcrIndex EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation block= s 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 > parameter name Description EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation block= s 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 with > parameter name FirmwareBlobBase EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation block= s 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 parameter > name FirmwareBlobLength EFI coding style error > *Error code: 9002 > *The function headers should follow Doxygen special documentation block= s 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 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 ; > Wang, Jian J ; Kumar, Rahul1 > > Subject: [edk2-devel] [PATCH v2 9/9] SecurityPkg/Tcg2: handle PRE HASH an= d > 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 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; > // #define EDKII_TCG_PRE_HASH 0x0000000000000001 +//+// This bit is sha= ll > be set when HashData is the pre-hash digest and log only.+//+#define > EDKII_TCG_PRE_HASH_LOG_ONLY 0x0000000000000002+ /** Tpm measure > and log data, and extend the measurement result into a specific PCR. diff= --git > a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c 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): 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 [liming.gao@intel.com]= -=3D- > =3D-=3D-=3D-=3D-=3D