Revert "TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval"
This reverts commit6896efdec2
. REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2062 GetVariable() now returns attributes when it fails with EFI_BUFFER_TOO_SMALL. Therefore, commit6896efdec2
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:
committed by
mergify[bot]
parent
91a33d4113
commit
9bb1f080c4
@ -657,7 +657,6 @@ EnrollX509toVariable (
|
|||||||
EFI_SIGNATURE_LIST *CACert;
|
EFI_SIGNATURE_LIST *CACert;
|
||||||
EFI_SIGNATURE_DATA *CACertData;
|
EFI_SIGNATURE_DATA *CACertData;
|
||||||
VOID *Data;
|
VOID *Data;
|
||||||
VOID *CurrentData;
|
|
||||||
UINTN DataSize;
|
UINTN DataSize;
|
||||||
UINTN SigDataSize;
|
UINTN SigDataSize;
|
||||||
UINT32 Attr;
|
UINT32 Attr;
|
||||||
@ -669,7 +668,6 @@ EnrollX509toVariable (
|
|||||||
CACert = NULL;
|
CACert = NULL;
|
||||||
CACertData = NULL;
|
CACertData = NULL;
|
||||||
Data = NULL;
|
Data = NULL;
|
||||||
CurrentData = NULL;
|
|
||||||
Attr = 0;
|
Attr = 0;
|
||||||
|
|
||||||
Status = ReadFileContent (
|
Status = ReadFileContent (
|
||||||
@ -712,30 +710,11 @@ EnrollX509toVariable (
|
|||||||
Status = gRT->GetVariable(
|
Status = gRT->GetVariable(
|
||||||
VariableName,
|
VariableName,
|
||||||
&gEfiTlsCaCertificateGuid,
|
&gEfiTlsCaCertificateGuid,
|
||||||
NULL,
|
&Attr,
|
||||||
&DataSize,
|
&DataSize,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
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;
|
Attr |= EFI_VARIABLE_APPEND_WRITE;
|
||||||
} else if (Status == EFI_NOT_FOUND) {
|
} else if (Status == EFI_NOT_FOUND) {
|
||||||
Attr = TLS_AUTH_CONFIG_VAR_BASE_ATTR;
|
Attr = TLS_AUTH_CONFIG_VAR_BASE_ATTR;
|
||||||
@ -766,10 +745,6 @@ ON_EXIT:
|
|||||||
FreePool (Data);
|
FreePool (Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CurrentData != NULL) {
|
|
||||||
FreePool (CurrentData);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (X509Data != NULL) {
|
if (X509Data != NULL) {
|
||||||
FreePool (X509Data);
|
FreePool (X509Data);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user