NetworkPkg/HttpBootDxe: Add Support for HTTP Boot Basic Authentication

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2504

Add support for TLS Client Authentication using Basic Authentication
for HTTP Boot

Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
This commit is contained in:
Saloni Kasbekar
2022-07-19 06:54:22 -07:00
committed by mergify[bot]
parent 19a8768365
commit 671b0cea51
6 changed files with 143 additions and 5 deletions

View File

@ -360,7 +360,18 @@ HttpBootLoadFile (
NULL,
&Private->ImageType
);
if (EFI_ERROR (Status) && (Status != EFI_BUFFER_TOO_SMALL)) {
if ((Private->AuthData != NULL) && (Status == EFI_ACCESS_DENIED)) {
//
// Try to use HTTP HEAD method again since the Authentication information is provided.
//
Status = HttpBootGetBootFile (
Private,
TRUE,
&Private->BootFileSize,
NULL,
&Private->ImageType
);
} else if ((EFI_ERROR (Status)) && (Status != EFI_BUFFER_TOO_SMALL)) {
//
// Failed to get file size by HEAD method, may be trunked encoding, try HTTP GET method.
//
@ -489,6 +500,16 @@ HttpBootStop (
}
}
if (Private->AuthData != NULL) {
FreePool (Private->AuthData);
Private->AuthData = NULL;
}
if (Private->AuthScheme != NULL) {
FreePool (Private->AuthScheme);
Private->AuthScheme = NULL;
}
if (Private->DnsServerIp != NULL) {
FreePool (Private->DnsServerIp);
Private->DnsServerIp = NULL;