During clean up the HTTP child, all resources used by it should be cleaned. But
currently, TLS instance is not destroyed.
This patch is to fix this issue.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
\r
HttpInstance->TlsChildHandle = TlsCreateChild (\r
ImageHandle,\r
\r
HttpInstance->TlsChildHandle = TlsCreateChild (\r
ImageHandle,\r
+ &(HttpInstance->TlsSb),\r
&(HttpInstance->Tls),\r
&(HttpInstance->TlsConfiguration)\r
);\r
&(HttpInstance->Tls),\r
&(HttpInstance->TlsConfiguration)\r
);\r
NetMapClean (&HttpInstance->TxTokens);\r
NetMapClean (&HttpInstance->RxTokens);\r
\r
NetMapClean (&HttpInstance->TxTokens);\r
NetMapClean (&HttpInstance->RxTokens);\r
\r
+ if (HttpInstance->TlsSb != NULL && HttpInstance->TlsChildHandle != NULL) {\r
+ //\r
+ // Destroy the TLS instance. \r
+ //
+ HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->TlsChildHandle);\r
+ }\r
+\r
if (HttpInstance->Tcp4ChildHandle != NULL) {\r
gBS->CloseProtocol (\r
HttpInstance->Tcp4ChildHandle,\r
if (HttpInstance->Tcp4ChildHandle != NULL) {\r
gBS->CloseProtocol (\r
HttpInstance->Tcp4ChildHandle,\r
// Https Support\r
//\r
BOOLEAN UseHttps;\r
// Https Support\r
//\r
BOOLEAN UseHttps;\r
+\r
+ EFI_SERVICE_BINDING_PROTOCOL *TlsSb;\r
EFI_HANDLE TlsChildHandle; /// Tls ChildHandle\r
TLS_CONFIG_DATA TlsConfigData;\r
EFI_TLS_PROTOCOL *Tls;\r
EFI_HANDLE TlsChildHandle; /// Tls ChildHandle\r
TLS_CONFIG_DATA TlsConfigData;\r
EFI_TLS_PROTOCOL *Tls;\r
Creates a Tls child handle, open EFI_TLS_PROTOCOL and EFI_TLS_CONFIGURATION_PROTOCOL.\r
\r
@param[in] ImageHandle The firmware allocated handle for the UEFI image.\r
Creates a Tls child handle, open EFI_TLS_PROTOCOL and EFI_TLS_CONFIGURATION_PROTOCOL.\r
\r
@param[in] ImageHandle The firmware allocated handle for the UEFI image.\r
+ @param[out] TlsSb Pointer to the TLS SERVICE_BINDING_PROTOCOL.\r
@param[out] TlsProto Pointer to the EFI_TLS_PROTOCOL instance.\r
@param[out] TlsConfiguration Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.\r
\r
@param[out] TlsProto Pointer to the EFI_TLS_PROTOCOL instance.\r
@param[out] TlsConfiguration Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.\r
\r
EFIAPI\r
TlsCreateChild (\r
IN EFI_HANDLE ImageHandle,\r
EFIAPI\r
TlsCreateChild (\r
IN EFI_HANDLE ImageHandle,\r
+ OUT EFI_SERVICE_BINDING_PROTOCOL **TlsSb,\r
OUT EFI_TLS_PROTOCOL **TlsProto,\r
OUT EFI_TLS_CONFIGURATION_PROTOCOL **TlsConfiguration\r
)\r
{\r
EFI_STATUS Status;\r
OUT EFI_TLS_PROTOCOL **TlsProto,\r
OUT EFI_TLS_CONFIGURATION_PROTOCOL **TlsConfiguration\r
)\r
{\r
EFI_STATUS Status;\r
- EFI_SERVICE_BINDING_PROTOCOL *TlsSb;\r
EFI_HANDLE TlsChildHandle;\r
\r
EFI_HANDLE TlsChildHandle;\r
\r
TlsChildHandle = 0;\r
\r
//\r
TlsChildHandle = 0;\r
\r
//\r
gBS->LocateProtocol (\r
&gEfiTlsServiceBindingProtocolGuid,\r
NULL,\r
gBS->LocateProtocol (\r
&gEfiTlsServiceBindingProtocolGuid,\r
NULL,\r
+ if (*TlsSb == NULL) {\r
- Status = TlsSb->CreateChild (TlsSb, &TlsChildHandle);\r
+ Status = (*TlsSb)->CreateChild (*TlsSb, &TlsChildHandle);\r
if (EFI_ERROR (Status)) {\r
return NULL;\r
}\r
if (EFI_ERROR (Status)) {\r
return NULL;\r
}\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
);\r
if (EFI_ERROR (Status)) {\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
);\r
if (EFI_ERROR (Status)) {\r
- TlsSb->DestroyChild (TlsSb, TlsChildHandle);\r
+ (*TlsSb)->DestroyChild (*TlsSb, TlsChildHandle);\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
);\r
if (EFI_ERROR (Status)) {\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
);\r
if (EFI_ERROR (Status)) {\r
- TlsSb->DestroyChild (TlsSb, TlsChildHandle);\r
+ (*TlsSb)->DestroyChild (*TlsSb, TlsChildHandle);\r
/** @file\r
The header files of miscellaneous routines specific to Https for HttpDxe driver.\r
\r
/** @file\r
The header files of miscellaneous routines specific to Https for HttpDxe driver.\r
\r
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
Creates a Tls child handle, open EFI_TLS_PROTOCOL and EFI_TLS_CONFIGURATION_PROTOCOL.\r
\r
@param[in] ImageHandle The firmware allocated handle for the UEFI image.\r
Creates a Tls child handle, open EFI_TLS_PROTOCOL and EFI_TLS_CONFIGURATION_PROTOCOL.\r
\r
@param[in] ImageHandle The firmware allocated handle for the UEFI image.\r
+ @param[out] TlsSb Pointer to the TLS SERVICE_BINDING_PROTOCOL.\r
@param[out] TlsProto Pointer to the EFI_TLS_PROTOCOL instance.\r
@param[out] TlsConfiguration Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.\r
\r
@param[out] TlsProto Pointer to the EFI_TLS_PROTOCOL instance.\r
@param[out] TlsConfiguration Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.\r
\r
EFIAPI\r
TlsCreateChild (\r
IN EFI_HANDLE ImageHandle,\r
EFIAPI\r
TlsCreateChild (\r
IN EFI_HANDLE ImageHandle,\r
+ OUT EFI_SERVICE_BINDING_PROTOCOL **TlsSb,\r
OUT EFI_TLS_PROTOCOL **TlsProto,\r
OUT EFI_TLS_CONFIGURATION_PROTOCOL **TlsConfiguration\r
);\r
OUT EFI_TLS_PROTOCOL **TlsProto,\r
OUT EFI_TLS_CONFIGURATION_PROTOCOL **TlsConfiguration\r
);\r