summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/TlsAuthConfigDxe
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2020-03-28 05:55:36 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-04-07 13:51:24 +0000
commit9bb1f080c45f7253f9270662d55865a8718cebc8 (patch)
tree89e6d7cddf41a16ae8a37a17fd1f1076a928f266 /NetworkPkg/TlsAuthConfigDxe
parent91a33d41139b4ab8c446567cbe09e10501224277 (diff)
downloadedk2-9bb1f080c45f7253f9270662d55865a8718cebc8.tar.gz
edk2-9bb1f080c45f7253f9270662d55865a8718cebc8.tar.bz2
edk2-9bb1f080c45f7253f9270662d55865a8718cebc8.zip
Revert "TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval"
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> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Diffstat (limited to 'NetworkPkg/TlsAuthConfigDxe')
-rw-r--r--NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
index 715bc3a0a9..2481d1098f 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);
}