From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.124]) by mx.groups.io with SMTP id smtpd.web10.21714.1585166464301254870 for ; Wed, 25 Mar 2020 13:01:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=IcFxaE+q; spf=pass (domain: microsoft.com, ip: 40.107.220.124, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aV34EJirYFPDZ5mvhLXJYeB+b2sQ3Sm37insK0qPWN0dYBNEBGQCDhfked54qE1IIILw94i81FRwLY2wXXlQg4YQdNziK0KrcrMc68FAojbr4gMN8b9d74os5idp9+rXvYrv17uczDlc8+eFGhw0825wqvO/ms8U7s6NUJqmN8J6qRlXdVrIpYVbKHRVfE+xpmA/17k34FCNFLVxEzlXDF+KeEp1vcA4hmGNHc41XAOmv+mzdiyPyvjGueIWPNKMIL1+5wfQeVkr6N9L8K9U0a0JcvkbbFpIr9uNZnX4bwprfxrw7KMjYLvSHi5aWNWIVF5SygreYeOhabwCTuLa4A== 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=40jQffIJJ01cBNrD08Aut84mLA5jKrdVK/TcNhxd4QA=; b=edfE8Cry02i7ekoiOGmo9AIJYhhpfHMXHhi2OD5I1VBDLRzbjuF4SVo4E2R9KJDvY35zDbBmQm3QnD6xAXnB3Q7tCgRSUVImzhGEEChq+HW5wiwJugbq4oYueOWIcJSo0d2q6zySnTf+8RZM1F5WoC/rCNFQ2cBJCTXBD4ynZorK7y05C87lOHh4526kEidvV6oKAPNnn/5BAdNhd0rr9Z2a0OfFWliJntr9q1XR5Qs4rOIrYVPodKGL1xzTy8VZE3EgYif6f43jdV9HUNOie0l6jDc6Lc5LZUk93ll3xf+nvA1drLQszqAP/6/nbmxabelXLj0MHoh3XYd3a7qJpg== 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=40jQffIJJ01cBNrD08Aut84mLA5jKrdVK/TcNhxd4QA=; b=IcFxaE+q0g1s0PgnU1GHu5D6eljT1PNWa5RQfTl6e3+uvDafinIZrOFlDDviVykD+tCH/cKTD3IXjQenaj4kZ88GBjFo85PPp5vpgIqyrpDJYVsZcRWPssjvDV6vqtnoxMxxXDZ/apOwCEtrC3yPrXjJgdxGVlMbO3Izr40SVvQ= Received: from CY4PR21MB0743.namprd21.prod.outlook.com (2603:10b6:903:b2::9) by CY4PR21MB0168.namprd21.prod.outlook.com (2603:10b6:903:b9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.2; Wed, 25 Mar 2020 20:01:02 +0000 Received: from CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318]) by CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318%10]) with mapi id 15.20.2878.007; Wed, 25 Mar 2020 20:01:02 +0000 From: "Bret Barkelew" To: "devel@edk2.groups.io" , "lersek@redhat.com" , "michael.kubacki@outlook.com" CC: Siyuan Fu , Maciej Rabeda , Jiaxin Wu Subject: Re: [EXTERNAL] Re: [edk2-devel] [PATCH v2 2/2] Revert "NetworkPkg/TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval" Thread-Topic: [EXTERNAL] Re: [edk2-devel] [PATCH v2 2/2] Revert "NetworkPkg/TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval" Thread-Index: AQHWAthkk0g//8Ls1Eu7Nv68eylP/6hZumim Date: Wed, 25 Mar 2020 20:01:02 +0000 Message-ID: References: <20200325025932.13828-1-michael.kubacki@outlook.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-03-25T20:00:36.2120304Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bret.Barkelew@microsoft.com; x-originating-ip: [71.212.145.195] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 392f60bb-169e-48a8-4ea2-08d7d0f73ef6 x-ms-traffictypediagnostic: CY4PR21MB0168: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:546; x-forefront-prvs: 0353563E2B 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:(10019020)(6029001)(4636009)(39860400002)(136003)(396003)(366004)(346002)(376002)(186003)(55016002)(33656002)(9686003)(66946007)(66476007)(66556008)(64756008)(66446008)(8990500004)(91956017)(7696005)(76116006)(4326008)(966005)(19627235002)(316002)(81156014)(81166006)(6506007)(110136005)(26005)(54906003)(2906002)(8676002)(53546011)(86362001)(52536014)(8936002)(71200400001)(478600001)(5660300002)(10290500003);DIR:OUT;SFP:1102; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: z9UVnroZfIJVZ+8paQyMVm60s3BhjORWFi7DVWVXYOOgie+OSWfF30ewtxHEnkKBkC7KigLdufMdYYi1VI5uKwlKmNC0NmvNoD3KaDM9QD35CClW95jmUs48Or/hWe7uvbk+v3gnfYDnRBbm12aIULwcNEF6zMMBebjvb+AQUzNgeraaOcCC8+J/tDeoCUeJB8XobwSTeqnkvzZLpQgw3ErOoe2rZqnSuuqx9LiTnpjlWtFyQgajSfkIQ+eV6tbLH1eMqUCc6ebc5MpAJYcZ2IxARsTH9orx65GT2JSYP+/IH1vfoZWSzwl4h+N7KHGbA2vMA0h9JQ/oVDtCX9/XOxtFGV4mZp5t0fNmyADI2WwBIIsI9BxFSb34YQ3U762elw7gxN8L/szN2/oq/0xYYCcQnX33HMKVixc+Qxg7UYYOhJN6JGD6vRQ3QY/T5LO+iCUIsm/YWEis8YIVCU9CPzihYsA1hZSNPn7GanQE+6WDCCELJYJ++6yOO9gsJu0R3xaRMd3ahV5ci4+6LEy1HQ== x-ms-exchange-antispam-messagedata: CRBEpIQlZ0s2fVFVqfmZ6Gad99+Gu2wnSyzUpaEiXpTIPoZKofTuZxQnQTjqP8g7ooJQv3bhrXfqlqQvziZRl5mynKlFk88MQyJZKhxVD4E1FXTST8Npgjr8r6CNjtJ0R9e3pr1oYyWQ5w3sjrUFOw== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 392f60bb-169e-48a8-4ea2-08d7d0f73ef6 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Mar 2020 20:01:02.6983 (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: lTPx3fHNWfY8J7eKD3UY9NDudFFyg1YUwJwy/BoJYbjAqjNp8L6I9pgyY1FiudzXKXkcLZO2VlWKcPbgWSeydQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0168 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR21MB0743938270B866E97152FC84EFCE0CY4PR21MB0743namp_" --_000_CY4PR21MB0743938270B866E97152FC84EFCE0CY4PR21MB0743namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bret Barkelew - Bret ________________________________ From: devel@edk2.groups.io on behalf of Laszlo Erse= k via Groups.Io Sent: Wednesday, March 25, 2020 12:05:28 PM To: devel@edk2.groups.io ; michael.kubacki@outlook.c= om Cc: Siyuan Fu ; Maciej Rabeda ; Jiaxin Wu Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v2 2/2] Revert "NetworkPkg/Tls= AuthConfigDxe: fix TlsCaCertificate attributes retrieval" On 03/25/20 03:59, Michael Kubacki wrote: > From: Michael Kubacki > > This reverts commit 6896efdec2709e530b23c688cf0f31706709a0c5. > > REF:https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2F= bugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2062&data=3D02%7C01%7CBret= .Barkelew%40microsoft.com%7Cef8ede7820da4096b4c208d7d0ef8630%7C72f988bf86f1= 41af91ab2d7cd011db47%7C1%7C0%7C637207599480072478&sdata=3DHCNGBJ8zrUEax= J%2BsF3n77ESZzmusP4VZX8VeshCCxOY%3D&reserved=3D0 > > GetVariable() now returns attributes when it fails with > EFI_BUFFER_TOO_SMALL. Therefore, commit 6896efdec270 is > reverted since it is no longer relevant. > > Cc: Laszlo Ersek > Cc: Siyuan Fu > Cc: Maciej Rabeda > Cc: Jiaxin Wu > Signed-off-by: Michael Kubacki > --- > NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c | 27 +-----------------= -- > 1 file changed, 1 insertion(+), 26 deletions(-) Thank you very much for posting this patch. I have locally applied your series on top of e24529a5c324 ("ArmPlatformPkg/ArmPlatformPkg.dsc: Add missing components", 2020-03-25), and verified that "NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c" is now identical to its state directly preceding 6896efdec270: $ git diff --color 6896efdec270^..HEAD -- \ NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c modulo the following two commits pushed meanwhile: - ecf98fbcf858 ("NetworkPkg: Replace BSD License with BSD+Patent License", 2019-04-09) - dad13c806788 ("NetworkPkg/Tls: Fix few typos", 2020-02-10) Therefore, for this patch: Reviewed-by: Laszlo Ersek Thank you, Laszlo > diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c b/NetworkPk= g/TlsAuthConfigDxe/TlsAuthConfigImpl.c > index 715bc3a0a941..2481d1098fa3 100644 > --- a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c > +++ b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c > @@ -657,7 +657,6 @@ EnrollX509toVariable ( > EFI_SIGNATURE_LIST *CACert; > EFI_SIGNATURE_DATA *CACertData; > VOID *Data; > - VOID *CurrentData; > UINTN DataSize; > UINTN SigDataSize; > UINT32 Attr; > @@ -669,7 +668,6 @@ EnrollX509toVariable ( > CACert =3D NULL; > CACertData =3D NULL; > Data =3D NULL; > - CurrentData =3D NULL; > Attr =3D 0; > > Status =3D ReadFileContent ( > @@ -712,30 +710,11 @@ EnrollX509toVariable ( > Status =3D gRT->GetVariable( > VariableName, > &gEfiTlsCaCertificateGuid, > - NULL, > + &Attr, > &DataSize, > NULL > ); > if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { > - // > - // Per spec, we have to fetch the variable's contents, even though = we're > - // only interested in the variable's attributes. > - // > - CurrentData =3D AllocatePool (DataSize); > - if (CurrentData =3D=3D NULL) { > - Status =3D EFI_OUT_OF_RESOURCES; > - goto ON_EXIT; > - } > - Status =3D gRT->GetVariable( > - VariableName, > - &gEfiTlsCaCertificateGuid, > - &Attr, > - &DataSize, > - CurrentData > - ); > - if (EFI_ERROR (Status)) { > - goto ON_EXIT; > - } > Attr |=3D EFI_VARIABLE_APPEND_WRITE; > } else if (Status =3D=3D EFI_NOT_FOUND) { > Attr =3D TLS_AUTH_CONFIG_VAR_BASE_ATTR; > @@ -766,10 +745,6 @@ ON_EXIT: > FreePool (Data); > } > > - if (CurrentData !=3D NULL) { > - FreePool (CurrentData); > - } > - > if (X509Data !=3D NULL) { > FreePool (X509Data); > } > --_000_CY4PR21MB0743938270B866E97152FC84EFCE0CY4PR21MB0743namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Bret Barkelew <bret.barkelew@micros= oft.com>

 

- Bret

 


From: devel@edk2.groups.io= <devel@edk2.groups.io> on behalf of Laszlo Ersek via Groups.Io <l= ersek=3Dredhat.com@groups.io>
Sent: Wednesday, March 25, 2020 12:05:28 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>; michael.kuba= cki@outlook.com <michael.kubacki@outlook.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>; Maciej Rabeda <maciej= .rabeda@linux.intel.com>; Jiaxin Wu <jiaxin.wu@intel.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v2 2/2] Revert "Ne= tworkPkg/TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval"<= /font>
 
On 03/25/20 03:59, Michael Kubacki wrote:
> From: Michael Kubacki <michael.kubacki@microsoft.com>
>
> This reverts commit 6896efdec2709e530b23c688cf0f31706709a0c5.
>
> REF:https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F= %2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2062&amp;data=3D02%7C01= %7CBret.Barkelew%40microsoft.com%7Cef8ede7820da4096b4c208d7d0ef8630%7C72f98= 8bf86f141af91ab2d7cd011db47%7C1%7C0%7C637207599480072478&amp;sdata=3DHC= NGBJ8zrUEaxJ%2BsF3n77ESZzmusP4VZX8VeshCCxOY%3D&amp;reserved=3D0
>
> GetVariable() now returns attributes when it fails with
> EFI_BUFFER_TOO_SMALL. Therefore, commit 6896efdec270 is
> reverted since it is no longer relevant.
>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com><= br> > ---
>  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c | 27 +-----= --------------
>  1 file changed, 1 insertion(+), 26 deletions(-)

Thank you very much for posting this patch.

I have locally applied your series on top of e24529a5c324
("ArmPlatformPkg/ArmPlatformPkg.dsc: Add missing components", 2020-03-25), and verified that
"NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c" is now identic= al to
its state directly preceding 6896efdec270:

$ git diff --color 6896efdec270^..HEAD -- \
    NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c

modulo the following two commits pushed meanwhile:

- ecf98fbcf858 ("NetworkPkg: Replace BSD License with BSD+Patent<= br> License", 2019-04-09)

- dad13c806788 ("NetworkPkg/Tls: Fix few typos", 2020-02-10)

Therefore, for this patch:

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Thank you,
Laszlo


> diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c b/Networ= kPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
> index 715bc3a0a941..2481d1098fa3 100644
> --- a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
> +++ b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
> @@ -657,7 +657,6 @@ EnrollX509toVariable (
>    EFI_SIGNATURE_LIST     &nb= sp;          *CACert;
>    EFI_SIGNATURE_DATA     &nb= sp;          *CACertData;
>    VOID        = ;            &n= bsp;         *Data;
> -  VOID         &nb= sp;            =         *CurrentData;
>    UINTN       &nbs= p;            &= nbsp;        DataSize;
>    UINTN       &nbs= p;            &= nbsp;        SigDataSize;
>    UINT32       &nb= sp;            =         Attr;
> @@ -669,7 +668,6 @@ EnrollX509toVariable (
>    CACert        = =3D NULL;
>    CACertData    =3D NULL;
>    Data        = ;  =3D NULL;
> -  CurrentData   =3D NULL;
>    Attr        = ;  =3D 0;

>    Status =3D ReadFileContent (
> @@ -712,30 +710,11 @@ EnrollX509toVariable (
>    Status =3D gRT->GetVariable(
>           &nbs= p;        VariableName,
>           &nbs= p;        &gEfiTlsCaCertificateGuid,=
> -           &n= bsp;      NULL,
> +          &nbs= p;       &Attr,
>           &nbs= p;        &DataSize,
>           &nbs= p;        NULL
>           &nbs= p;        );
>    if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {
> -    //
> -    // Per spec, we have to fetch the variable's cont= ents, even though we're
> -    // only interested in the variable's attributes.<= br> > -    //
> -    CurrentData =3D AllocatePool (DataSize);
> -    if (CurrentData =3D=3D NULL) {
> -      Status =3D EFI_OUT_OF_RESOURCES;
> -      goto ON_EXIT;
> -    }
> -    Status =3D gRT->GetVariable(
> -           &n= bsp;        VariableName,
> -           &n= bsp;        &gEfiTlsCaCertificateGui= d,
> -           &n= bsp;        &Attr,
> -           &n= bsp;        &DataSize,
> -           &n= bsp;        CurrentData
> -           &n= bsp;        );
> -    if (EFI_ERROR (Status)) {
> -      goto ON_EXIT;
> -    }
>      Attr |=3D EFI_VARIABLE_APPEND_WRITE; >    } else if (Status =3D=3D EFI_NOT_FOUND) {
>      Attr =3D TLS_AUTH_CONFIG_VAR_BASE_ATTR;=
> @@ -766,10 +745,6 @@ ON_EXIT:
>      FreePool (Data);
>    }

> -  if (CurrentData !=3D NULL) {
> -    FreePool (CurrentData);
> -  }
> -
>    if (X509Data !=3D NULL) {
>      FreePool (X509Data);
>    }
>




--_000_CY4PR21MB0743938270B866E97152FC84EFCE0CY4PR21MB0743namp_--