From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.groups.io with SMTP id smtpd.web12.20455.1585163144882992910 for ; Wed, 25 Mar 2020 12:05:45 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EyfANXSQ; spf=pass (domain: redhat.com, ip: 63.128.21.74, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585163144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XDJyNvjFuWJolPjd9G2EvAqYgGldNEx8IfdOX9WXtJs=; b=EyfANXSQ1F7EQS3GPHUD1jbOLMvqVBBLM+gJgICpjRkVhX2T7uHesBrG/aRbmQK+c70Or5 V/NAZ54DsbpfwD5h/dvH8mn0gN3dY4BOVFJ6Ev0kUmrvJ5uAPsrIM4atLRSWYL4GDs8K12 SRddIgKBx4/XnUUMhJowJuPWo1KJO6I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-288-vWaV1Y7oO16LHmiEE321nw-1; Wed, 25 Mar 2020 15:05:38 -0400 X-MC-Unique: vWaV1Y7oO16LHmiEE321nw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0191802B76; Wed, 25 Mar 2020 19:05:30 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-153.ams2.redhat.com [10.36.113.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D3B71036B47; Wed, 25 Mar 2020 19:05:29 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 2/2] Revert "NetworkPkg/TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval" To: devel@edk2.groups.io, michael.kubacki@outlook.com Cc: Siyuan Fu , Maciej Rabeda , Jiaxin Wu References: <20200325025932.13828-1-michael.kubacki@outlook.com> From: "Laszlo Ersek" Message-ID: Date: Wed, 25 Mar 2020 20:05:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 03/25/20 03:59, Michael Kubacki wrote: > From: Michael Kubacki > > This reverts commit 6896efdec2709e530b23c688cf0f31706709a0c5. > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2062 > > 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/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 = NULL; > CACertData = NULL; > Data = NULL; > - CurrentData = NULL; > Attr = 0; > > Status = ReadFileContent ( > @@ -712,30 +710,11 @@ EnrollX509toVariable ( > Status = gRT->GetVariable( > VariableName, > &gEfiTlsCaCertificateGuid, > - NULL, > + &Attr, > &DataSize, > NULL > ); > if (Status == 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 = AllocatePool (DataSize); > - if (CurrentData == NULL) { > - Status = EFI_OUT_OF_RESOURCES; > - goto ON_EXIT; > - } > - Status = gRT->GetVariable( > - VariableName, > - &gEfiTlsCaCertificateGuid, > - &Attr, > - &DataSize, > - CurrentData > - ); > - if (EFI_ERROR (Status)) { > - goto ON_EXIT; > - } > Attr |= EFI_VARIABLE_APPEND_WRITE; > } else if (Status == EFI_NOT_FOUND) { > Attr = TLS_AUTH_CONFIG_VAR_BASE_ATTR; > @@ -766,10 +745,6 @@ ON_EXIT: > FreePool (Data); > } > > - if (CurrentData != NULL) { > - FreePool (CurrentData); > - } > - > if (X509Data != NULL) { > FreePool (X509Data); > } >