From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.2999.1679799038392457516 for ; Sat, 25 Mar 2023 19:50:38 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=IWiLHxGr; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: jiewen.yao@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679799038; x=1711335038; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=7Y7njCFWYznwbCzoD/V4AahWQsQ5tIxSIJzbWQch0Y8=; b=IWiLHxGrLmrXa1XAqU6Yau2AWf7pFN13CFjuNzZDM9KnAT3lMg1VWzx1 1+JeLd53cwcIxDJAr3zxY+hdJN0J6xP+wwCOTmaJ9+lmwRO75IY5eIKAP R54pNH8iKzqPaZm6S2vO5wIJNBRC9lFEAfp/piFpJc85MSrzK+mQSv8xr GX2Pw52nAfDVBDRrELli6KQPrT+zBe4YBWfYOyf1XxUveogw3gCF/PLXz NJrAhdyFuf8II1UHlxfO5EQEP5caPOk/G6AcV5UhBEfq7LAZ8HFJ9yBBN XK4MzDa4KLNEFF/nG78wj2jMKAbK3b8RfIq7Yrum36TuM2t11LlQgU6Ma A==; X-IronPort-AV: E=McAfee;i="6600,9927,10660"; a="319692516" X-IronPort-AV: E=Sophos;i="5.98,291,1673942400"; d="scan'208";a="319692516" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2023 19:50:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10660"; a="747590030" X-IronPort-AV: E=Sophos;i="5.98,291,1673942400"; d="scan'208";a="747590030" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga008.fm.intel.com with ESMTP; 25 Mar 2023 19:50:37 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Sat, 25 Mar 2023 19:50:37 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Sat, 25 Mar 2023 19:50:37 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Sat, 25 Mar 2023 19:50:37 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.47) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Sat, 25 Mar 2023 19:50:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bq1r6gWbqDj8vvbxFfASUxpECs3TRZ/hyRdTUbWlzX7B+/XjEGxisxY0TR+24HBU3MhEmsAFmxbkHwfJNQmpy7wXuU1zvX+8ZYxxT/k1Q7epkAf9tb1nr1lHk1Ah2FkwKbM5EoGcL8qrcXAn6enNSGxVw1nIpIzjD0KmT+hTXNAeVWfQhymuXY9PGZjRATJSeyPf/FBI2aJdajunbvFstpKsZSzPvbxWfHppRo33r8SClwBTgs0rhcPVrs4sJ1BzlP110X97sWiglSMafbCrTkpwDu5i8U9vKYE0uV8TATvzgU1W5/3uZ91frC0ZLFywCaHUV71jBbL9hgj8vPWrGQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aCImnbKFPRR8DjKsl7qT7wFAaLYwaW/uh4qkcoLxqrs=; b=X1QuU342ZKa7UpZPb6zikqK9lTzDwNjiUZ+Z44sVnWT9OZ4+Aqb9JdJxPxXATqRm2KRVGSJ3021XRfQ9o5oRE3HNu3/fyTPXFZBeM7Z0kdDahNnAT/YH/PLc8nnWuLXq6vZHON24ckDPPeGNiHtG+613uG0nXC7EKDa1fHnS6diP8iUdoj/YDjMjWdeqL2EINJ52ltM6I4ksxeEu9CclH1lWZ4v8nO0noAnQ5RMQO1qxtBI7pwOdNY7K8FZO5X3gVn17H7mDLVdf50FaK/0HZDbjL//b4tAGLjI8JvzbTmCQGSdc8/GMoODYWMsEKtRHAj3ratOH67CE/Dd+ZpS8kA== 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 Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by CO6PR11MB5571.namprd11.prod.outlook.com (2603:10b6:5:35f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.41; Sun, 26 Mar 2023 02:50:34 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::c0c0:4b46:1dd4:80d6]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::c0c0:4b46:1dd4:80d6%7]) with mapi id 15.20.6178.041; Sun, 26 Mar 2023 02:50:34 +0000 From: "Yao, Jiewen" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: "Wang, Jian J" Subject: Re: [Patch 08/12] SecurityPkg/Library/SecureBootVariableLib: Fix VS20xx 4122 errors Thread-Topic: [Patch 08/12] SecurityPkg/Library/SecureBootVariableLib: Fix VS20xx 4122 errors Thread-Index: AQHZX0oKPvSW1OwvokuMOFbggOoRtK8MXNVQ Date: Sun, 26 Mar 2023 02:50:34 +0000 Message-ID: References: <20230325184541.596-1-michael.d.kinney@intel.com> <20230325184541.596-9-michael.d.kinney@intel.com> In-Reply-To: <20230325184541.596-9-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5872:EE_|CO6PR11MB5571:EE_ x-ms-office365-filtering-correlation-id: c557c2e6-fa99-4053-030a-08db2da4defa x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pEeSIp917Zzp8AKR9pjlofjQpp/X3rkU/AuWeLC9vaiGlgQoAPqtmIvsaAQPlbHTae3UZzaM3oUxHye7EG3PjmX2PhoJ5KXdumi/fEJRsJzoGhgb/R2YpHmfoOlvhE/EICLNOtXrq+LAw96bLiKao1Hy/X3CRjdj/pDUrLEcNuqjWOitH/cP2yNmJYR0L/Kv8wVsvr91ZQso910M5MGcFYscUfstA4KRMFlJJI2iM08TljOcaqlIMnBSJSND/qmmrZQmZqzc2cJPqooJGY9AWhM529olO2CBgUb0yFF+ie0XYCVJrezeDB5R5svaBuQuXjLCEmc1ZtBo/0yWzqNuxqr6AfHnILo78cAFG/x+b7gbukCdEnkLo6/ebO48NCPNR+dSUvXSvIfQfvMVXheY3jfvXzOA1trtZ2bfgYFWQ4/xeVsx2g0Yn5QF4I1QIhcTPzzyg1Qkd2IQpjKcbCr/E4kokLqlOw/JVZAQes/vlz+xLWcL34rzhD5WKe943b6qXxDgcjd7WYoxsHsZ9TuWaG5kBsQGeCEoK+3COmnlQaqS78FwzzLALufGcOk9YmvPwx1Vui78rrZxxubx6AS62Jnv4weAk2d56msymMHWybP03UmdazPS9c0dlcaZZ2oL x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5872.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(136003)(376002)(39860400002)(396003)(346002)(451199021)(15650500001)(2906002)(86362001)(83380400001)(186003)(122000001)(38100700002)(38070700005)(55016003)(8936002)(52536014)(82960400001)(53546011)(5660300002)(4326008)(8676002)(64756008)(66446008)(41300700001)(76116006)(66556008)(66946007)(66476007)(33656002)(26005)(6506007)(9686003)(316002)(110136005)(107886003)(71200400001)(478600001)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gLnAki/pPQ1eYEyEhHKD09Z4Ah41KavANgbmYMSGY5sLnrS/qwaayXBnxv9p?= =?us-ascii?Q?8if7vYtUmOJ/+gaimO5cWb6YeuH2Xo+MvHC396qlyPEwPz8SMg0itSLnABrF?= =?us-ascii?Q?4XSetVFyIuUBS8PdCzlu0xR40anu2xwpPAQx0p4cZLNUJCMlecv28syFIxy3?= =?us-ascii?Q?4rGus0uRjmkRoh95IPlRl/yQtUaQrd2KnfujjRqGw6UPpAKLaNWRkMSo7JJC?= =?us-ascii?Q?7Itzod4XluCLIGApkxFnPCMfm4WgGBAppnFChhkbtoXa0fWMYbQmyY3egXSM?= =?us-ascii?Q?rldy1vrDRW5ncaNryuXZJyCULjCO2G4YcezE3jY+ZJWwF8740y4inOE4LeTi?= =?us-ascii?Q?eWk+O43oXHC8/WdjxuNEsw58uzblr9q5y+rudMrGrcqqKMe9KzCBVsXEBcJ6?= =?us-ascii?Q?dj5PhrRSU9rRy9j+DwnHnpcAEnmwglwSqgOFggS3DQZxTk33p+V2pZUW4imO?= =?us-ascii?Q?bxmM/K5q6y8eZUE0U0giC7TrIxg8VH9ufbJlJv6mac/IwxLkh4nK9eIDXxYt?= =?us-ascii?Q?J3QUWGXuTfccbIu+okf0iySQiOEMkgjc/CYUMgJUsM47xqUWhwL/4f7uSk2/?= =?us-ascii?Q?1GN7nYB5oBZb/6PJW1W6kfvBTGACj77oFDK8/5hyLCviVGJOWO3NRcX/ZonM?= =?us-ascii?Q?Snpm4Kr3VuYD9WHiAZOmnZDZ9jSBx+cq1kqtaBXn1Ip6ZypEVPrjtvsIVswE?= =?us-ascii?Q?I49iDUdc6ZYJJZF+A/h7dq0yZ9scfhZGb3nqPmlW2YoCN1uat1wY15n1r9UO?= =?us-ascii?Q?9asA/shEZad8QtyJh8BEt1Hjw3rUxlqNvDk2p8D5sylYW3AqepKp70OnRcN4?= =?us-ascii?Q?YFQj0Sh155nalZHVMqIthOozw36mjdbxWZIRQuT8BrlH/jVncRN0gXmZiarK?= =?us-ascii?Q?e8ux65daN9Rioj8HixpmiZR406onCr55Zgt8/B3pZ/v/lOE8Iq0vOeFuSPtP?= =?us-ascii?Q?pVaF42sakJHrWt/5Eg7iuYYUfa8gcguohIXiZVxAICR/+VJukulizd8m+vDb?= =?us-ascii?Q?UyDmFZPf8JYm6veCmwwDo2dyQvxqhsb1DG46Okbsvmg7AsJ9O2IMiV97ZJzl?= =?us-ascii?Q?qIiy9GDH0SPzo/Fe2emBBN8prGwL8Ck3ta4cygWVjPzrc2zjJW5Q7/n5pgJH?= =?us-ascii?Q?miw7reEwPjzega97cMt3uHaJX+mEzB9ErMOv0hZKH5MgQlZEHtuk4xqtH6vA?= =?us-ascii?Q?6+TZhf5gsPg5aOFoAjWhZQ73zE4MOj+v5HpuNf1Qnqyws9YBsWQnE8LIewvQ?= =?us-ascii?Q?7uDh+oUBsfS8MdxMwkB7c0NmELt3APqmul3J/+C7SxRYaRYq5213qSG+uwxI?= =?us-ascii?Q?5SbyW2/SmV37130sqdls06WLh/Q1Y/hkJ6R9FgDWG1ldK/hLfT4rPVxGwKRS?= =?us-ascii?Q?PZtH1clltbeDVoSpUnkn+RBZuFQc4x3+YuLugb7zI6zQrKL4TSWla7OyH5Vs?= =?us-ascii?Q?2Hx2DqV0IgGU5gFfQAwSYVFvRMvnlPvskJjMByR7ITUVqa7K2/6z4CQF/0tS?= =?us-ascii?Q?U2KiqYy0EJ87I3Uhka+dim/iwgwzTo1ak3A6CW6d2UalOiy6KuJxltWHqs2k?= =?us-ascii?Q?tFUvA9QqgoVHbnwnemXp22j840/KMLxLVBbc7uXF?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c557c2e6-fa99-4053-030a-08db2da4defa X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2023 02:50:34.1401 (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: D9OCMQnuEpSU8yWn/61A73Og4gVQsfRiLN5rdsO01/grtVEbOVixqjGGCxKihFT/PngGCh3TxKiIqKYDC6XcUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR11MB5571 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen Yao > -----Original Message----- > From: Kinney, Michael D > Sent: Sunday, March 26, 2023 2:46 AM > To: devel@edk2.groups.io > Cc: Yao, Jiewen ; Wang, Jian J > > Subject: [Patch 08/12] SecurityPkg/Library/SecureBootVariableLib: Fix > VS20xx 4122 errors >=20 > The unit test code for the SecureBootVariableLib is initializing > local variable structures in their declaration from other local > variables that are also initialized in their declaration. ANSI C > does not allow this and error 4122 is generated on VS20xx compilers. >=20 > The test cases are updated to initialize the local structure > fields in C statements instead of their local variable declaration. >=20 > Cc: Jiewen Yao > Cc: Jian J Wang > Signed-off-by: Michael D Kinney > --- > .../UnitTest/SecureBootVariableLibUnitTest.c | 170 +++++++++--------- > 1 file changed, 83 insertions(+), 87 deletions(-) >=20 > diff --git > a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLi > bUnitTest.c > b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLi > bUnitTest.c > index 3a92d5d83457..e4cdc68bbb35 100644 > --- > a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLi > bUnitTest.c > +++ > b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLi > bUnitTest.c > @@ -351,10 +351,10 @@ SecureBootCreateDataFromInputSimple ( > UINTN SigListSize =3D 0; > EFI_STATUS Status; > UINT8 TestData[] =3D { 0 }; > - SECURE_BOOT_CERTIFICATE_INFO KeyInfo =3D { > - .Data =3D TestData, > - .DataSize =3D sizeof (TestData) > - }; > + SECURE_BOOT_CERTIFICATE_INFO KeyInfo; > + > + KeyInfo.Data =3D TestData; > + KeyInfo.DataSize =3D sizeof (TestData); >=20 > Status =3D SecureBootCreateDataFromInput (&SigListSize, &SigList, 1, > &KeyInfo); >=20 > @@ -441,16 +441,12 @@ SecureBootCreateDataFromInputMultiple ( > UINT8 TestData1[] =3D { 0 }; > UINT8 TestData2[] =3D { 1, 2 }; > EFI_STATUS Status; > - SECURE_BOOT_CERTIFICATE_INFO KeyInfo[2] =3D { > - { > - .Data =3D TestData1, > - .DataSize =3D sizeof (TestData1) > - }, > - { > - .Data =3D TestData2, > - .DataSize =3D sizeof (TestData2) > - } > - }; > + SECURE_BOOT_CERTIFICATE_INFO KeyInfo[2]; > + > + KeyInfo[0].Data =3D TestData1; > + KeyInfo[0].DataSize =3D sizeof (TestData1); > + KeyInfo[1].Data =3D TestData2; > + KeyInfo[1].DataSize =3D sizeof (TestData2); >=20 > Status =3D SecureBootCreateDataFromInput (&SigListSize, &SigList, 2, > KeyInfo); > UT_ASSERT_NOT_EFI_ERROR (Status); > @@ -1219,19 +1215,19 @@ SetSecureBootVariablesShouldComplete ( > UINT8 PkDummy =3D 0xFE; > UINT8 *Payload =3D NULL; > UINTN PayloadSize =3D sizeof (DbDummy); > - SECURE_BOOT_PAYLOAD_INFO PayloadInfo =3D { > - .DbPtr =3D &DbDummy, > - .DbSize =3D sizeof (DbDummy), > - .DbxPtr =3D &DbxDummy, > - .DbxSize =3D sizeof (DbxDummy), > - .DbtPtr =3D &DbtDummy, > - .DbtSize =3D sizeof (DbtDummy), > - .KekPtr =3D &KekDummy, > - .KekSize =3D sizeof (KekDummy), > - .PkPtr =3D &PkDummy, > - .PkSize =3D sizeof (PkDummy), > - .SecureBootKeyName =3D L"Food" > - }; > + SECURE_BOOT_PAYLOAD_INFO PayloadInfo; > + > + PayloadInfo.DbPtr =3D &DbDummy; > + PayloadInfo.DbSize =3D sizeof (DbDummy); > + PayloadInfo.DbxPtr =3D &DbxDummy; > + PayloadInfo.DbxSize =3D sizeof (DbxDummy); > + PayloadInfo.DbtPtr =3D &DbtDummy; > + PayloadInfo.DbtSize =3D sizeof (DbtDummy); > + PayloadInfo.KekPtr =3D &KekDummy; > + PayloadInfo.KekSize =3D sizeof (KekDummy); > + PayloadInfo.PkPtr =3D &PkDummy; > + PayloadInfo.PkSize =3D sizeof (PkDummy); > + PayloadInfo.SecureBootKeyName =3D L"Food"; >=20 > expect_memory (MockGetVariable, VariableName, > EFI_SECURE_BOOT_MODE_NAME, sizeof > (EFI_SECURE_BOOT_MODE_NAME)); > expect_value (MockGetVariable, VendorGuid, &gEfiGlobalVariableGuid); > @@ -1385,11 +1381,11 @@ SetSecureBootVariablesShouldStopFailDBX ( > UINT8 DbxDummy =3D 0xBE; > UINT8 *Payload =3D NULL; > UINTN PayloadSize =3D sizeof (DbxDummy); > - SECURE_BOOT_PAYLOAD_INFO PayloadInfo =3D { > - .DbxPtr =3D &DbxDummy, > - .DbxSize =3D sizeof (DbxDummy), > - .SecureBootKeyName =3D L"Fail DBX" > - }; > + SECURE_BOOT_PAYLOAD_INFO PayloadInfo; > + > + PayloadInfo.DbxPtr =3D &DbxDummy; > + PayloadInfo.DbxSize =3D sizeof (DbxDummy); > + PayloadInfo.SecureBootKeyName =3D L"Fail DBX"; >=20 > expect_memory (MockGetVariable, VariableName, > EFI_SECURE_BOOT_MODE_NAME, sizeof > (EFI_SECURE_BOOT_MODE_NAME)); > expect_value (MockGetVariable, VendorGuid, &gEfiGlobalVariableGuid); > @@ -1442,13 +1438,13 @@ SetSecureBootVariablesShouldStopFailDB ( > UINT8 DbxDummy =3D 0xBE; > UINT8 *Payload =3D NULL; > UINTN PayloadSize =3D sizeof (DbDummy); > - SECURE_BOOT_PAYLOAD_INFO PayloadInfo =3D { > - .DbPtr =3D &DbDummy, > - .DbSize =3D sizeof (DbDummy), > - .DbxPtr =3D &DbxDummy, > - .DbxSize =3D sizeof (DbxDummy), > - .SecureBootKeyName =3D L"Fail DB" > - }; > + SECURE_BOOT_PAYLOAD_INFO PayloadInfo; > + > + PayloadInfo.DbPtr =3D &DbDummy; > + PayloadInfo.DbSize =3D sizeof (DbDummy); > + PayloadInfo.DbxPtr =3D &DbxDummy; > + PayloadInfo.DbxSize =3D sizeof (DbxDummy); > + PayloadInfo.SecureBootKeyName =3D L"Fail DB"; >=20 > expect_memory (MockGetVariable, VariableName, > EFI_SECURE_BOOT_MODE_NAME, sizeof > (EFI_SECURE_BOOT_MODE_NAME)); > expect_value (MockGetVariable, VendorGuid, &gEfiGlobalVariableGuid); > @@ -1516,15 +1512,15 @@ SetSecureBootVariablesShouldStopFailDBT ( > UINT8 DbxDummy =3D 0xBE; > UINT8 *Payload =3D NULL; > UINTN PayloadSize =3D sizeof (DbDummy); > - SECURE_BOOT_PAYLOAD_INFO PayloadInfo =3D { > - .DbPtr =3D &DbDummy, > - .DbSize =3D sizeof (DbDummy), > - .DbxPtr =3D &DbxDummy, > - .DbxSize =3D sizeof (DbxDummy), > - .DbtPtr =3D &DbtDummy, > - .DbtSize =3D sizeof (DbtDummy), > - .SecureBootKeyName =3D L"Fail DBT" > - }; > + SECURE_BOOT_PAYLOAD_INFO PayloadInfo; > + > + PayloadInfo.DbPtr =3D &DbDummy; > + PayloadInfo.DbSize =3D sizeof (DbDummy); > + PayloadInfo.DbxPtr =3D &DbxDummy; > + PayloadInfo.DbxSize =3D sizeof (DbxDummy); > + PayloadInfo.DbtPtr =3D &DbtDummy; > + PayloadInfo.DbtSize =3D sizeof (DbtDummy); > + PayloadInfo.SecureBootKeyName =3D L"Fail DBT"; >=20 > expect_memory (MockGetVariable, VariableName, > EFI_SECURE_BOOT_MODE_NAME, sizeof > (EFI_SECURE_BOOT_MODE_NAME)); > expect_value (MockGetVariable, VendorGuid, &gEfiGlobalVariableGuid); > @@ -1608,19 +1604,19 @@ SetSecureBootVariablesShouldStopFailKEK ( > UINT8 PkDummy =3D 0xFE; > UINT8 *Payload =3D NULL; > UINTN PayloadSize =3D sizeof (DbDummy); > - SECURE_BOOT_PAYLOAD_INFO PayloadInfo =3D { > - .DbPtr =3D &DbDummy, > - .DbSize =3D sizeof (DbDummy), > - .DbxPtr =3D &DbxDummy, > - .DbxSize =3D sizeof (DbxDummy), > - .DbtPtr =3D &DbtDummy, > - .DbtSize =3D sizeof (DbtDummy), > - .KekPtr =3D &KekDummy, > - .KekSize =3D sizeof (KekDummy), > - .PkPtr =3D &PkDummy, > - .PkSize =3D sizeof (PkDummy), > - .SecureBootKeyName =3D L"Food" > - }; > + SECURE_BOOT_PAYLOAD_INFO PayloadInfo; > + > + PayloadInfo.DbPtr =3D &DbDummy; > + PayloadInfo.DbSize =3D sizeof (DbDummy); > + PayloadInfo.DbxPtr =3D &DbxDummy; > + PayloadInfo.DbxSize =3D sizeof (DbxDummy); > + PayloadInfo.DbtPtr =3D &DbtDummy; > + PayloadInfo.DbtSize =3D sizeof (DbtDummy); > + PayloadInfo.KekPtr =3D &KekDummy; > + PayloadInfo.KekSize =3D sizeof (KekDummy); > + PayloadInfo.PkPtr =3D &PkDummy; > + PayloadInfo.PkSize =3D sizeof (PkDummy); > + PayloadInfo.SecureBootKeyName =3D L"Food"; >=20 > expect_memory (MockGetVariable, VariableName, > EFI_SECURE_BOOT_MODE_NAME, sizeof > (EFI_SECURE_BOOT_MODE_NAME)); > expect_value (MockGetVariable, VendorGuid, &gEfiGlobalVariableGuid); > @@ -1718,19 +1714,19 @@ SetSecureBootVariablesShouldStopFailPK ( > UINT8 PkDummy =3D 0xFE; > UINT8 *Payload =3D NULL; > UINTN PayloadSize =3D sizeof (DbDummy); > - SECURE_BOOT_PAYLOAD_INFO PayloadInfo =3D { > - .DbPtr =3D &DbDummy, > - .DbSize =3D sizeof (DbDummy), > - .DbxPtr =3D &DbxDummy, > - .DbxSize =3D sizeof (DbxDummy), > - .DbtPtr =3D &DbtDummy, > - .DbtSize =3D sizeof (DbtDummy), > - .KekPtr =3D &KekDummy, > - .KekSize =3D sizeof (KekDummy), > - .PkPtr =3D &PkDummy, > - .PkSize =3D sizeof (PkDummy), > - .SecureBootKeyName =3D L"Food" > - }; > + SECURE_BOOT_PAYLOAD_INFO PayloadInfo; > + > + PayloadInfo.DbPtr =3D &DbDummy; > + PayloadInfo.DbSize =3D sizeof (DbDummy); > + PayloadInfo.DbxPtr =3D &DbxDummy; > + PayloadInfo.DbxSize =3D sizeof (DbxDummy); > + PayloadInfo.DbtPtr =3D &DbtDummy; > + PayloadInfo.DbtSize =3D sizeof (DbtDummy); > + PayloadInfo.KekPtr =3D &KekDummy; > + PayloadInfo.KekSize =3D sizeof (KekDummy); > + PayloadInfo.PkPtr =3D &PkDummy; > + PayloadInfo.PkSize =3D sizeof (PkDummy); > + PayloadInfo.SecureBootKeyName =3D L"Food"; >=20 > expect_memory (MockGetVariable, VariableName, > EFI_SECURE_BOOT_MODE_NAME, sizeof > (EFI_SECURE_BOOT_MODE_NAME)); > expect_value (MockGetVariable, VendorGuid, &gEfiGlobalVariableGuid); > @@ -1841,19 +1837,19 @@ SetSecureBootVariablesDBTOptional ( > UINT8 PkDummy =3D 0xFE; > UINT8 *Payload =3D NULL; > UINTN PayloadSize =3D sizeof (DbDummy); > - SECURE_BOOT_PAYLOAD_INFO PayloadInfo =3D { > - .DbPtr =3D &DbDummy, > - .DbSize =3D sizeof (DbDummy), > - .DbxPtr =3D &DbxDummy, > - .DbxSize =3D sizeof (DbxDummy), > - .DbtPtr =3D NULL, > - .DbtSize =3D 0, > - .KekPtr =3D &KekDummy, > - .KekSize =3D sizeof (KekDummy), > - .PkPtr =3D &PkDummy, > - .PkSize =3D sizeof (PkDummy), > - .SecureBootKeyName =3D L"Food" > - }; > + SECURE_BOOT_PAYLOAD_INFO PayloadInfo; > + > + PayloadInfo.DbPtr =3D &DbDummy; > + PayloadInfo.DbSize =3D sizeof (DbDummy); > + PayloadInfo.DbxPtr =3D &DbxDummy; > + PayloadInfo.DbxSize =3D sizeof (DbxDummy); > + PayloadInfo.DbtPtr =3D NULL; > + PayloadInfo.DbtSize =3D 0; > + PayloadInfo.KekPtr =3D &KekDummy; > + PayloadInfo.KekSize =3D sizeof (KekDummy); > + PayloadInfo.PkPtr =3D &PkDummy; > + PayloadInfo.PkSize =3D sizeof (PkDummy); > + PayloadInfo.SecureBootKeyName =3D L"Food"; >=20 > expect_memory (MockGetVariable, VariableName, > EFI_SECURE_BOOT_MODE_NAME, sizeof > (EFI_SECURE_BOOT_MODE_NAME)); > expect_value (MockGetVariable, VendorGuid, &gEfiGlobalVariableGuid); > -- > 2.39.1.windows.1