From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=fO5YfYDT; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: michael.a.kubacki@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Thu, 03 Oct 2019 11:35:31 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2019 11:35:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,253,1566889200"; d="scan'208";a="204048921" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 03 Oct 2019 11:35:30 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 11:35:25 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 11:35:25 -0700 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (104.47.42.58) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 11:35:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dvVslig02+WIT8qvZfw0P7cv4HN8g2fh05GK+kIcVRW8CwYRy8hPH3MaxEFleZx7NNHAIvdkf/oB7SZLA4aQj1SfDrLVL6FGcdi0Ig0k1jqXptoNhzAiqsEvVdnYP01F41AciuD41JbbxaUrRzWWZbSKT/1yTv6l6FwnF7VmSqNbjYMvrEYV8dnXesd8hSjvKq7ZLERYixBH/zvoktuzEq2if07l9CK+58A99/Z0WcTmbW+YfsrSsASgas5ByeGKVyDeWBo8LGqiMFPgFY+WI7sF4ASBiYzU5DBp4W3l9m1ynM90QFn1odm+wFAc9chlj6+iTUys6jMQqZVHpO1pyg== 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=BLjvxCCppb5M5z/9yOI2F8+4Lsta/PuHJDNunkOnvTY=; b=IEs9/d9InCuFaPWQKTT6lDZBeo1biZFjieJLDKcrCOBDUUPzUPbNtctTUUDiquLUZFtAKHytav+Ygs79OZvjAauu94yQ2OwXJmkUA4WTqla1xGxQgJN2lJF55Jtv0kojwzmsczFNHI4ihkL2BZMFsjTGR0mWDVVzto4/dwe0dGVZE8xkAjRA8dRSiDUJQUxUL1WnSrnaNPtnCH3UtfWjrPaZbDeXgsdx7b5qldn+mw/MXTbP+ykFlwbZ1mJzRBBxWCRkdIB7tM2+xIDHpT1MJ4fD8Nf80o/4yVdaYn3rrlNV5Tpjz/D2MgW/BqUwgw46khGBQWU3ALOaaCx2UoMhOQ== 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=BLjvxCCppb5M5z/9yOI2F8+4Lsta/PuHJDNunkOnvTY=; b=fO5YfYDTIXZX7TeA3CxozyxLrcDHULcnRMxvB/XKMCYW/TONZtxLk3ryzNM2gH5ZImtlIoYNG4EHNA0/GR+1WFX8fD8ZbXRW0MFNQmFmeMHvnwYK6EoYzALpUXNopGg+xF+/5JzamsJgCkheE6Whhh+lFLBiFGAymdf/XaPXkTE= Received: from DM6PR11MB3834.namprd11.prod.outlook.com (20.179.17.87) by DM6PR11MB3356.namprd11.prod.outlook.com (20.176.122.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.20; Thu, 3 Oct 2019 18:35:23 +0000 Received: from DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::59cc:8a30:6b9e:584e]) by DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::59cc:8a30:6b9e:584e%3]) with mapi id 15.20.2305.023; Thu, 3 Oct 2019 18:35:22 +0000 From: "Kubacki, Michael A" To: "Wu, Hao A" , "devel@edk2.groups.io" CC: "Bi, Dandan" , Ard Biesheuvel , "Dong, Eric" , Laszlo Ersek , "Gao, Liming" , "Kinney, Michael D" , "Ni, Ray" , "Wang, Jian J" , "Yao, Jiewen" Subject: Re: [edk2-devel] [PATCH V2 4/9] MdeModulePkg/Variable: Add local auth status in VariableParsing Thread-Topic: [edk2-devel] [PATCH V2 4/9] MdeModulePkg/Variable: Add local auth status in VariableParsing Thread-Index: AQHVecEgBh+IMrhGiEKotiaH5kD0SqdJNwRg Date: Thu, 3 Oct 2019 18:35:22 +0000 Message-ID: References: <20190928014717.31372-1-michael.a.kubacki@intel.com> <20190928014717.31372-5-michael.a.kubacki@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWZlNTk2YzctYTg0Ni00NzdmLWEzZTMtNjgzOGFiOWQ5OGJmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQ0UrbStFcTl5ZmdHVFBBYjVTcWU5WlRvS0ZBV3VyVE9sYUhxaUdtSVRrM1wvN1N0UFNNRzdcLytjVGc2WG9nSXBDIn0= dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=michael.a.kubacki@intel.com; x-originating-ip: [134.134.136.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fb11c470-a195-4975-fd00-08d74830737b x-ms-traffictypediagnostic: DM6PR11MB3356: x-ms-exchange-purlcount: 3 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 01792087B6 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(346002)(136003)(376002)(13464003)(199004)(189003)(26005)(52536014)(30864003)(76176011)(6506007)(7696005)(486006)(5660300002)(102836004)(2906002)(186003)(2501003)(476003)(33656002)(11346002)(25786009)(229853002)(446003)(6436002)(8936002)(14444005)(81166006)(81156014)(8676002)(256004)(107886003)(6246003)(478600001)(71200400001)(71190400001)(966005)(6306002)(4326008)(9686003)(55016002)(76116006)(66946007)(86362001)(66556008)(64756008)(66446008)(66476007)(316002)(110136005)(54906003)(7736002)(305945005)(74316002)(3846002)(6116002)(66066001)(99286004)(14454004)(53546011);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR11MB3356;H:DM6PR11MB3834.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ynArS53d+0F/f2+aPCbKV4HUlVsh4yij6ALF8mWQ+qLTLD+nFkGfcnhezrUuRuxV634y8QHh311wBdKKLRSFVip/hRb0ouZvhd2OIrIPxP/FDAYmVw/RhHkCVeVVugLnC7rNGGULhl0jew30hMKiAHlaQf+XSJt8+nJNiCqi5BQfaZQPaG4jS8WyFnWq8ULRHC/tq9gMJRLg5WqsDLgEzwt/hhfxrjIsD8duhvWq2njxHJVFgDlTrIU8fkP227VzBpPxIl7ANvsb5QmiIVB3AiVEFCuk8TSsqEj97sSadi89lYklbWW+Gb+Mg6gVgKz6yl50KprCphvfhCOzKoS4TlGdaIuL0dPyZ+z0SttWBAH0bToaPgPQpXGv3viaK3kg8HFPFuTcRZ5TZExXi2yskva/fPR0vgNQ1bn0IC3mvt2Bc/eIy4xdnzntoxBWhlbADVIGVb4PXYU7uMwB6zEvdA== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: fb11c470-a195-4975-fd00-08d74830737b X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2019 18:35:22.6481 (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: eEssv1KFNN+TgxbKrw4NPJQeR8lX603ROy9MK5D3W72zJLWx9CQ3N6ZllXxEuIwHqO6DvCpkHBs+I3I7z0cUoAjUdgxWVmKk4JqMoitVmHg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3356 Return-Path: michael.a.kubacki@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I will make the following changes in V3: > InitVariableParsing() seems an internal function, the 'EFIAPI' keyword c= an be > dropped. Please help to update the function definition in .C file as wel= l. I will remove the EFIAPI keyword. > > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > index 1a57d7e1ba..53d797152c 100644 > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > @@ -3326,6 +3326,9 @@ InitNonVolatileVariableStore ( > > mVariableModuleGlobal->MaxVariableSize =3D PcdGet32 > > (PcdMaxVariableSize); > > mVariableModuleGlobal->MaxAuthVariableSize =3D ((PcdGet32 > > (PcdMaxAuthVariableSize) !=3D 0) ? PcdGet32 (PcdMaxAuthVariableSize) : > > mVariableModuleGlobal->MaxVariableSize); > > > > + Status =3D InitVariableParsing (mVariableModuleGlobal- > > >VariableGlobal.AuthFormat); > > + ASSERT_EFI_ERROR (Status); > > + >=20 >=20 > After the above initialization, mVariableModuleGlobal- > >VariableGlobal.AuthFormat > will be changed temporarily within > ConvertNormalVarStorageToAuthVarStorage() if normal HOB variable store > will be converted to the auth format: >=20 > VOID * > ConvertNormalVarStorageToAuthVarStorage ( > VARIABLE_STORE_HEADER *NormalVarStorage > ) > { > ... > // > // Set AuthFormat as FALSE for normal variable storage > // > mVariableModuleGlobal->VariableGlobal.AuthFormat =3D FALSE; > ... > // > // Restore AuthFormat > // > mVariableModuleGlobal->VariableGlobal.AuthFormat =3D TRUE; > return AuthVarStorage; > } >=20 >=20 > I think there will be issues in such converting, since I found that at l= east > GetVariableHeaderSize() and NameSizeOfVariable() get called during the > execution of ConvertNormalVarStorageToAuthVarStorage(). And they are > checking 'mAuthFormat' rather than 'mVariableModuleGlobal- > >VariableGlobal.AuthFormat'. >=20 > You're right that will be a problem. I missed this temporary change in the= value. I'm going to have all the functions dependent on authentication status in VariableParsing.c take it as a parameter and let the respective drivers li= nked against it maintain their own single copy of the authentication state. > > // > > // Parse non-volatile variable data and get last variable offset. > > // > > @@ -3756,18 +3759,13 @@ VariableCommonInitialize ( > > > > // > > // mVariableModuleGlobal->VariableGlobal.AuthFormat > > - // has been initialized in InitNonVolatileVariableStore(). > > + // is initialized in InitNonVolatileVariableStore(). > > // > > if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > DEBUG ((EFI_D_INFO, "Variable driver will work with auth variable > > format!\n")); > > - // > > - // Set AuthSupport to FALSE first, VariableWriteServiceInitialize= () will > > initialize it. > > - // > > - mVariableModuleGlobal->VariableGlobal.AuthSupport =3D FALSE; > > VariableGuid =3D &gEfiAuthenticatedVariableGuid; > > } else { > > DEBUG ((EFI_D_INFO, "Variable driver will work without auth > > variable support!\n")); > > - mVariableModuleGlobal->VariableGlobal.AuthSupport =3D FALSE; >=20 >=20 > Not sure why the above changes belong to this patch. > Could you help to double confirm? This was used during testing and is not needed. I will remove it. Thanks, Michael > -----Original Message----- > From: Wu, Hao A > Sent: Thursday, October 3, 2019 1:04 AM > To: devel@edk2.groups.io; Kubacki, Michael A > > Cc: Bi, Dandan ; Ard Biesheuvel > ; Dong, Eric ; Laszlo Er= sek > ; Gao, Liming ; Kinney, Michael > D ; Ni, Ray ; Wang, Jian J > ; Yao, Jiewen > Subject: RE: [edk2-devel] [PATCH V2 4/9] MdeModulePkg/Variable: Add loca= l > auth status in VariableParsing >=20 > Inline comments below: >=20 >=20 > > -----Original Message----- > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > > Kubacki, Michael A > > Sent: Saturday, September 28, 2019 9:47 AM > > To: devel@edk2.groups.io > > Cc: Bi, Dandan; Ard Biesheuvel; Dong, Eric; Laszlo Ersek; Gao, Liming; > > Kinney, Michael D; Ni, Ray; Wang, Jian J; Wu, Hao A; Yao, Jiewen > > Subject: [edk2-devel] [PATCH V2 4/9] MdeModulePkg/Variable: Add local > > auth status in VariableParsing > > > > The file VariableParsing.c provides generic functionality related to > > parsing variable related structures and information. In order to > > calculate offsets for certain operations, the functions must know if > > authenticated variables are enabled as this increases the size of > > variable headers. > > > > This change removes linking against a global variable in an external > > file in favor of a statically scoped variable in VariableParsing.c > > Because this file is unaware of how the authenticated variable status > > is determined, the variable is set through a function interface > > invoked during variable driver initialization. > > > > Cc: Dandan Bi > > Cc: Ard Biesheuvel > > Cc: Eric Dong > > Cc: Laszlo Ersek > > Cc: Liming Gao > > Cc: Michael D Kinney > > Cc: Ray Ni > > Cc: Jian J Wang > > Cc: Hao A Wu > > Cc: Jiewen Yao > > Signed-off-by: Michael Kubacki > > --- > > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h | 14 > > +++++++++ > > MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 10 +++= --- > > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c | 33 > > ++++++++++++++++---- > > 3 files changed, 45 insertions(+), 12 deletions(-) > > > > diff --git > > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > index 6f2000f3ee..3eba590634 100644 > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > @@ -308,4 +308,18 @@ UpdateVariableInfo ( > > IN OUT VARIABLE_INFO_ENTRY **VariableInfo > > ); > > > > +/** > > + Initializes context needed for variable parsing functions. > > + > > + @param[in] AuthFormat If true then indicates authent= icated > > variables are supported > > + > > + @retval EFI_SUCCESS Initialized successfully > > + @retval Others An error occurred during initi= alization > > +**/ > > +EFI_STATUS > > +EFIAPI > > +InitVariableParsing ( >=20 >=20 > InitVariableParsing() seems an internal function, the 'EFIAPI' keyword c= an be > dropped. Please help to update the function definition in .C file as wel= l. >=20 >=20 > > + IN BOOLEAN AuthFormat > > + ); > > + > > #endif > > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > index 1a57d7e1ba..53d797152c 100644 > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > @@ -3326,6 +3326,9 @@ InitNonVolatileVariableStore ( > > mVariableModuleGlobal->MaxVariableSize =3D PcdGet32 > > (PcdMaxVariableSize); > > mVariableModuleGlobal->MaxAuthVariableSize =3D ((PcdGet32 > > (PcdMaxAuthVariableSize) !=3D 0) ? PcdGet32 (PcdMaxAuthVariableSize) : > > mVariableModuleGlobal->MaxVariableSize); > > > > + Status =3D InitVariableParsing (mVariableModuleGlobal- > > >VariableGlobal.AuthFormat); > > + ASSERT_EFI_ERROR (Status); > > + >=20 >=20 > After the above initialization, mVariableModuleGlobal- > >VariableGlobal.AuthFormat > will be changed temporarily within > ConvertNormalVarStorageToAuthVarStorage() if normal HOB variable store > will be converted to the auth format: >=20 > VOID * > ConvertNormalVarStorageToAuthVarStorage ( > VARIABLE_STORE_HEADER *NormalVarStorage > ) > { > ... > // > // Set AuthFormat as FALSE for normal variable storage > // > mVariableModuleGlobal->VariableGlobal.AuthFormat =3D FALSE; > ... > // > // Restore AuthFormat > // > mVariableModuleGlobal->VariableGlobal.AuthFormat =3D TRUE; > return AuthVarStorage; > } >=20 >=20 > I think there will be issues in such converting, since I found that at l= east > GetVariableHeaderSize() and NameSizeOfVariable() get called during the > execution of ConvertNormalVarStorageToAuthVarStorage(). And they are > checking 'mAuthFormat' rather than 'mVariableModuleGlobal- > >VariableGlobal.AuthFormat'. >=20 >=20 > > // > > // Parse non-volatile variable data and get last variable offset. > > // > > @@ -3756,18 +3759,13 @@ VariableCommonInitialize ( > > > > // > > // mVariableModuleGlobal->VariableGlobal.AuthFormat > > - // has been initialized in InitNonVolatileVariableStore(). > > + // is initialized in InitNonVolatileVariableStore(). > > // > > if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > DEBUG ((EFI_D_INFO, "Variable driver will work with auth variable > > format!\n")); > > - // > > - // Set AuthSupport to FALSE first, VariableWriteServiceInitialize= () will > > initialize it. > > - // > > - mVariableModuleGlobal->VariableGlobal.AuthSupport =3D FALSE; > > VariableGuid =3D &gEfiAuthenticatedVariableGuid; > > } else { > > DEBUG ((EFI_D_INFO, "Variable driver will work without auth > > variable support!\n")); > > - mVariableModuleGlobal->VariableGlobal.AuthSupport =3D FALSE; >=20 >=20 > Not sure why the above changes belong to this patch. > Could you help to double confirm? >=20 > Best Regards, > Hao Wu >=20 >=20 > > VariableGuid =3D &gEfiVariableGuid; > > } > > > > diff --git > > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > index 394195342d..0a47f6d10d 100644 > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > @@ -9,6 +9,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > > > #include "VariableParsing.h" > > > > +STATIC BOOLEAN mAuthFormat; > > + > > /** > > > > This code checks if variable header is valid or not. > > @@ -88,7 +90,7 @@ GetVariableHeaderSize ( { > > UINTN Value; > > > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > + if (mAuthFormat) { > > Value =3D sizeof (AUTHENTICATED_VARIABLE_HEADER); > > } else { > > Value =3D sizeof (VARIABLE_HEADER); @@ -114,7 +116,7 @@ > > NameSizeOfVariable ( > > AUTHENTICATED_VARIABLE_HEADER *AuthVariable; > > > > AuthVariable =3D (AUTHENTICATED_VARIABLE_HEADER *) Variable; > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > + if (mAuthFormat) { > > if (AuthVariable->State =3D=3D (UINT8) (-1) || > > AuthVariable->DataSize =3D=3D (UINT32) (-1) || > > AuthVariable->NameSize =3D=3D (UINT32) (-1) || @@ -149,7 +151,= 7 @@ > > SetNameSizeOfVariable ( > > AUTHENTICATED_VARIABLE_HEADER *AuthVariable; > > > > AuthVariable =3D (AUTHENTICATED_VARIABLE_HEADER *) Variable; > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > + if (mAuthFormat) { > > AuthVariable->NameSize =3D (UINT32) NameSize; > > } else { > > Variable->NameSize =3D (UINT32) NameSize; @@ -173,7 +175,7 @@ > > DataSizeOfVariable ( > > AUTHENTICATED_VARIABLE_HEADER *AuthVariable; > > > > AuthVariable =3D (AUTHENTICATED_VARIABLE_HEADER *) Variable; > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > + if (mAuthFormat) { > > if (AuthVariable->State =3D=3D (UINT8) (-1) || > > AuthVariable->DataSize =3D=3D (UINT32) (-1) || > > AuthVariable->NameSize =3D=3D (UINT32) (-1) || @@ -208,7 +210,= 7 @@ > > SetDataSizeOfVariable ( > > AUTHENTICATED_VARIABLE_HEADER *AuthVariable; > > > > AuthVariable =3D (AUTHENTICATED_VARIABLE_HEADER *) Variable; > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > + if (mAuthFormat) { > > AuthVariable->DataSize =3D (UINT32) DataSize; > > } else { > > Variable->DataSize =3D (UINT32) DataSize; @@ -248,7 +250,7 @@ > > GetVendorGuidPtr ( > > AUTHENTICATED_VARIABLE_HEADER *AuthVariable; > > > > AuthVariable =3D (AUTHENTICATED_VARIABLE_HEADER *) Variable; > > - if (mVariableModuleGlobal->VariableGlobal.AuthFormat) { > > + if (mAuthFormat) { > > return &AuthVariable->VendorGuid; > > } else { > > return &Variable->VendorGuid; > > @@ -746,3 +748,22 @@ UpdateVariableInfo ( > > } > > } > > } > > + > > +/** > > + Initializes context needed for variable parsing functions. > > + > > + @param[in] AuthFormat If true then indicates authent= icated > > variables are supported > > + > > + @retval EFI_SUCCESS Initialized successfully > > + @retval Others An error occurred during initi= alization > > +**/ > > +EFI_STATUS > > +EFIAPI > > +InitVariableParsing ( > > + IN BOOLEAN AuthFormat > > + ) > > +{ > > + mAuthFormat =3D AuthFormat; > > + > > + return EFI_SUCCESS; > > +} > > -- > > 2.16.2.windows.1 > > > > > >=20 >=20