From: "Wu, Jiaxin" <jiaxin.wu@intel.com>
To: "michael.kubacki@outlook.com" <michael.kubacki@outlook.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Laszlo Ersek <lersek@redhat.com>,
"Fu, Siyuan" <siyuan.fu@intel.com>,
Maciej Rabeda <maciej.rabeda@linux.intel.com>
Subject: Re: [PATCH v3 3/3] Revert "NetworkPkg/TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval"
Date: Wed, 1 Apr 2020 00:24:30 +0000 [thread overview]
Message-ID: <895558F6EA4E3B41AC93A00D163B72741705ED38@SHSMSX107.ccr.corp.intel.com> (raw)
In-Reply-To: <MWHPR07MB3440F3786F308F641A8284D0E9CC0@MWHPR07MB3440.namprd07.prod.outlook.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
> -----Original Message-----
> From: michael.kubacki@outlook.com <michael.kubacki@outlook.com>
> Sent: Saturday, March 28, 2020 5:56 AM
> To: devel@edk2.groups.io
> Cc: Laszlo Ersek <lersek@redhat.com>; Fu, Siyuan <siyuan.fu@intel.com>;
> Maciej Rabeda <maciej.rabeda@linux.intel.com>; Wu, Jiaxin
> <jiaxin.wu@intel.com>
> Subject: [PATCH v3 3/3] Revert "NetworkPkg/TlsAuthConfigDxe: fix
> TlsCaCertificate attributes retrieval"
>
> From: Michael Kubacki <michael.kubacki@microsoft.com>
>
> 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 <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>
> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> ---
> NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c | 27 +-------------------
> 1 file changed, 1 insertion(+), 26 deletions(-)
>
> 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);
> }
> --
> 2.16.3.windows.1
prev parent reply other threads:[~2020-04-01 0:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200327215536.9556-1-michael.kubacki@outlook.com>
2020-03-27 21:55 ` [PATCH v3 1/3] MdeModulePkg Variable: Return GetVariable() attr if EFI_BUFFER_TOO_SMALL Michael Kubacki
2020-03-30 4:15 ` Wang, Jian J
2020-03-31 8:18 ` [edk2-devel] " Guomin Jiang
2020-03-31 17:11 ` Michael Kubacki
2020-04-01 2:37 ` Guomin Jiang
2020-03-27 21:55 ` [PATCH v3 2/3] MdeModulePkg VariablePei: " Michael Kubacki
2020-03-30 4:19 ` Wang, Jian J
2020-03-31 8:04 ` [edk2-devel] " Guomin Jiang
2020-03-27 21:55 ` [PATCH v3 3/3] Revert "NetworkPkg/TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval" Michael Kubacki
2020-04-01 0:24 ` Wu, Jiaxin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=895558F6EA4E3B41AC93A00D163B72741705ED38@SHSMSX107.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox