From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.1627.1585700674312917269 for ; Tue, 31 Mar 2020 17:24:34 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: jiaxin.wu@intel.com) IronPort-SDR: fyRIrnt7fwRR+rlZnKaH6pHAu1dtEJ56jADZ4J8wPzcv6+i8dKTA+pAIXnW+0R0Ut3rCaMV2pC xshY3dESsvYw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2020 17:24:33 -0700 IronPort-SDR: 7BOQfkZ/Hhb8T2DLaHldLHZ3RaDW0QhdBl8JkwVSHKpWSn7MMMuwsyNVEVR8jq+E4slflUTb9e 1PiWxnNVxRwQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,329,1580803200"; d="scan'208";a="242552923" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga008.jf.intel.com with ESMTP; 31 Mar 2020 17:24:33 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Mar 2020 17:24:33 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 31 Mar 2020 17:24:32 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 31 Mar 2020 17:24:32 -0700 Received: from shsmsx107.ccr.corp.intel.com ([169.254.9.191]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.89]) with mapi id 14.03.0439.000; Wed, 1 Apr 2020 08:24:31 +0800 From: "Wu, Jiaxin" To: "michael.kubacki@outlook.com" , "devel@edk2.groups.io" CC: Laszlo Ersek , "Fu, Siyuan" , Maciej Rabeda Subject: Re: [PATCH v3 3/3] Revert "NetworkPkg/TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval" Thread-Topic: [PATCH v3 3/3] Revert "NetworkPkg/TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval" Thread-Index: AQHWBIKTMadgIuK+40qmkMGPw1kKfqhjbraA Date: Wed, 1 Apr 2020 00:24:30 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B72741705ED38@SHSMSX107.ccr.corp.intel.com> References: <20200327215536.9556-1-michael.kubacki@outlook.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzY5YTBmMDctZGFkMi00MWIwLWJjNmQtMjE4YmRiYTUxMmEzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiU2J4bW5kUkZrc1dHUEY0QU9LWjBydHgxREZxXC9XNW4ydlNnZHEyQXlxaEs5cUtka0dSM3ZnakVQb3UwSlN6cnQifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: jiaxin.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiaxin Wu > -----Original Message----- > From: michael.kubacki@outlook.com > Sent: Saturday, March 28, 2020 5:56 AM > To: devel@edk2.groups.io > Cc: Laszlo Ersek ; Fu, Siyuan ; > Maciej Rabeda ; Wu, Jiaxin > > Subject: [PATCH v3 3/3] Revert "NetworkPkg/TlsAuthConfigDxe: fix > TlsCaCertificate attributes retrieval" >=20 > From: Michael Kubacki >=20 > This reverts commit 6896efdec2709e530b23c688cf0f31706709a0c5. >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2062 >=20 > GetVariable() now returns attributes when it fails with > EFI_BUFFER_TOO_SMALL. Therefore, commit 6896efdec270 is > reverted since it is no longer relevant. >=20 > Cc: Laszlo Ersek > Cc: Siyuan Fu > Cc: Maciej Rabeda > Cc: Jiaxin Wu > Signed-off-by: Michael Kubacki > Reviewed-by: Bret Barkelew > Reviewed-by: Laszlo Ersek > --- > NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c | 27 +------------------= - > 1 file changed, 1 insertion(+), 26 deletions(-) >=20 > diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c > b/NetworkPkg/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; >=20 > 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 w= e'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); > } >=20 > - if (CurrentData !=3D NULL) { > - FreePool (CurrentData); > - } > - > if (X509Data !=3D NULL) { > FreePool (X509Data); > } > -- > 2.16.3.windows.1