From nobody Sat May 18 21:26:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105393+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105393+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1685380016; cv=none; d=zohomail.com; s=zohoarc; b=PvgoI7qB2GMYbUkPaRsiJNKH9p/Qd0o3mRuBpmOp1NBAziJt4CWAtOGTUqtupvKLcEsCJBVj3ycdmuL/lmuCbq8zT7TIvDnWxEvF20RR1VdbGvdpHJ1WuG+A08nuixZxuL3ulSsR766XS2lxsD9WBMsYN0bS2qEUpafHOU+aIts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685380016; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=bk7k4HN7vy+OFGWkJlzdx20KuEi3NL08oAx8J1ExzxE=; b=hacmmKf7SRtU81IHDULo6lCrJ6Xk12Lo4o8YeQZ1kyV5WBJKF+VtNG7ywZaW7DNTH0S3fvlEjLLgbgG3hSG2cTmJZ32LyIVayrPnGgw0ozerBC9XeJwJqrn2VYnRs9MbP6TQIho+zk2gRWxCF8toBmH4q52FpL+ANycuLCI9R3s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105393+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1685380016552424.9631904522071; Mon, 29 May 2023 10:06:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1hLnYY1788612xRAHXQZrboh; Mon, 29 May 2023 10:06:56 -0700 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.54443.1685380014980465657 for ; Mon, 29 May 2023 10:06:55 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10725"; a="352246059" X-IronPort-AV: E=Sophos;i="6.00,201,1681196400"; d="scan'208";a="352246059" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2023 10:06:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10725"; a="709350935" X-IronPort-AV: E=Sophos;i="6.00,201,1681196400"; d="scan'208";a="709350935" X-Received: from mdkinney-mobl.amr.corp.intel.com ([10.209.9.14]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2023 10:06:53 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Liming Gao , Zhiguang Liu , Oliver Smith-Denny , Pedro Falcato , Aaron Pop Subject: [edk2-devel] [Patch 1/2] MdePkg/Include/IndustryStandard: Address C++ keyword collisions Date: Mon, 29 May 2023 10:06:48 -0700 Message-Id: <20230529170649.1506-2-michael.d.kinney@intel.com> In-Reply-To: <20230529170649.1506-1-michael.d.kinney@intel.com> References: <20230529170649.1506-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com X-Gm-Message-State: dSouVm5zx6j5wLYbrJ3FpjK0x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1685380016; bh=PPorLeVE3fjg7Dz6BVouuvu2hH4/XYPuHxNQLOZZfgI=; h=Cc:Date:From:Reply-To:Subject:To; b=aRtRjdEb1SantFYADikX6HLLg+vtBjMkHuAvBobIfs4TYD9qha2/Hvn7QFqo1iQo1+L 8lf5Z9/shzRSPl//9lKJf6wfUV3OE98Ow4UOpqdJURZ4zp9MH8HInx6lWBZjapc556AWH E83EPnHtMYhx2ocHz7GUu4V1Uym11gnmSUE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1685380017376100005 Content-Type: text/plain; charset="utf-8" Update Tpm12.h and Tpm20.h and not use c++ reserved keywords operator and xor in C structures to support use of these include files when building with a C++ compiler. * Change operator -> Operator * Change xor -> Xor NOTE: This is a non-backwards compatible change to Tpm12.h and Tmp20.h. And consumers of these include files that access the "operator" or "xor" fields must be updated. Cc: Liming Gao Cc: Zhiguang Liu Cc: Oliver Smith-Denny Cc: Pedro Falcato Cc: Aaron Pop Signed-off-by: Michael D Kinney Reviewed-by: Jiewen Yao Reviewed-by: Oliver Smith-Denny Reviewed-by: Pedro Falcato --- MdePkg/Include/IndustryStandard/Tpm12.h | 4 ++-- MdePkg/Include/IndustryStandard/Tpm20.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MdePkg/Include/IndustryStandard/Tpm12.h b/MdePkg/Include/Indus= tryStandard/Tpm12.h index 155dcc9f5f99..147c0863fffd 100644 --- a/MdePkg/Include/IndustryStandard/Tpm12.h +++ b/MdePkg/Include/IndustryStandard/Tpm12.h @@ -744,8 +744,8 @@ typedef struct tdTPM_PERMANENT_FLAGS { BOOLEAN TPMpost; BOOLEAN TPMpostLock; BOOLEAN FIPS; - BOOLEAN operator; - BOOLEAN enableRevokeEK; + BOOLEAN Operator; + BOOLEAN enableRevokeEK; BOOLEAN nvLocked; BOOLEAN readSRKPub; BOOLEAN tpmEstablished; diff --git a/MdePkg/Include/IndustryStandard/Tpm20.h b/MdePkg/Include/Indus= tryStandard/Tpm20.h index 4440f3769f26..c827af13efd0 100644 --- a/MdePkg/Include/IndustryStandard/Tpm20.h +++ b/MdePkg/Include/IndustryStandard/Tpm20.h @@ -1247,7 +1247,7 @@ typedef union { TPMI_AES_KEY_BITS aes; TPMI_SM4_KEY_BITS SM4; TPM_KEY_BITS sym; - TPMI_ALG_HASH xor; + TPMI_ALG_HASH Xor; } TPMU_SYM_KEY_BITS; =20 // Table 123 - TPMU_SYM_MODE Union @@ -1320,7 +1320,7 @@ typedef struct { // Table 136 - TPMU_SCHEME_KEYEDHASH Union typedef union { TPMS_SCHEME_HMAC hmac; - TPMS_SCHEME_XOR xor; + TPMS_SCHEME_XOR Xor; } TPMU_SCHEME_KEYEDHASH; =20 // Table 137 - TPMT_KEYEDHASH_SCHEME Structure --=20 2.40.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105393): https://edk2.groups.io/g/devel/message/105393 Mute This Topic: https://groups.io/mt/99204100/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 18 21:26:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105394+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105394+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1685380016; cv=none; d=zohomail.com; s=zohoarc; b=SGxaQsmUoi+xIM71PcO5P6cH8ypRSo+STvp0TlSpIRNHlkL6EyJ3VLgJlnafyhzCL6iQDyKqB9/8vNldSyYjbXDBab8DfMTAJofwVtPxzy2Pnb22nFw8xCv5wBS6TN/afYL0pCpmJM4TZ76b7z67qTuMypqsW2DYLzz+zEzsC74= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685380016; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=D1hJVDzBL3nIeSouuCeQ/3BBH9kpuzEv9DEXKr8ImU4=; b=hZwwX3HR8plgPoPl4vw+IbCi4irDKsSinrgkMk4EYVMd+JpV5Ff6HsMWEPbs8/sr9GbBg+edLm29s5/b4Weea8ytYQrMHfEfvx4kqOn7PPoO4iczjxOpk89PFCuqtUvHti2Kq5sxWI/6zCjDS7+q0w5wpMxvEA6JcaKqJt6egi4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105394+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1685380016989666.4709250770827; Mon, 29 May 2023 10:06:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id vRBmYY1788612xj0kMfd1BWS; Mon, 29 May 2023 10:06:56 -0700 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.54444.1685380015619330406 for ; Mon, 29 May 2023 10:06:55 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10725"; a="352246063" X-IronPort-AV: E=Sophos;i="6.00,201,1681196400"; d="scan'208";a="352246063" X-Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2023 10:06:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10725"; a="709350938" X-IronPort-AV: E=Sophos;i="6.00,201,1681196400"; d="scan'208";a="709350938" X-Received: from mdkinney-mobl.amr.corp.intel.com ([10.209.9.14]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2023 10:06:54 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang , Oliver Smith-Denny , Pedro Falcato , Aaron Pop Subject: [edk2-devel] [Patch 2/2] SecurityPkg/Library/TpmCommandLib: Change xor to Xor Date: Mon, 29 May 2023 10:06:49 -0700 Message-Id: <20230529170649.1506-3-michael.d.kinney@intel.com> In-Reply-To: <20230529170649.1506-1-michael.d.kinney@intel.com> References: <20230529170649.1506-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com X-Gm-Message-State: 1AEiOrE2QVm3mBPWmRp2Y6Hgx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1685380016; bh=FMiZ6aA6aN8iA6VxOmd57DCh9iIMpgzog/9e3ytyOTo=; h=Cc:Date:From:Reply-To:Subject:To; b=Oy7n02Q5s35IRSRg2g1lq+joVlOOzAo/tEk60i6AFfSFmL6gw72GxLBee6aCApysGP3 hq8L/qA8FowA2cwNLFAQEIBdYW+9yDN6hl/VJDOyAdqF+0UjuJB0KVkumi0/wcL4NJzT4 PSpxsUNROBVeWHAs4dKrwzfIN9I8HZGfPj4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1685380017412100006 Content-Type: text/plain; charset="utf-8" Change xor to Xor to avoid C++ reserved work name collisions when building with C++ compilers. NOTE: This is a non-backwards compatible change to Tpm12.h and Tmp20.h. And consumers of these include files that access the "operator" or "xor" fields must be updated. Cc: Jiewen Yao Cc: Jian J Wang Cc: Oliver Smith-Denny Cc: Pedro Falcato Cc: Aaron Pop Signed-off-by: Michael D Kinney Reviewed-by: Oliver Smith-Denny Reviewed-by: Pedro Falcato --- SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c | 6 +++--- SecurityPkg/Library/Tpm2CommandLib/Tpm2Object.c | 6 +++--- SecurityPkg/Library/Tpm2CommandLib/Tpm2Session.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c b/Security= Pkg/Library/Tpm2CommandLib/Tpm2Capability.c index f0e6019a47be..f8c781a445a1 100644 --- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c +++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Capability.c @@ -734,9 +734,9 @@ Tpm2TestParms ( Buffer +=3D sizeof (UINT16); break; case TPM_ALG_XOR: - WriteUnaligned16 ((UINT16 *)Buffer, SwapBytes16 (Parameters->par= ameters.keyedHashDetail.scheme.details.xor.hashAlg)); + WriteUnaligned16 ((UINT16 *)Buffer, SwapBytes16 (Parameters->par= ameters.keyedHashDetail.scheme.details.Xor.hashAlg)); Buffer +=3D sizeof (UINT16); - WriteUnaligned16 ((UINT16 *)Buffer, SwapBytes16 (Parameters->par= ameters.keyedHashDetail.scheme.details.xor.kdf)); + WriteUnaligned16 ((UINT16 *)Buffer, SwapBytes16 (Parameters->par= ameters.keyedHashDetail.scheme.details.Xor.kdf)); Buffer +=3D sizeof (UINT16); break; default: @@ -761,7 +761,7 @@ Tpm2TestParms ( Buffer +=3D sizeof (UINT16); break; case TPM_ALG_XOR: - WriteUnaligned16 ((UINT16 *)Buffer, SwapBytes16 (Parameters->par= ameters.symDetail.keyBits.xor)); + WriteUnaligned16 ((UINT16 *)Buffer, SwapBytes16 (Parameters->par= ameters.symDetail.keyBits.Xor)); Buffer +=3D sizeof (UINT16); break; case TPM_ALG_NULL: diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Object.c b/SecurityPkg/= Library/Tpm2CommandLib/Tpm2Object.c index 335957d6cedc..578a61b20339 100644 --- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Object.c +++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Object.c @@ -169,9 +169,9 @@ Tpm2ReadPublic ( Buffer = +=3D sizeof (UINT16); break; case TPM_ALG_XOR: - OutPublic->publicArea.parameters.keyedHashDetail.scheme.details.= xor.hashAlg =3D SwapBytes16 (ReadUnaligned16 ((UINT16 *)Buffer)); + OutPublic->publicArea.parameters.keyedHashDetail.scheme.details.= Xor.hashAlg =3D SwapBytes16 (ReadUnaligned16 ((UINT16 *)Buffer)); Buffer = +=3D sizeof (UINT16); - OutPublic->publicArea.parameters.keyedHashDetail.scheme.details.= xor.kdf =3D SwapBytes16 (ReadUnaligned16 ((UINT16 *)Buffer)); + OutPublic->publicArea.parameters.keyedHashDetail.scheme.details.= Xor.kdf =3D SwapBytes16 (ReadUnaligned16 ((UINT16 *)Buffer)); Buffer = +=3D sizeof (UINT16); break; default: @@ -195,7 +195,7 @@ Tpm2ReadPublic ( Buffer +=3D sizeo= f (UINT16); break; case TPM_ALG_XOR: - OutPublic->publicArea.parameters.symDetail.keyBits.xor =3D SwapB= ytes16 (ReadUnaligned16 ((UINT16 *)Buffer)); + OutPublic->publicArea.parameters.symDetail.keyBits.Xor =3D SwapB= ytes16 (ReadUnaligned16 ((UINT16 *)Buffer)); Buffer +=3D sizeo= f (UINT16); break; case TPM_ALG_NULL: diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Session.c b/SecurityPkg= /Library/Tpm2CommandLib/Tpm2Session.c index 7f247da301fe..e17318b6e6fb 100644 --- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Session.c +++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Session.c @@ -119,7 +119,7 @@ Tpm2StartAuthSession ( Buffer +=3D sizeof (UINT16); break; case TPM_ALG_XOR: - WriteUnaligned16 ((UINT16 *)Buffer, SwapBytes16 (Symmetric->keyBits.= xor)); + WriteUnaligned16 ((UINT16 *)Buffer, SwapBytes16 (Symmetric->keyBits.= Xor)); Buffer +=3D sizeof (UINT16); break; default: --=20 2.40.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105394): https://edk2.groups.io/g/devel/message/105394 Mute This Topic: https://groups.io/mt/99204101/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-