From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.136]) by mx.groups.io with SMTP id smtpd.web10.1156.1594792391435161285 for ; Tue, 14 Jul 2020 22:53:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=D8Xga4F6; spf=pass (domain: microsoft.com, ip: 40.107.93.136, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oTui2mmgbZzUyvdQc7HffpCUaPxs5CR8229WEEN89ws/u9qTaW6Vmzy0HjTnGWuSwUaVFZi3tsvfcDe/WhrypKbpvAeTs3PMOJpgMTsNeTUA2egFnzozBydtSdhRofPpaUx25BPgjVrm9F25wLR8xTyz/keUBX0vBwZpvsy1KaXF+e1wLOc8VTj5FGX8TvhzlDvqwMT84QZK7kAKFf45nmpz6nRgyLRZhpwHGVaDn7lzs4+3XkWRlT9t2LIv+Dm9O5pzagzeoJ3K5nYB7mJ9x+fM9aF14NDZ8JO7SH/cwDbMrn+5fTdSQSuIEEyRb5+2z3+aKUmZBeKVPZZI0X6HNg== 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=tKDjsuL1nuQdM2sX1cNwNUWhstxHnX4QzY9sAy4W8wQ=; b=DTk30YjT6S4Y6OygGkibQZaFjdClPjysiVWCPQjJTVJfMoGZXlzgdQg3ubA9XH++7ajrVoSTpPWUBAx5rA/AHVxWJqvS9/3rO7BW4WFCqLHH9NlfQHaDjGjL2tUGbbpM0sU/8pqK3LRE50v12o+xtdqkVROaQPxOdXT+CFYnWI/OdZ6qSj5FuZvISqZREdMAzccIwLvlkXOUUppev6N8H/4dfOXqOHajkWWC62dZQhFtP6ZNw7TYHt35Fqceq3dJz3E7ZsRYGJOo/RYBimfSrq7UOXNKy4RKXC+fxHqtpoaEGDKtRvmE6OKTRlPshVzAfulrOXEzr2XWrpF/Wu20GA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tKDjsuL1nuQdM2sX1cNwNUWhstxHnX4QzY9sAy4W8wQ=; b=D8Xga4F6J++9QNcZWdNyyWyJJBsQUDCtcDnbqJex0HwckWhwlEh7Iu5aoWRB+Pt5wLuTwdvmLu37Amx40z7nc0QNpzbnSPieFrkmgMcI8u3mZxK71b+2Hwp3CXMroVNNXp9TnkOrN5tgC/7/0Irs7BtuQfJbKlQ/ld0XX4SXicI= Received: from CY4PR21MB0743.namprd21.prod.outlook.com (2603:10b6:903:b2::9) by CY4PR21MB0181.namprd21.prod.outlook.com (2603:10b6:903:ba::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.7; Wed, 15 Jul 2020 05:53:09 +0000 Received: from CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::f112:82fb:d4fd:f7dd]) by CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::f112:82fb:d4fd:f7dd%10]) with mapi id 15.20.3216.008; Wed, 15 Jul 2020 05:53:09 +0000 From: "Bret Barkelew" To: "devel@edk2.groups.io" , "Yao, Jiewen" , "Zhang, Qi1" CC: "Wang, Jian J" Subject: Re: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file. Thread-Topic: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file. Thread-Index: AQHWWmYAxetJOuwOX0KyQ1AKacXqKakIIxJN Date: Wed, 15 Jul 2020 05:53:09 +0000 Message-ID: References: <20200714064922.7025-1-qi1.zhang@intel.com> <20200714064922.7025-2-qi1.zhang@intel.com>, In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-07-15T05:51:07.2935575Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2600:387:6:80f::85] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 734f267f-3dbf-4f85-22ff-08d828835a3c x-ms-traffictypediagnostic: CY4PR21MB0181: x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oG9ayufBcKtDbe+kkEh7q3QSIcty62+vWX67bzlDJ7P7sHE7OHwLmhILnfKWtLg5m+HasF1ValyA2oW2XBb9buGfHGHA8sNN6RaSPNncNhVSHputjTSX+WLeK1KV1Ev05vGoKZpeBpmxle9gA35L8X5Rk6P9vyeRpLFcRSINQ5GA6mOstMQshwEUVbU7tTJhYHX5uJM1AMRst5xR1wz5zWgKDxmz+wqcUqSp94ZtxbDuPDiJ7Dvpp/a1S3g8wBOON230IaKHtmJZMaKX2FvbeMgfvq+I0MphesOX4/3az5RHuCkoXlKHP1zvY3S7ksBNQcmfIxRNTMnUJIQZ14cr56oRFFpCkUWrULvl1gORBgWrS2ocrclHtq8YJo8hMIzhtSmqCi1nU9aITXWXqnK9Wg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR21MB0743.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(376002)(346002)(396003)(39860400002)(136003)(366004)(15650500001)(316002)(478600001)(71200400001)(10290500003)(55016002)(86362001)(82960400001)(966005)(82950400001)(66446008)(8936002)(5660300002)(166002)(83380400001)(110136005)(52536014)(4326008)(53546011)(7696005)(64756008)(76116006)(66556008)(2906002)(66476007)(33656002)(186003)(6506007)(8990500004)(8676002)(66946007)(9686003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: G5FEjY4JUhqENfjIaV7iVRdfoDgbix4f4N7XVqCKFl+1FMHCG/QgnZNZuCb4t5XnOYpLX1448iTRAigkHetY1o4BncwuEu+40uLOZ8HEA71QPqsXPqrw77SumlvCYbVjP8CZzU3YagRpZsY6WTxes6tQhei3plrGDZHmW9lvbvn8Sp41O2vQhjubiA7tbNKPLsPUaugVxm2pKuc4i3uA1m8zoKsPS+XH31SxCraFYF0VWy5FuP75wXGljNtU48IeA/eAFOi8gYL4LmHNmUpA6EUeNKHuCwG35e+cFUH027VpOy2mvE4jgw9G7Qw6Iwa64/Mjky/zlQXPzrpHyExab0gMm16gsqGsETXvZ4qcLJGSHjy1RC8tsNY+ZeDPF7Of8N5fs+32wj5X8Zy7VxbjbK6eWSTh8XbJhxLo9xgprdG+XF7sTBvUp1ryHp/GaejMGT5xoiZPbu+ugEWb8lUa4q1RVoA3A/ZtiMytZVNgiZWpSUzl36QXpZDI8TY4aVgJ x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR21MB0743.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 734f267f-3dbf-4f85-22ff-08d828835a3c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jul 2020 05:53:09.1173 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9mqMP68T3L8/Xf3bxd5Fj4TIzDbFX0sEZuSrU25D1y/dJBEnjFEclnGLqYFqJWqbM0EXqFkKkt2Y5FwzHNj9Sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0181 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR21MB0743B270ED37C33DAC03C868EF7E0CY4PR21MB0743namp_" --_000_CY4PR21MB0743B270ED37C33DAC03C868EF7E0CY4PR21MB0743namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Since we=92re working on early boot TCG interfaces, is this a good time to = discuss a standard way to init the log with measurements made by the HW roo= t of trust prior to Tcg2Pei? We were using a NULL lib and a registration pa= ttern on the PEIM, but I=92m open to other ideas, too. Thoughts? - Bret ________________________________ From: devel@edk2.groups.io on behalf of Yao, Jiewen= via groups.io Sent: Tuesday, July 14, 2020 10:08:30 PM To: Zhang, Qi1 ; devel@edk2.groups.io Cc: Wang, Jian J Subject: [EXTERNAL] Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add T= cgPpi header file. Thanks Qi. I just thought one use case that a PEIM may already have a calculated hash= (https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgith= ub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FSecurityPkg%2FTcg%2FTcg2Pei%2FT= cg2Pei.c%23L652&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7Cbe2bb9= ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637= 303865193113145&sdata=3DV3ofX%2Fvs6Pp%2Bc79cQx4iSB6K324Lyptqrj7FtvmDwsc= %3D&reserved=3D0) We may need add a flag to support this pre-hash use case. Such as: > +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)( > > + IN EDKII_TCG_PPI *This, > > + IN UINT64 Flags, // new field. BIT0 =3D 0 mea= ns HashData is the data to be hashed; BIT0 =3D 1 means HashData is the pre-= hash digest. > > + IN UINT8 *HashData, > > + IN UINTN HashDataLen, > > + IN TCG_PCR_EVENT_HDR *NewEventHdr, > > + IN UINT8 *NewEventData > > + ); > -----Original Message----- > From: Zhang, Qi1 > Sent: Tuesday, July 14, 2020 2:49 PM > To: devel@edk2.groups.io > Cc: Yao, Jiewen ; Wang, Jian J ; > Zhang, Chao B > Subject: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file. > > From: Jiewen Yao > > REF: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2= Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2841&data=3D02%7C01%7CBre= t.Barkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f= 141af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&sdata=3DVgWc2LNPqJRl= Bisa%2Bvuqq2THVK62f66uzzqh4cle4Rs%3D&reserved=3D0 > > Cc: Jiewen Yao > Cc: Jian J Wang > Cc: Chao Zhang > Signed-off-by: Jiewen Yao > --- > SecurityPkg/Include/Ppi/Tcg.h | 50 +++++++++++++++++++++++++++++++++++ > 1 file changed, 50 insertions(+) > create mode 100644 SecurityPkg/Include/Ppi/Tcg.h > > diff --git a/SecurityPkg/Include/Ppi/Tcg.h b/SecurityPkg/Include/Ppi/Tcg= .h > new file mode 100644 > index 0000000000..4eacd57166 > --- /dev/null > +++ b/SecurityPkg/Include/Ppi/Tcg.h > @@ -0,0 +1,50 @@ > +/** @file > > + TCG PPI services. > > + > > +Copyright (c) 2020, Intel Corporation. All rights reserved.
> > +SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > + > > +#ifndef _TCG_PPI_H_ > > +#define _TCG_PPI_H_ > > + > > +#include > > + > > +typedef struct _EDKII_TCG_PPI EDKII_TCG_PPI; > > + > > +/** > > + Tpm measure and log data, and extend the measurement result into a sp= ecific > PCR. > > + > > + @param[in] This Indicates the calling context > > + @param[in] HashData Physical address of the start of the da= ta buffer > > + to be hashed, extended, and logged. > > + @param[in] HashDataLen The length, in bytes, of the buffer ref= erenced by > HashData. > > + @param[in] NewEventHdr Pointer to a TCG_PCR_EVENT_HDR data > structure. > > + @param[in] NewEventData Pointer to the new event data. > > + > > + @retval EFI_SUCCESS Operation completed successfully. > > + @retval EFI_UNSUPPORTED TPM device not available. > > + @retval EFI_OUT_OF_RESOURCES Out of memory. > > + @retval EFI_DEVICE_ERROR The operation was unsuccessful. > > +**/ > > +typedef > > +EFI_STATUS > > +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)( > > + IN EDKII_TCG_PPI *This, > > + IN UINT8 *HashData, > > + IN UINTN HashDataLen, > > + IN TCG_PCR_EVENT_HDR *NewEventHdr, > > + IN UINT8 *NewEventData > > + ); > > + > > +/// > > +/// The EFI_TCG Protocol abstracts TCG activity. > > +/// > > +struct _EDKII_TCG_PPI { > > + EDKII_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent; > > +}; > > + > > +extern EFI_GUID gEdkiiTcgPpiGuid; > > + > > +#endif > > -- > 2.26.2.windows.1 --_000_CY4PR21MB0743B270ED37C33DAC03C868EF7E0CY4PR21MB0743namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Since we=92re working on early boot TCG int= erfaces, is this a good time to discuss a standard way to init the log with= measurements made by the HW root of trust prior to Tcg2Pei? We were using = a NULL lib and a registration pattern on the PEIM, but I=92m open to other ideas, too. Thoughts?

- Bret

From: devel@edk2.groups.io= <devel@edk2.groups.io> on behalf of Yao, Jiewen via groups.io <ji= ewen.yao=3Dintel.com@groups.io>
Sent: Tuesday, July 14, 2020 10:08:30 PM
To: Zhang, Qi1 <qi1.zhang@intel.com>; devel@edk2.groups.io &l= t;devel@edk2.groups.io>
Cc: Wang, Jian J <jian.j.wang@intel.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi= : Add TcgPpi header file.
 
Thanks Qi.

I just thought one use case that a PEIM may already have a calculated hash=   (https://nam06.safelinks.p= rotection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2F= blob%2Fmaster%2FSecurityPkg%2FTcg%2FTcg2Pei%2FTcg2Pei.c%23L652&amp;data= = =3D02%7C01%7CBret.Barkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d2= 1ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&amp= ;sdata=3DV3ofX%2Fvs6Pp%2Bc79cQx4iSB6K324Lyptqrj7FtvmDwsc%3D&amp;reserve= d=3D0)
We may need add a flag to support this pre-hash use case. Such as:

> +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)(
>
> +  IN      EDKII_TCG_PPI  &nb= sp;          *This,
>
> +  IN      UINT64   &nbs= p;            &= nbsp;  Flags,  // new field. BIT0 =3D 0 means HashData is the dat= a to be hashed; BIT0 =3D 1 means HashData is the pre-hash digest.
>
> +  IN      UINT8    = ;            &n= bsp;    *HashData,
>
> +  IN      UINTN    = ;            &n= bsp;    HashDataLen,
>
> +  IN      TCG_PCR_EVENT_HDR  = ;       *NewEventHdr,
>
> +  IN      UINT8    = ;            &n= bsp;    *NewEventData
>
> +  );

> -----Original Message-----
> From: Zhang, Qi1 <qi1.zhang@intel.com>
> Sent: Tuesday, July 14, 2020 2:49 PM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j= .wang@intel.com>;
> Zhang, Chao B <chao.b.zhang@intel.com>
> Subject: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.
>
> From: Jiewen Yao <jiewen.yao@intel.com>
>
> REF: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzil= la.tianocore.org%2Fshow_bug.cgi%3Fid%3D2841&amp;data=3D02%7C01%7CBret.B= arkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&amp;sdata=3DVgWc2LNPqJR= lBisa%2Bvuqq2THVK62f66uzzqh4cle4Rs%3D&amp;reserved=3D0
>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Chao Zhang <chao.b.zhang@intel.com>
> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
> ---
>  SecurityPkg/Include/Ppi/Tcg.h | 50 ++++++++++++++++++++++++++++= +++++++
>  1 file changed, 50 insertions(+)
>  create mode 100644 SecurityPkg/Include/Ppi/Tcg.h
>
> diff --git a/SecurityPkg/Include/Ppi/Tcg.h b/SecurityPkg/Include/Ppi/= Tcg.h
> new file mode 100644
> index 0000000000..4eacd57166
> --- /dev/null
> +++ b/SecurityPkg/Include/Ppi/Tcg.h
> @@ -0,0 +1,50 @@
> +/** @file
>
> +  TCG PPI services.
>
> +
>
> +Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>= ;
>
> +SPDX-License-Identifier: BSD-2-Clause-Patent
>
> +
>
> +**/
>
> +
>
> +#ifndef _TCG_PPI_H_
>
> +#define _TCG_PPI_H_
>
> +
>
> +#include <IndustryStandard/UefiTcgPlatform.h>
>
> +
>
> +typedef struct _EDKII_TCG_PPI EDKII_TCG_PPI;
>
> +
>
> +/**
>
> +  Tpm measure and log data, and extend the measurement result i= nto a specific
> PCR.
>
> +
>
> +  @param[in]      This  &nbs= p;       Indicates the calling context
>
> +  @param[in]      HashData  =     Physical address of the start of the data buffer
>
> +           &n= bsp;            = ;        to be hashed, extended, and log= ged.
>
> +  @param[in]      HashDataLen &nb= sp; The length, in bytes, of the buffer referenced by
> HashData.
>
> +  @param[in]      NewEventHdr &nb= sp; Pointer to a TCG_PCR_EVENT_HDR data
> structure.
>
> +  @param[in]      NewEventData  P= ointer to the new event data.
>
> +
>
> +  @retval EFI_SUCCESS       =     Operation completed successfully.
>
> +  @retval EFI_UNSUPPORTED       T= PM device not available.
>
> +  @retval EFI_OUT_OF_RESOURCES  Out of memory.
>
> +  @retval EFI_DEVICE_ERROR      The op= eration was unsuccessful.
>
> +**/
>
> +typedef
>
> +EFI_STATUS
>
> +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)(
>
> +  IN      EDKII_TCG_PPI  &nb= sp;          *This,
>
> +  IN      UINT8    = ;            &n= bsp;    *HashData,
>
> +  IN      UINTN    = ;            &n= bsp;    HashDataLen,
>
> +  IN      TCG_PCR_EVENT_HDR  = ;       *NewEventHdr,
>
> +  IN      UINT8    = ;            &n= bsp;    *NewEventData
>
> +  );
>
> +
>
> +///
>
> +/// The EFI_TCG Protocol abstracts TCG activity.
>
> +///
>
> +struct _EDKII_TCG_PPI {
>
> +  EDKII_TCG_HASH_LOG_EXTEND_EVENT     HashL= ogExtendEvent;
>
> +};
>
> +
>
> +extern EFI_GUID gEdkiiTcgPpiGuid;
>
> +
>
> +#endif
>
> --
> 2.26.2.windows.1




--_000_CY4PR21MB0743B270ED37C33DAC03C868EF7E0CY4PR21MB0743namp_--