mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-07 19:45:07 +02:00
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>
This commit is contained in:
parent
91a33d4113
commit
9bb1f080c4
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user