From nobody Fri May 17 11:58:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113328+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 170463404485391.76878046509137; Sun, 7 Jan 2024 05:27:24 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=6Hp/s6IPOLM/3aIeZ3Hkp9Fq8NAjRE84Mx1B9CFrURU=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1704634044; v=1; b=sjJ1W/XgpzKili0o1fHw67p5ZxN5xi8QZs7xGoC3+X0NNRqjesQtUHrMoaqQrDsBswEhmLLJ om+btLMaom5YWvbmaq1v9Du7YMC08qvfeYh+Y6VR1jC3IM4DDOU02OMxXvk4xdABEvfw1kUj+v8 TNoVjJ0Jr9bPhMPWIUXq7mPc= X-Received: by 127.0.0.2 with SMTP id PPEYYY1788612xdsxaCpQ11u; Sun, 07 Jan 2024 05:27:24 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.87]) by mx.groups.io with SMTP id smtpd.web10.14893.1704634043752176984 for ; Sun, 07 Jan 2024 05:27:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MZcKs4JIwnFEo1/SQjvyZ0I4ckXf993Ry9DWvT1PJOKQdw1ETyDnaV+ajuyXbvmJ63osdgjmrKgdKNZw57YvZf9LbAyjNuGkTCZetnuCAVP1I7zBaL420487mJWK2gVtYh5IQhCsus76U4h9UjgL5uVR6NDwK4tqeooB1IABSLBe4vBXGWFRhdJdBPhvez41ptLIPFzR6uPjo82R4tm0+ttk69dkt1drDykx/N9ecA1vlvXI8bwqGZjtCjG3nHkM4ZjxRpz4mthlsbUx5aOJHaQIOf579jgGGRiGphCwq3/z239MdWtMnK8Xk9AHY6OCrV3hchatk8bKsqV5jJqzbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pn4y/huqLk3tVPPvOQDSd87eKsG1yaXN0nUsnjkKPKw=; b=ChkNl8GflY+Q6HOYza1DWaYvfIuBxp3Ui7qbqW6zuF9XfGLp9dmdI0LvF2SQ+dilsF09z7dWjtew//XpBxnuoYcLPka/OM7CzCEa/wLkQDy+7XoHdQkhJwooBuzbciuRe0re/R/YeFjpd8hCgGSSEggYNqu4P4oF9Amk5+doTiYSL4R4ZIBnIT/NMIG3D64d5PO5dDs2pW8QIqfeCWBCnOvt7paE3Xs0UZ4z9sl7OrOVlK+kDQxxaJeFqd8CX5RztvSVM1E9e/+xnm1awgLtQStCu7vq2XX4OeRVOuR8WPFAxKqKVZA0cV+Of9eASihHVew1JvP7RDbB+iW242Kbig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from BL1PR13CA0386.namprd13.prod.outlook.com (2603:10b6:208:2c0::31) by MN6PR12MB8567.namprd12.prod.outlook.com (2603:10b6:208:478::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Sun, 7 Jan 2024 13:27:19 +0000 X-Received: from BL6PEPF0001AB4A.namprd04.prod.outlook.com (2603:10b6:208:2c0:cafe::34) by BL1PR13CA0386.outlook.office365.com (2603:10b6:208:2c0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.13 via Frontend Transport; Sun, 7 Jan 2024 13:27:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113328+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB4A.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.13 via Frontend Transport; Sun, 7 Jan 2024 13:27:19 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Sun, 7 Jan 2024 07:27:17 -0600 From: "Chang, Abner via groups.io" To: CC: Saloni Kasbekar , Zachary Clark-williams , Michael Brown , Nickle Wang , Igor Kulchytskyy Subject: [edk2-devel] [PATCH V2 1/6] NetworkPkg/HttpDxe: Refactor TlsCreateChild Date: Sun, 7 Jan 2024 21:26:56 +0800 Message-ID: <20240107132701.302-2-abner.chang@amd.com> In-Reply-To: <20240107132701.302-1-abner.chang@amd.com> References: <20240107132701.302-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4A:EE_|MN6PR12MB8567:EE_ X-MS-Office365-Filtering-Correlation-Id: f9dfebcb-6a9f-4142-88c7-08dc0f845f96 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: HbjMXl5zaHcylWtX4/h1Ni8OCE43xpQfn7bgJlL4VAKRFKYyyOk1HZKURhSAul3CLCLp2gATsXBHD/vKoNgakWIAxajQrut+fhykCSC80cbSliQ94Xuil7ek0mvNhhpDv8tolRTEnwJhWvDEBUkBdS+bmCh7FNIhtyfUV3hSi7IFtY9tKXs+EvwBn7LgbglQPezh258x5iIUj+95iQrbUNOdgYT4nmFuY/BkOOnDC0/KMwFERh8CBt4KewisY8dhbRvw+svxNCjN+Oxu0Jurn5EG1zFCLxiesuNg4eq94gwWOOmV0aa+l8T+ZGcs11nZLZGtI3E5im9ZydggPTBsHG8zDvHbI00ayhmVaYFDOhS21EN4AzF/iR/yMu4rwnlF4iWq8+PdiOUa4gC8NFtbK5htJNBY428t03fnlZ5VKSsHxhbm2xlKn4Rp23rHQX3QNJRul5DO09ZiUZRB6ATyisvTRYyiW6JDvEqS7Fhusv0pEIsjaYFRn/PS9LJ0yHWqGkJchFXXF7pKI09ma6Wr4/6e9ppiKZ2ZfigQ33doukfx41xwqSHb7RUDytv8bnQBrTEG96fmu4P0yijRwhij4gBTZXtnzDfbotiUmMxc49I5lQv4qjTRCZ6uHxBoiAjobs3TpxCXysCQq5R9d4UhUGI37vyKJgOlEHNRI6UuJtS98TUmMVGcdBVRp+F+Wr2XaW5NYkFIih1ZXhq/QCoWGZEx8fjdGzOOIyF+IJTVIs9FmoYUfb+9HCDyZf3hYGtNR9Zgo9BbPDnWVjbbmEuXvGhDXq4c6fWVY5AQ4PotN4KPZeQg9om50EHO432vZmV/ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2024 13:27:19.2943 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f9dfebcb-6a9f-4142-88c7-08dc0f845f96 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR12MB8567 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: tNUbaRizT3OugymqOoKMTe5vx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704634045503100003 Content-Type: text/plain; charset="utf-8" From: Abner Chang - Use HTTP instance as the parameter for TlsCreateChild function. - Install TLS protocol on the HTTP instance thats create TLS child. Signed-off-by: Abner Chang Cc: Saloni Kasbekar Cc: Zachary Clark-williams Cc: Michael Brown Cc: Nickle Wang Cc: Igor Kulchytskyy Reviewed-by: Michael Brown Reviewed-by: Saloni Kasbekar --- NetworkPkg/HttpDxe/HttpProto.h | 3 +- NetworkPkg/HttpDxe/HttpsSupport.h | 18 ++++--- NetworkPkg/HttpDxe/HttpImpl.c | 23 ++------- NetworkPkg/HttpDxe/HttpProto.c | 7 +-- NetworkPkg/HttpDxe/HttpsSupport.c | 78 ++++++++++++++++++------------- 5 files changed, 64 insertions(+), 65 deletions(-) diff --git a/NetworkPkg/HttpDxe/HttpProto.h b/NetworkPkg/HttpDxe/HttpProto.h index 012f1f4b467..7e77b389a78 100644 --- a/NetworkPkg/HttpDxe/HttpProto.h +++ b/NetworkPkg/HttpDxe/HttpProto.h @@ -3,6 +3,7 @@ =20 Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
+Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -171,7 +172,7 @@ typedef struct _HTTP_PROTOCOL { BOOLEAN UseHttps; =20 EFI_SERVICE_BINDING_PROTOCOL *TlsSb; - EFI_HANDLE TlsChildHandle; /// Tls ChildHandle + BOOLEAN TlsAlreadyCreated; TLS_CONFIG_DATA TlsConfigData; EFI_TLS_PROTOCOL *Tls; EFI_TLS_CONFIGURATION_PROTOCOL *TlsConfiguration; diff --git a/NetworkPkg/HttpDxe/HttpsSupport.h b/NetworkPkg/HttpDxe/HttpsSu= pport.h index 3c70825e8c3..5b44c7ac395 100644 --- a/NetworkPkg/HttpDxe/HttpsSupport.h +++ b/NetworkPkg/HttpDxe/HttpsSupport.h @@ -2,6 +2,7 @@ The header files of miscellaneous routines specific to Https for HttpDxe= driver. =20 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
+Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -30,21 +31,18 @@ IsHttpsUrl ( /** Creates a Tls child handle, open EFI_TLS_PROTOCOL and EFI_TLS_CONFIGURAT= ION_PROTOCOL. =20 - @param[in] ImageHandle The firmware allocated handle for the = UEFI image. - @param[out] TlsSb Pointer to the TLS SERVICE_BINDING_PRO= TOCOL. - @param[out] TlsProto Pointer to the EFI_TLS_PROTOCOL instan= ce. - @param[out] TlsConfiguration Pointer to the EFI_TLS_CONFIGURATION_P= ROTOCOL instance. + @param[in] HttpInstance Pointer to HTTP_PROTOCOL structure. =20 - @return The child handle with opened EFI_TLS_PROTOCOL and EFI_TLS_CONFI= GURATION_PROTOCOL. + @return EFI_SUCCESS TLS child handle is returned in HttpInstance= ->TlsChildHandle + with opened EFI_TLS_PROTOCOL and EFI_TLS_CON= FIGURATION_PROTOCOL. + EFI_DEVICE_ERROR TLS service binding protocol is not found. + Otherwise Fail to create TLS chile handle. =20 **/ -EFI_HANDLE +EFI_STATUS EFIAPI TlsCreateChild ( - IN EFI_HANDLE ImageHandle, - OUT EFI_SERVICE_BINDING_PROTOCOL **TlsSb, - OUT EFI_TLS_PROTOCOL **TlsProto, - OUT EFI_TLS_CONFIGURATION_PROTOCOL **TlsConfiguration + IN HTTP_PROTOCOL *HttpInstance ); =20 /** diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 7c5c925cf78..6606c293421 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -3,6 +3,7 @@ =20 Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
+ Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -248,7 +249,6 @@ EfiHttpRequest ( HTTP_TOKEN_WRAP *Wrap; CHAR8 *FileUrl; UINTN RequestMsgSize; - EFI_HANDLE ImageHandle; =20 // // Initializations @@ -371,23 +371,10 @@ EfiHttpRequest ( // // Check whether we need to create Tls child and open the TLS protocol. // - if (HttpInstance->UseHttps && (HttpInstance->TlsChildHandle =3D=3D NUL= L)) { - // - // Use TlsSb to create Tls child and open the TLS protocol. - // - if (HttpInstance->LocalAddressIsIPv6) { - ImageHandle =3D HttpInstance->Service->Ip6DriverBindingHandle; - } else { - ImageHandle =3D HttpInstance->Service->Ip4DriverBindingHandle; - } - - HttpInstance->TlsChildHandle =3D TlsCreateChild ( - ImageHandle, - &(HttpInstance->TlsSb), - &(HttpInstance->Tls), - &(HttpInstance->TlsConfiguration) - ); - if (HttpInstance->TlsChildHandle =3D=3D NULL) { + if (HttpInstance->UseHttps && !HttpInstance->TlsAlreadyCreated) { + // Create TLS child for this HTTP instance. + Status =3D TlsCreateChild (HttpInstance); + if (EFI_ERROR (Status)) { return EFI_DEVICE_ERROR; } =20 diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c index 7dfb82dd2e5..94900328ba9 100644 --- a/NetworkPkg/HttpDxe/HttpProto.c +++ b/NetworkPkg/HttpDxe/HttpProto.c @@ -3,6 +3,7 @@ =20 Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
+Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -852,12 +853,12 @@ HttpCleanProtocol ( NetMapClean (&HttpInstance->TxTokens); NetMapClean (&HttpInstance->RxTokens); =20 - if ((HttpInstance->TlsSb !=3D NULL) && (HttpInstance->TlsChildHandle != =3D NULL)) { + if ((HttpInstance->TlsSb !=3D NULL) && HttpInstance->TlsAlreadyCreated) { // // Destroy the TLS instance. // - HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->= TlsChildHandle); - HttpInstance->TlsChildHandle =3D NULL; + HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->= Handle); + HttpInstance->TlsAlreadyCreated =3D FALSE; } =20 if (HttpInstance->Tcp4ChildHandle !=3D NULL) { diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c b/NetworkPkg/HttpDxe/HttpsSu= pport.c index 7330be42c00..a07323ff0bd 100644 --- a/NetworkPkg/HttpDxe/HttpsSupport.c +++ b/NetworkPkg/HttpDxe/HttpsSupport.c @@ -3,6 +3,7 @@ =20 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
+Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -134,27 +135,31 @@ IsHttpsUrl ( /** Creates a Tls child handle, open EFI_TLS_PROTOCOL and EFI_TLS_CONFIGURAT= ION_PROTOCOL. =20 - @param[in] ImageHandle The firmware allocated handle for the = UEFI image. - @param[out] TlsSb Pointer to the TLS SERVICE_BINDING_PRO= TOCOL. - @param[out] TlsProto Pointer to the EFI_TLS_PROTOCOL instan= ce. - @param[out] TlsConfiguration Pointer to the EFI_TLS_CONFIGURATION_P= ROTOCOL instance. + @param[in] HttpInstance Pointer to HTTP_PROTOCOL structure. =20 - @return The child handle with opened EFI_TLS_PROTOCOL and EFI_TLS_CONFI= GURATION_PROTOCOL. + @return EFI_SUCCESS TLS child handle is returned in HttpInstance= ->TlsChildHandle + with opened EFI_TLS_PROTOCOL and EFI_TLS_CON= FIGURATION_PROTOCOL. + EFI_DEVICE_ERROR TLS service binding protocol is not found. + Otherwise Fail to create TLS chile handle. =20 **/ -EFI_HANDLE +EFI_STATUS EFIAPI TlsCreateChild ( - IN EFI_HANDLE ImageHandle, - OUT EFI_SERVICE_BINDING_PROTOCOL **TlsSb, - OUT EFI_TLS_PROTOCOL **TlsProto, - OUT EFI_TLS_CONFIGURATION_PROTOCOL **TlsConfiguration + IN HTTP_PROTOCOL *HttpInstance ) { + EFI_HANDLE ImageHandle; EFI_STATUS Status; - EFI_HANDLE TlsChildHandle; =20 - TlsChildHandle =3D 0; + // + // Use TlsSb to create Tls child and open the TLS protocol. + // + if (HttpInstance->LocalAddressIsIPv6) { + ImageHandle =3D HttpInstance->Service->Ip6DriverBindingHandle; + } else { + ImageHandle =3D HttpInstance->Service->Ip4DriverBindingHandle; + } =20 // // Locate TlsServiceBinding protocol. @@ -162,44 +167,51 @@ TlsCreateChild ( gBS->LocateProtocol ( &gEfiTlsServiceBindingProtocolGuid, NULL, - (VOID **)TlsSb + (VOID **)&HttpInstance->TlsSb ); - if (*TlsSb =3D=3D NULL) { - return NULL; + if (HttpInstance->TlsSb =3D=3D NULL) { + return EFI_DEVICE_ERROR; } =20 - Status =3D (*TlsSb)->CreateChild (*TlsSb, &TlsChildHandle); + // + // Create TLS protocol on HTTP handle, this creates the association betw= een HTTP and TLS + // for HTTP driver external usages. + // + Status =3D HttpInstance->TlsSb->CreateChild (HttpInstance->TlsSb, &HttpI= nstance->Handle); if (EFI_ERROR (Status)) { - return NULL; + return Status; } =20 - Status =3D gBS->OpenProtocol ( - TlsChildHandle, - &gEfiTlsProtocolGuid, - (VOID **)TlsProto, - ImageHandle, - TlsChildHandle, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); + HttpInstance->TlsAlreadyCreated =3D TRUE; + Status =3D gBS->OpenProtocol ( + HttpInstance->Handle, + &gEfiTlsProtocolGuid, + (VOID **)&HttpInstance->Tls, + ImageHandle, + HttpInstance->Handle, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); if (EFI_ERROR (Status)) { - (*TlsSb)->DestroyChild (*TlsSb, TlsChildHandle); - return NULL; + HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->= Handle); + HttpInstance->TlsAlreadyCreated =3D FALSE; + return Status; } =20 Status =3D gBS->OpenProtocol ( - TlsChildHandle, + HttpInstance->Handle, &gEfiTlsConfigurationProtocolGuid, - (VOID **)TlsConfiguration, + (VOID **)&HttpInstance->TlsConfiguration, ImageHandle, - TlsChildHandle, + HttpInstance->Handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); if (EFI_ERROR (Status)) { - (*TlsSb)->DestroyChild (*TlsSb, TlsChildHandle); - return NULL; + HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->= Handle); + HttpInstance->TlsAlreadyCreated =3D FALSE; + return Status; } =20 - return TlsChildHandle; + return EFI_SUCCESS; } =20 /** --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113328): https://edk2.groups.io/g/devel/message/113328 Mute This Topic: https://groups.io/mt/103577242/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 11:58:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113329+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704634063663933.3519812649407; Sun, 7 Jan 2024 05:27:43 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=OK9WrKlA9Qm/+OU8tQSsRmBTyvLI8ThM4T6S+bylr8w=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1704634063; v=1; b=pVps6HUN9ssbdf/LNQVHnIY/7JF5DzJzqvjpP7I66s3fUKS7FwXTVarKqWZGSLhWLthLdaGX dlmqhG4SWLKoWGZRXfUb05PUkBSUnMhMvdSwjUIucW/YWmJCgib/xyNJcEFspVNSOlLeESV1zcL 3pZK6QRed3W3m2YtEKPBJooM= X-Received: by 127.0.0.2 with SMTP id HKEZYY1788612xTwrmXkjE6U; Sun, 07 Jan 2024 05:27:43 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.41]) by mx.groups.io with SMTP id smtpd.web11.14875.1704634062411129769 for ; Sun, 07 Jan 2024 05:27:42 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jF7Mmfg6oMUggJPkwwmLGOgftEU9U8CzIm5+by7YAFq/R7Vwf6EnLBxCzkijS5KpYiYqfejQhy/AhYrmB8ygdWGD7JMEFA3gSN+y2J21AfPxpa5LHDG3feE/g6aAsTHEgCL5gDeYoUcTaAWBCusytNi0zvmvBJ6h5l9i0K58kxxEhOFqMLMFuZDnhS44pgBU+/7kSw3aL34ySRohtyZ7pt08VvFZcZ4dSzOdeG7AGwagwST70Mt5NeHxLlyjwvaq9BJRi/cwlyzaOzonlfu4DNplCEpBQQtn+Bsr+a7FmRidQJ4pns9M42AyD4V+EEh7CpDDlXxq0fQGnsCUeWO6Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pB0w99VuPUV0zuRxssAa8PMHd9VoZGl9/35puTXZfE4=; b=SYzbeCXgRQSsb/1aXVzORr4hy3kK1CxSDCqPP0WqFbOnxCWBmOopZt6ml/aaSPDEvmDKqSymdqqBQOcSzXA9RcDtQ5PfXYtHyloT+bM3d5vr67ouyETPmAfS70Sj34QmDRoOCyBpUvbq0zpPwzJM8M3sGRDbv9LXrkKDFpr8ggtrkNAdiIRMD9FyssC8N3ROHMFRzbeVZRYI1Z0AzWyOX6qAxvR9AzYWa9FiiQxoSrtMvZMZ4bZTI2MUixdLOoc39Cyn6/gYT6yxwlKttD1H15zNsDNvpI2dzhlGX2Pjjyq74LdinNXkqEbrad2th3WSs8t4No5YlXRWQFNWs3UPLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from BL0PR02CA0006.namprd02.prod.outlook.com (2603:10b6:207:3c::19) by CY5PR12MB6249.namprd12.prod.outlook.com (2603:10b6:930:23::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Sun, 7 Jan 2024 13:27:38 +0000 X-Received: from BL6PEPF0001AB4F.namprd04.prod.outlook.com (2603:10b6:207:3c:cafe::37) by BL0PR02CA0006.outlook.office365.com (2603:10b6:207:3c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21 via Frontend Transport; Sun, 7 Jan 2024 13:27:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113329+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB4F.mail.protection.outlook.com (10.167.242.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.13 via Frontend Transport; Sun, 7 Jan 2024 13:27:38 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Sun, 7 Jan 2024 07:27:19 -0600 From: "Chang, Abner via groups.io" To: CC: Saloni Kasbekar , Zachary Clark-williams , Michael Brown , Nickle Wang , Igor Kulchytskyy Subject: [edk2-devel] [PATCH V2 2/6] NetworkPkg/HttpDxe: Consider TLS certificate not found as a success case Date: Sun, 7 Jan 2024 21:26:57 +0800 Message-ID: <20240107132701.302-3-abner.chang@amd.com> In-Reply-To: <20240107132701.302-1-abner.chang@amd.com> References: <20240107132701.302-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4F:EE_|CY5PR12MB6249:EE_ X-MS-Office365-Filtering-Correlation-Id: 18f6cd72-f173-42df-ae90-08dc0f846adb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: jZ9yqhAN1P8z+uWHVL7uxEV9IRX3m1mrtjxFCBtI0DC4vLtrF6nbPj7bpQteLkdoj3CI6vWvltM4fndVGPDGpSDx8q8IfHOdSCfThW4I6CkbhO/gU3XKJ238v0tHvE9DhnFeOJxcB3/81LxECPu2HUKOfBYeqmpKYW7/u0pxf/+cByPBz9qK9/Kn5UZYpM78pTveS5cmn1itRQQvpmiY1NeqsLFaUMuMSwUFpePN52vWDHXqiaCLxWqYpH04ZLpHS54w6Ankj+iU5GiYimlTtubSieACGt3GQRgaG7sfv4slVnHU2GEOkZPnYPzKn7W/iJ6WChaWEUmOOxlmLs0njo9aEdXbSDhokvkjp+VWWdVCNvCKtBmQP09NEUicPDMNMKvo/4te8lEPNic255vbhkdkfmRxRdwMq19Ykrwe64VpKz8dfjRI5v46G5+9J60p9/XAUsex4xw0uK2DwHUIOVciRGJ+xrS3sh2PakToZQ0y6zVmNt5qxGDRIS0skycPrt9dhY4Qn6KlEsQGeBSuBMWv0hpGpfymSWySyQAhhYBt538/2sIXW9MPpaQbF6/htJek86J/z05D0QLZC3nDytPHZBpDQKStQ1ScfcGqqTY6UIYHFRq+2EkeIUQXZLZdwgJtA3sCAMZDv2ugwYO5hJR0YbSty61lbfJ2SZoKwd9Wvo77FwCIC/4Im0kI3sYCsJ5lsuVHPHBTZhnxMXpeRxEfVYHupZuKEaPH6p30VNxKHjT2BNa87y/Ke6l166/3yHYcI7RmsRLQZtRyWtDNNQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2024 13:27:38.2336 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18f6cd72-f173-42df-ae90-08dc0f846adb X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6249 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: chQfw14nlU9ipJkcjZxs3oTyx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704634065421100001 Content-Type: text/plain; charset="utf-8" From: Abner Chang We still return EFI_SUCCESS to the caller when TlsConfigCertificate returns error, for the use case the platform doesn't require certificate for the specific HTTP session. This ensures HttpInitSession function still initiated and returns EFI_SUCCESS to the caller. The failure is pushed back to TLS DXE driver if the HTTP communication actually requires certificate. Signed-off-by: Abner Chang Cc: Saloni Kasbekar Cc: Zachary Clark-williams Cc: Michael Brown Cc: Nickle Wang Cc: Igor Kulchytskyy Reviewed-by: Michael Brown Reviewed-by: Saloni Kasbekar --- NetworkPkg/HttpDxe/HttpsSupport.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c b/NetworkPkg/HttpDxe/HttpsSu= pport.c index a07323ff0bd..04a830f7152 100644 --- a/NetworkPkg/HttpDxe/HttpsSupport.c +++ b/NetworkPkg/HttpDxe/HttpsSupport.c @@ -722,8 +722,21 @@ TlsConfigureSession ( // Status =3D TlsConfigCertificate (HttpInstance); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "TLS Certificate Config Error!\n")); - return Status; + if (Status =3D=3D EFI_NOT_FOUND) { + DEBUG((DEBUG_WARN, "TLS Certificate is not found on the system!\n")); + // + // We still return EFI_SUCCESS to the caller when TlsConfigCertifica= te + // returns error, for the use case the platform doesn't require + // certificate for the specific HTTP session. This ensures + // HttpInitSession function still initiated and returns EFI_SUCCESS = to + // the caller. The failure is pushed back to TLS DXE driver if the + // HTTP communication actually requires certificate. + // + Status =3D EFI_SUCCESS; + } else { + DEBUG((DEBUG_ERROR, "TLS Certificate Config Error!\n")); + return Status; + } } =20 // --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113329): https://edk2.groups.io/g/devel/message/113329 Mute This Topic: https://groups.io/mt/103577245/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 11:58:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113331+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704634066637119.54389006893234; Sun, 7 Jan 2024 05:27:46 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=6VBsWS5d9jE+HDNBt06PetGe3BmcQRxRbu7FCcqlkvc=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1704634066; v=1; b=FcHwoqCJtC4rypEV4FKc1YbuoFaBnFXQkzzWkPl9QWojJu+y/OSF2ShVF3w4ME2UhVlm81bI wzLksPnGsiLwO3qB7XhTDw3S1cRmB08izXSiy0mEjRTk0LVJtDURaiJkwT4tZ/Aogtf6H171NcG qsOtqtauh37/hOqTPS6zmG7Y= X-Received: by 127.0.0.2 with SMTP id nDrfYY1788612xj1eCyG6gr3; Sun, 07 Jan 2024 05:27:46 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.62]) by mx.groups.io with SMTP id smtpd.web10.14903.1704634065777922680 for ; Sun, 07 Jan 2024 05:27:45 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nKrM/co9qafnGWCCa6LCgx2h12NYvirQLC1TjWdyz9sVCIP2WjbbihQHvRN2zEY+leTN2JR31VBemTdujIni49TIurJ1IZ05Y4OBcVwilsPV23tY+KnGZEBAqgM+kh3+D7AcU0jAwxveIvFitn5XB3NZXjyX/Ho235JHcbpY5hvKX2WtRNbRAWfitTuNm6sdEUIosgHYfvCEVR4Fmhvcx3seiZ+nna2dFBEt1jv/hlUZ5vm25XCo65ure+ND7wBh7t3G6Lx/sZPYbkY2oJfuINEJVRlDspTIYyTR15eAF6bOE2ZO3flNXpM2WshqxLNJ8w39/i9A+c9kxIffdArpig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4H70uC2Tlxa04TL4pSoyVmekwRkennv569Z3nRSdkhQ=; b=iHa36QPFSlTXfhZ1oeP7S2DvrwmHj162cJj0c3zFbqG5G/BAh8DNZ605qQhFRKaQ96f5qq+w8HhRi9oMgFKscs57grqnt2CGmOzwzMqlxy9qkbgA/V4sHRAd7PkWcCPElFk7cMNtKFKKLZqhS43L28qWSlVVqDBHxXAqKLT/MY12WX586U1wbjdw5Ey6Jz7Vgn+MRaS9vyX/wWS+LoeUI6V6fd8uD4OkN/7k7YBRUvf/6tvrFM6AJMkY5DxC7Z2GWn9gk3NtkJx7wBzyd5qvYVHg0oRmm7DFwoVGm4+/vo4a1OyqBQu8gUY5uNC1/BiIayZ3QWQxjueT2pigslEUgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from BL1PR13CA0375.namprd13.prod.outlook.com (2603:10b6:208:2c0::20) by DS0PR12MB8245.namprd12.prod.outlook.com (2603:10b6:8:f2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.20; Sun, 7 Jan 2024 13:27:40 +0000 X-Received: from BL6PEPF0001AB4A.namprd04.prod.outlook.com (2603:10b6:208:2c0:cafe::d5) by BL1PR13CA0375.outlook.office365.com (2603:10b6:208:2c0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.13 via Frontend Transport; Sun, 7 Jan 2024 13:27:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113331+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB4A.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.13 via Frontend Transport; Sun, 7 Jan 2024 13:27:40 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Sun, 7 Jan 2024 07:27:38 -0600 From: "Chang, Abner via groups.io" To: CC: Saloni Kasbekar , Zachary Clark-williams , Michael Brown , Nickle Wang , Igor Kulchytskyy Subject: [edk2-devel] [PATCH V2 3/6] NetworkPkg/HttpDxe: Add HttpEventTlsConfigured HTTP callback event Date: Sun, 7 Jan 2024 21:26:58 +0800 Message-ID: <20240107132701.302-4-abner.chang@amd.com> In-Reply-To: <20240107132701.302-1-abner.chang@amd.com> References: <20240107132701.302-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4A:EE_|DS0PR12MB8245:EE_ X-MS-Office365-Filtering-Correlation-Id: f449a6b2-f132-4dda-45d2-08dc0f846c1d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 1VBlOxpydycE+inblEjN2S/JouUsST6+gHwGmLeSGIvne+5BO9XccUXpcu7RpOXwd5t11qjFAW44gv5OCz7pibF8IKBzbxGzfYuwksrvNXMq+v43OHxko2wyzAVEd6MvoG+5UTuU83+JjSoh3rqzRQQxex68w50/B9qh2y5B92XuIh1YkG5UYhe4JpRxFkvbzusOVE83HXdYqLQWey8jNL6YkpbXVz+ri4g+AH5Ybp+gyU8gm8qYselfXgLhWeNCXKmp1ImiHQmSlxuMbN+zePOzcZ3oQVkbK3Fgd8V+U3v+o1KqKFyGmeCJ1sqRyVWE6NejOuH62rp8eXMzqMiZCOttt2wg30aButLy7Kmy6dhibfvVNmYZxUTMB6i8EIiOZqE7f4luUmI6/7AaMsndZeaE25F3rZsR6Duvh9rAiq8Z/kw7u9QUk9MWpiWHjqGh19Wq7+2G5xCnJ+fi2Mup7f129s6O3Bj9OHqVJds+yZuLo0djom1ly95B4UrRdU7Ncq4fyygF6VFtDeQVL8GDCnVRf1hBI5YY/fj1E+yjNESJt8iY8jN2+uZVU8S9sQRENulRMHCEatxnpsnmZ1gygpd7fz0xpaz6VoVJ6hYBlZRRapgiDl2KwVfUlEaR6GFENiYyRd7VnLlfX+RwzVaZNg6egGX9v8dpTg4TfkI5Hbd6922tAYF34kL2V5vy4aH5SxeW7kRCPqRLb8RIymskWHz81CcAJoSRypZMHd9LYtqmxnmyKzYUY0HMXIEtIHrdSQbBlByugVE39bWHCZSM2g== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2024 13:27:40.3256 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f449a6b2-f132-4dda-45d2-08dc0f846c1d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8245 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: C2Gz5CAjAWLYa1907Wphq0SNx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704634067411100005 Content-Type: text/plain; charset="utf-8" From: Abner Chang Add HttpEventTlsConfigured HTTP callback event and notify callback functions when TlsConfigureSession () returns. Signed-off-by: Abner Chang Cc: Saloni Kasbekar Cc: Zachary Clark-williams Cc: Michael Brown Cc: Nickle Wang Cc: Igor Kulchytskyy Reviewed-by: Michael Brown Reviewed-by: Saloni Kasbekar --- NetworkPkg/Include/Protocol/HttpCallback.h | 15 ++++++++++++++- NetworkPkg/HttpDxe/HttpProto.c | 1 + NetworkPkg/HttpDxe/HttpsSupport.c | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/NetworkPkg/Include/Protocol/HttpCallback.h b/NetworkPkg/Includ= e/Protocol/HttpCallback.h index 3accd2f8424..ae66cc9f771 100644 --- a/NetworkPkg/Include/Protocol/HttpCallback.h +++ b/NetworkPkg/Include/Protocol/HttpCallback.h @@ -2,6 +2,7 @@ This file defines the EDKII HTTP Callback Protocol interface. =20 Copyright (c) 2021, Intel Corporation. All rights reserved.
+ Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -55,7 +56,19 @@ typedef enum { /// EFI_SUCCESS The initialization of session is done. /// Others Other error as indicated. /// - HttpEventInitSession + HttpEventInitSession, + + /// + /// The Status of Event to configure TLS configuration data. + /// EventStatus: + /// EFI_SUCCESS The TLS is configured successfully with the d= efault value. + /// EFI_INVALID_PARAMETER One or more input parameters to SetSessionDat= a() is invalid. + /// EFI_NOT_READY Current TLS session state is NOT EfiTlsSessio= nStateNotStarted. + /// EFI_NOT_FOUND Fail to get 'HttpTlsCipherList' variable. + /// Others Other error as indicated. + /// + HttpEventTlsConfigured + } EDKII_HTTP_CALLBACK_EVENT; =20 /** diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c index 94900328ba9..9c3b497dce2 100644 --- a/NetworkPkg/HttpDxe/HttpProto.c +++ b/NetworkPkg/HttpDxe/HttpProto.c @@ -1418,6 +1418,7 @@ HttpInitSession ( // if (TlsConfigure) { Status =3D TlsConfigureSession (HttpInstance); + HttpNotify (HttpEventTlsConfigured, Status); if (EFI_ERROR (Status)) { return Status; } diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c b/NetworkPkg/HttpDxe/HttpsSu= pport.c index 04a830f7152..8d7bffe1e9c 100644 --- a/NetworkPkg/HttpDxe/HttpsSupport.c +++ b/NetworkPkg/HttpDxe/HttpsSupport.c @@ -723,7 +723,7 @@ TlsConfigureSession ( Status =3D TlsConfigCertificate (HttpInstance); if (EFI_ERROR (Status)) { if (Status =3D=3D EFI_NOT_FOUND) { - DEBUG((DEBUG_WARN, "TLS Certificate is not found on the system!\n")); + DEBUG ((DEBUG_WARN, "TLS Certificate is not found on the system!\n")= ); // // We still return EFI_SUCCESS to the caller when TlsConfigCertifica= te // returns error, for the use case the platform doesn't require @@ -734,7 +734,7 @@ TlsConfigureSession ( // Status =3D EFI_SUCCESS; } else { - DEBUG((DEBUG_ERROR, "TLS Certificate Config Error!\n")); + DEBUG ((DEBUG_ERROR, "TLS Certificate Config Error!\n")); return Status; } } --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113331): https://edk2.groups.io/g/devel/message/113331 Mute This Topic: https://groups.io/mt/103577248/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 11:58:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113330+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 170463406573157.11740778430419; Sun, 7 Jan 2024 05:27:45 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=vnBEYiFH8yXQf87JhozQ+3TsrnsF2XG1vMokbPkWds4=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1704634065; v=1; b=tnxTn0j4ABFIuZEu4cYbqxfJinTbawgIaa+nnyPaXDWhbaCPEzEZGasxhZPJNCJuYeWnlzFC NfHcRaHUmU2559U2x7cPT9Yv2RZpKVjuut5mhkLk+PTSNB0cLVOqny4UANOcVgSB4mP3c+rWlct okF6KeClHB0uR6wx9d7G6/3Y= X-Received: by 127.0.0.2 with SMTP id uy3gYY1788612xeXFeK9Evse; Sun, 07 Jan 2024 05:27:45 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.41]) by mx.groups.io with SMTP id smtpd.web10.14902.1704634064709640808 for ; Sun, 07 Jan 2024 05:27:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bzifQfP4GzEYBapLZ4ruvDUUF+K2f4sbP+5FiwAjrGVXk6lr8fHZjIWi6x3njIlaWsutQrhwTYVLVDDDkjknPdYa2clBHbo9z+U0fgfKl4gZB4OXjLNU2EhH5ICFXggZHufvzzBRAG0RJi8BslRTtXpji1A8x3Tmj9kmuDbeiFluB5LWhZctI6eDF9CCeNw60jwCtcwVLGFAWeID+6TxBaPyZ++VIpYtbkKAIZu8h9lgeI7k/0ToA4qOlpq7PNnowMKTrTOmt0mXYAX4k0JCHDKnFfu1EEgO7gag7Ipnt0DAt8UQbNHqvyS/KzV2DvRxS3rVwzIMe49JQeqeAk6abg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uDgxcxEChhVommNQjQdcbe1UJJmr+fSotSM3h/F5QQ8=; b=Gm5tKye2lR6jHH+xybMIEDufdi6bS/7mIfi2uk9fMK8wX3VOfh6gdj+V6BtSd/CXBz98OlZ22ZlG9X2XrcUpY/WDMKBtnW0OexUYz685umsXm5LtJngzPXlr18VupQOfs3dJuX8s5jSKEZJX5+m9ikhFsp07AJAlXn+eF5QaRdW8Fq9/s62rQimMRRNU2WwrypgbISxQ47G0ztydhviIwYGRQ9APj/VnyfXLVqqxRJo/pc8AKFAk//mtRqQXxkCqdGF+8T+oLSNqeMj1SBn18Z1azEFwiFdMv0PpflOuX/t4ip2EjZaoqjzI88QYaV9vQZANNPlJNoMOgkUsuLDyqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from BL1PR13CA0127.namprd13.prod.outlook.com (2603:10b6:208:2bb::12) by DS0PR12MB6440.namprd12.prod.outlook.com (2603:10b6:8:c8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.20; Sun, 7 Jan 2024 13:27:42 +0000 X-Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:208:2bb:cafe::22) by BL1PR13CA0127.outlook.office365.com (2603:10b6:208:2bb::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.12 via Frontend Transport; Sun, 7 Jan 2024 13:27:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113330+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.13 via Frontend Transport; Sun, 7 Jan 2024 13:27:41 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Sun, 7 Jan 2024 07:27:40 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy Subject: [edk2-devel] [PATCH V2 4/6] RedfishPkg/RedfishRestExDxe: Implement EDKII_HTTP_CALLBACK_PROTOCOL Date: Sun, 7 Jan 2024 21:26:59 +0800 Message-ID: <20240107132701.302-5-abner.chang@amd.com> In-Reply-To: <20240107132701.302-1-abner.chang@amd.com> References: <20240107132701.302-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|DS0PR12MB6440:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e4263fc-3259-4309-7b98-08dc0f846cf8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 0wkbGLc8Wnv/3xfjlwlj/HOSPmu+ABQprpxOSW4lHLxWHMPNc5sJzUqILIOt5Qdn2vFCaKp7up+zxg95P6aldwEiSHz5l6sw0MPvmzmjPSrXCtrUNqL9BnAHy/XImFgGXGUaj5BCAt2nZpGf+v5InP+iv41UozLNOKZ4bqqZ+1hkd5qsuSUkn1pK/6VmXVYbqEPGtkc2oy0IV8tRU208xuGWMOznwEe60JISzj21uvgbctxEdfEqyDT0FL9Dcf4J5ocVz0jZsIyYGrleLhLXKrcY7L0hr7kNX0OnPF46tKhL2hMfn6U5TpENSSt9rXL1bpULr33wRmOLMoJAEIUfFJ2V6W3qTVtjx6QNQgkMEz0c+t9bvbzCqu0WPQL1z//3voCi7HnVanHCCkpdPDAJSr9hDIjoininoF12sXJRy7pkBLWLVD2OiGgJidTvZCS/j2AgySPgcA9rzoaoy1Mwgo9W7avAuS+qYIS3UX/MuYnZKIvx/bSCb4LyNPxRgjnLnKI6/coHwYbE0CKjEZjh9hZjql4hoeH8IJyFDccOOA6yp4fG6GUdXMuZLXL1OmJinRCsOEMGbAbt7EHxg2UvsgYRvOPuoML5RPyrZt4TDm203mfMWhUvyztrtR6k5rUoRE05N1zSzRxzLrlrVK/FcSULHi/i769VvDJyLtJ7zKK46a6T6lB9Sk755HVPctsGCKvkBwcfDdgGsqBCWeLXyxPQ0A1hXwwgtCXOes4aE1oA+rlGJHQA7vBPIlHfsPskGg2GvkYQ3Dc3UgycpTBMxA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2024 13:27:41.7622 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e4263fc-3259-4309-7b98-08dc0f846cf8 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6440 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: VmYT90mfC7MGDEaMgfhUmwbHx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704634067430100006 Content-Type: text/plain; charset="utf-8" From: Abner Chang Implement EDKII_HTTP_CALLBACK_PROTOCOL that listens to HttpEventTlsConfigured event for reconfiguring TLS configuration data. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Reviewed-by: Nickle Wang --- .../RedfishRestExDxe/RedfishRestExDxe.inf | 3 + .../RedfishRestExDxe/RedfishRestExDriver.h | 32 ++++++--- .../RedfishRestExDxe/RedfishRestExDriver.c | 70 +++++++++++++++++++ 3 files changed, 95 insertions(+), 10 deletions(-) diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf b/RedfishPkg/= RedfishRestExDxe/RedfishRestExDxe.inf index 64e6343bfbf..6da416ddb92 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf @@ -5,6 +5,7 @@ # (C) Copyright 2020 Hewlett Packard Enterprise Development LP
# Copyright (c) 2023, American Megatrends International LLC. # Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserve= d. +# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -57,6 +58,8 @@ gEfiHttpServiceBindingProtocolGuid ## TO_START gEfiHttpProtocolGuid ## TO_START gEfiDevicePathProtocolGuid ## TO_START + gEdkiiHttpCallbackProtocolGuid ## CONSUMES + gEfiTlsProtocolGuid ## CONSUMES =20 [Pcd] gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceAccessModeInBand ## = CONSUMES diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h b/RedfishPkg= /RedfishRestExDxe/RedfishRestExDriver.h index 6b94e5814c4..929691cea35 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h @@ -4,6 +4,7 @@ Copyright (c) 2019, Intel Corporation. All rights reserved.
(C) Copyright 2020 Hewlett Packard Enterprise Development LP
Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
+ Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -32,6 +33,8 @@ #include #include #include +#include +#include =20 /// /// Protocol instances @@ -67,6 +70,9 @@ typedef struct _RESTEX_INSTANCE RESTEX_INSTANCE; #define RESTEX_INSTANCE_FROM_THIS(a) \ CR (a, RESTEX_INSTANCE, RestEx, RESTEX_INSTANCE_SIGNATURE) =20 +#define RESTEX_INSTANCE_FROM_HTTP_CALLBACK(a) \ + CR (a, RESTEX_INSTANCE, HttpCallbakFunction, RESTEX_INSTANCE_SIGNATURE) + #define RESTEX_STATE_UNCONFIGED 0 #define RESTEX_STATE_CONFIGED 1 =20 @@ -94,25 +100,31 @@ struct _RESTEX_SERVICE { #define RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY 0x00000002 =20 struct _RESTEX_INSTANCE { - UINT32 Signature; - LIST_ENTRY Link; + UINT32 Signature; + LIST_ENTRY Link; =20 - EFI_REST_EX_PROTOCOL RestEx; + EFI_REST_EX_PROTOCOL RestEx; =20 - INTN State; - BOOLEAN InDestroy; + INTN State; + BOOLEAN InDestroy; =20 - RESTEX_SERVICE *Service; - EFI_HANDLE ChildHandle; + RESTEX_SERVICE *Service; + EFI_HANDLE ChildHandle; =20 - EFI_REST_EX_CONFIG_DATA ConfigData; + EFI_REST_EX_CONFIG_DATA ConfigData; =20 // // HTTP_IO to access the HTTP service // - HTTP_IO HttpIo; + HTTP_IO HttpIo; + + // + // EDKII_HTTP_CALLBACK_PROTOCOL that listens to + // HttpEventInitSession event. + // + EDKII_HTTP_CALLBACK_PROTOCOL HttpCallbakFunction; =20 - UINT32 Flags; + UINT32 Flags; }; =20 typedef struct { diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c b/RedfishPkg= /RedfishRestExDxe/RedfishRestExDriver.c index 7036aed4268..39221989c49 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c @@ -4,6 +4,7 @@ Copyright (c) 2019, Intel Corporation. All rights reserved.
(C) Copyright 2020 Hewlett Packard Enterprise Development LP
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -585,6 +586,53 @@ RedfishRestExDriverBindingStop ( return Status; } =20 +/** + Callback function that is invoked when HTTP event occurs. + + @param[in] This Pointer to the EDKII_HTTP_CALLBACK_PROTO= COL instance. + @param[in] Event The event that occurs in the current sta= te. + @param[in] EventStatus The Status of Event, EFI_SUCCESS or othe= r errors. +**/ +VOID +EFIAPI +RestExHttpCallback ( + IN EDKII_HTTP_CALLBACK_PROTOCOL *This, + IN EDKII_HTTP_CALLBACK_EVENT Event, + IN EFI_STATUS EventStatus + ) +{ + EFI_STATUS Status; + EFI_TLS_PROTOCOL *TlsProtocol; + RESTEX_INSTANCE *Instance; + EFI_TLS_VERIFY TlsVerifyMethod; + + if ((Event =3D=3D HttpEventTlsConfigured) && (EventStatus =3D=3D EFI_SUC= CESS)) { + // Reconfigure TLS configuration data. + Instance =3D RESTEX_INSTANCE_FROM_HTTP_CALLBACK (This); + Status =3D gBS->HandleProtocol ( + Instance->HttpIo.Handle, + &gEfiTlsProtocolGuid, + (VOID **)&TlsProtocol + ); + if (EFI_ERROR (Status)) { + return; + } + + TlsVerifyMethod =3D EFI_TLS_VERIFY_NONE; + Status =3D TlsProtocol->SetSessionData ( + TlsProtocol, + EfiTlsVerifyMethod, + &TlsVerifyMethod, + sizeof (EFI_TLS_VERIFY) + ); + if (!EFI_ERROR (Status)) { + DEBUG ((DEBUG_MANAGEABILITY, "%a: REST EX reconfigures TLS verify me= thod.\n", __func__)); + } + } + + return; +} + /** Creates a child handle and installs a protocol. =20 @@ -699,6 +747,19 @@ RedfishRestExServiceBindingCreateChild ( goto ON_ERROR; } =20 + // Initial HTTP callback funciton on this REST EX instance + Instance->HttpCallbakFunction.Callback =3D RestExHttpCallback; + Status =3D gBS->InstallProtocolInterface= ( + &Instance->HttpIo.Handle, + &gEdkiiHttpCallbackProto= colGuid, + EFI_NATIVE_INTERFACE, + &Instance->HttpCallbakFu= nction + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Fail to install HttpCallbakFunction.\n", __f= unc__)); + goto ON_ERROR; + } + // // Add it to the parent's child list. // @@ -812,6 +873,15 @@ RedfishRestExServiceBindingDestroyChild ( RestEx ); =20 + // + // Uninstall the HTTP callback protocol. + // + Status =3D gBS->UninstallProtocolInterface ( + Instance->HttpIo.Handle, + &gEdkiiHttpCallbackProtocolGuid, + &Instance->HttpCallbakFunction + ); + OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); =20 if (EFI_ERROR (Status)) { --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113330): https://edk2.groups.io/g/devel/message/113330 Mute This Topic: https://groups.io/mt/103577246/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 11:58:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113332+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704634069668854.2978349235179; Sun, 7 Jan 2024 05:27:49 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=IYdBZo4pO5GdAva8XyS4XzruGyWDcwrd4WDDl0tub3A=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1704634069; v=1; b=S9Gl7p101kQvGTAIN1SLge9TQbv/YRUvt3lscHWQ/lExuyTP+QZZAmpqWlfesomawdE+YFsA 0LlAxTNxlvHeIraAkJNRifhH7/yOdC4+nQeqqf95OhIhT86g1OhafgPgNbAZq5+r7OUtjqtxURU Ad77ydwFqvxDgh1booazfuy8= X-Received: by 127.0.0.2 with SMTP id fi1WYY1788612xy7VKfbUyf5; Sun, 07 Jan 2024 05:27:49 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.65]) by mx.groups.io with SMTP id smtpd.web10.14905.1704634068779065398 for ; Sun, 07 Jan 2024 05:27:48 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kEN9qTqBzqRaI3Mu9tUZeJ0su+gTgyTQ2HFV7Wti+h4ht3u8ZOTDyee3EsEVsZuSPEN4Z0V7OXLDZM86PgVFC9zXZET1oOsiXIGdSXW3EAhy0tDeLFuRA5vs9hDatVdUKy2INu3AKEr4/u4rdJF4VFUTgnLxeS/Co/LDHUwkS21vsvzCKtK4OOpTrSY1fTS7A1W/z/ZfO8sZzU/dAKSNPkrCYBJnoj9WSQCQQvvctSL2Ri0Osxg1ManozYNwT+vkuxAiQv652Zu0Srkczu0SSLC6ZgCR4egPMtyCB4q22MX3o9CR8A48O4wbzy8EKosSbQXd6m2akr43K1tG3TMwbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FeUHnAZTqwcC5dqUu37WWj8UzBgesjUbHlHu7GxpHiM=; b=OSQZILzG5hDuhSRwZJi7hNC9t1DRMWjIj/LCHDJmRrBx65H9wXMSH0J6vAr6qqBoEEdRRvmxT6mh5oYLQn1Cn0HRVCsc2JtND3pDZRYFNXt7Qd02ZOeX+N0vcNrfBbBSJwWYSszSv7V/H7dcZxRoKwJrTkX90dQUz9+KB8vetbFkEU/sqGYbuMBBIpiURn+wya0b+ZcCaKriLN5yn0JsAROB9HvknkJ8wfXNxXfpXveKItByjLAvxshlJYPg9anYFADHjsUaxdsozGSGZsVKnHfBYTopFhrRRp8Q1a8qeqDDHDq1jIh2hRlqDsvAlqJkno1HT56k4CzN3xcYsi2qdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from BL1PR13CA0150.namprd13.prod.outlook.com (2603:10b6:208:2bb::35) by CH3PR12MB8332.namprd12.prod.outlook.com (2603:10b6:610:131::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Sun, 7 Jan 2024 13:27:43 +0000 X-Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:208:2bb::4) by BL1PR13CA0150.outlook.office365.com (2603:10b6:208:2bb::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.13 via Frontend Transport; Sun, 7 Jan 2024 13:27:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113332+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.13 via Frontend Transport; Sun, 7 Jan 2024 13:27:43 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Sun, 7 Jan 2024 07:27:41 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy Subject: [edk2-devel] [PATCH V2 5/6] RedfishPkg/RedfishRestExDxe: Uncrustify RedfishRestExDriver.h Date: Sun, 7 Jan 2024 21:27:00 +0800 Message-ID: <20240107132701.302-6-abner.chang@amd.com> In-Reply-To: <20240107132701.302-1-abner.chang@amd.com> References: <20240107132701.302-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|CH3PR12MB8332:EE_ X-MS-Office365-Filtering-Correlation-Id: 939e2774-b7d9-4cc4-5d64-08dc0f846ddd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: Lihhy3WpLg7OP9zi3tKXzX+vuuH7xfclr7NuFXLzXv2XozTIF0nkIs/dtGgjHrZMUNgQHmsH7h/DL/jV7BRKz3mzAsx1lZYSU5d1DylGkjT4DyMiQfGLO1C1TdmCFMsZp2a+lb2h2pDMhDamq8cn6CDs1zqesyrL1LQWaxb3xF7swBLz7YL6ZnIUxmJAf3T0RNXvyy0tk5TdSmIt2vnVobnhs55HgbvmhN6CyRk83oUcl4FfZFo/UpKO2LVVYX3599dNasuSTAdeq5GPbbLiSXYMZmNoH9GaSrUikUMRGvQ8c5Mf8teJ/SfPXtxNTyQKH97nw6kZpL726bFLrjLHM7pkZiXkxA/BbGZFo8qSmftytO6l4pnT4Ni75It7K0E6mUcAHVAurZNzAb/I+SON5FY1Vc0IdOGxQicm6/vozOy8DT+zHc+tkpGyS+ZErtnTQtyfnVcbZRyEZ+xQfW/98NH1o01D0MYL31B0FxMlC7RHcJJjqZ+yoOoZvlBet7jWYaAJ8rg9Tdewag5PcDql3PaaYF5AvzxzcNBgXRWG7DJO+o0N2/JPoIj2JOxDtsqmuAhBzzJ7OmAEajp0KG7GmtP+7hb9s3GE3KySuxQ0ehdH3ri3BdojBiPGdMaRWqj7MI25KiVWGrvyR5e40Df+6voswkUTgxPlHW5U/bFosXktyjT4/XWKPf86omAK6ZsEMoPH9vRIgJXwNPhqnIbKSO97EO2fOCXyIVTyDPm9FR2q9RNsw7JabD732Yi2GIUOxxY71KwqSLKzjbCRYB8xug== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2024 13:27:43.2622 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 939e2774-b7d9-4cc4-5d64-08dc0f846ddd X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8332 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: AQ4j2RdKBk7ilYQuTIaur7dEx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704634071409100001 Content-Type: text/plain; charset="utf-8" From: Abner Chang Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Reviewed-by: Nickle Wang --- .../RedfishRestExDxe/RedfishRestExDriver.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h b/RedfishPkg= /RedfishRestExDxe/RedfishRestExDriver.h index 929691cea35..f0107a453f7 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h @@ -100,31 +100,31 @@ struct _RESTEX_SERVICE { #define RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY 0x00000002 =20 struct _RESTEX_INSTANCE { - UINT32 Signature; - LIST_ENTRY Link; + UINT32 Signature; + LIST_ENTRY Link; =20 - EFI_REST_EX_PROTOCOL RestEx; + EFI_REST_EX_PROTOCOL RestEx; =20 - INTN State; - BOOLEAN InDestroy; + INTN State; + BOOLEAN InDestroy; =20 - RESTEX_SERVICE *Service; - EFI_HANDLE ChildHandle; + RESTEX_SERVICE *Service; + EFI_HANDLE ChildHandle; =20 - EFI_REST_EX_CONFIG_DATA ConfigData; + EFI_REST_EX_CONFIG_DATA ConfigData; =20 // // HTTP_IO to access the HTTP service // - HTTP_IO HttpIo; + HTTP_IO HttpIo; =20 // // EDKII_HTTP_CALLBACK_PROTOCOL that listens to // HttpEventInitSession event. // - EDKII_HTTP_CALLBACK_PROTOCOL HttpCallbakFunction; + EDKII_HTTP_CALLBACK_PROTOCOL HttpCallbakFunction; =20 - UINT32 Flags; + UINT32 Flags; }; =20 typedef struct { --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113332): https://edk2.groups.io/g/devel/message/113332 Mute This Topic: https://groups.io/mt/103577250/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 11:58:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113333+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704634072921627.5167591048115; Sun, 7 Jan 2024 05:27:52 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=98OcW/elqwfnysAB+tyUYJwLRyMsVYcdy65d74hL3yc=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1704634072; v=1; b=Jl19nJu5/aLK6J5S3UYE4TB/zsNQ4kzNfTpbVOCpCD5XHR7gnILZQsT+/a5CFi0/slHgltNz TbExn+E2B9KIwEEbcAwnUqeBJTSRJm9/QmSgN/jRVNu80BjIcojDEK1JScAbdrIG1SuBfdzxh8f VNLhzlhvfBgY/BL26fTr8Ego= X-Received: by 127.0.0.2 with SMTP id 5DDzYY1788612xTWmFlPecls; Sun, 07 Jan 2024 05:27:52 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.70]) by mx.groups.io with SMTP id smtpd.web10.14908.1704634072084947781 for ; Sun, 07 Jan 2024 05:27:52 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cW0WMmcWaq9rNNCE6Lb3F0ONygcfgjc9H/jLiqzZv0SheBkBtOuYL1n+uQImwvm+3feLeGt1OzS1WVzOqO6uN+/qLvu7VU/LHbUwB6HQQv0SiEYjTuFy4voaZUBK3Xs+H8Ac1vs1aOBxO7pQ0r5qV27jFoBlcFNheZVkc8b8SbsBhdbB4YOGgK30ycLyWMy7lmn/9XzEtJhdHMuu9FlLnDw9EMF/NeA4VjqXnGXmarfa1jC+zF63hZ+dK8HdEQIQzuQfFvJGcn5sk39xLK2UNY0H663FLmu5B/fHKz9s2GfK9VM/2MGcoailggLtTpwJj28CXkBy8HNS7oYLJU0bAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mrisJvPCI9U23bLyEyg+PVGOxrKJIJiKBH/grHW1+0Y=; b=cox+jwMNLxYHuEW9hO4kgV0/NzRchSsqjgH6BlscJCiuVDfGpwGuCVc+cJtTUukhvo/iXod5tloEWp5ud8r3S/+yWLwPcjoy8lTEEP72Bfea4Jrmj11k4CT3ihu5bicSg4AZ76y8fS1wD2Q5L0W3zUMNht+KE+sxWbOZnfkHRvhHNsgEobVMLVyYKWgYHJdyTgdKnjScjTxSGDHFByoxPXSq7Ru3HgBNAszUt/LiwmKtS8cjjFjy4usnK8fSExmRxLlJxqRoe2wpQZbtRCqxlei2uFXuvGGJ+Qil/ghYvl8d0AUm4gibQIfLpchvN1TgrDBaonPT9CBHw0DMkAPVPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from BL1PR13CA0139.namprd13.prod.outlook.com (2603:10b6:208:2bb::24) by SJ1PR12MB6171.namprd12.prod.outlook.com (2603:10b6:a03:45a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Sun, 7 Jan 2024 13:27:45 +0000 X-Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:208:2bb:cafe::e1) by BL1PR13CA0139.outlook.office365.com (2603:10b6:208:2bb::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.14 via Frontend Transport; Sun, 7 Jan 2024 13:27:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113333+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.13 via Frontend Transport; Sun, 7 Jan 2024 13:27:44 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Sun, 7 Jan 2024 07:27:43 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy Subject: [edk2-devel] [PATCH V2 6/6] RedfishPkg/RedfishRestExDxe: Update Supported function Date: Sun, 7 Jan 2024 21:27:01 +0800 Message-ID: <20240107132701.302-7-abner.chang@amd.com> In-Reply-To: <20240107132701.302-1-abner.chang@amd.com> References: <20240107132701.302-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|SJ1PR12MB6171:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bbb1b28-bbeb-4a1e-8ea3-08dc0f846eb1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: unxHV03KaaVKVCELFyjPWbAWkeS9qS35Nuil8yp9dLGHCISQbMV4fKM8aOEsIFVHdPCpqy7ugmkTn4SOhWHfoH60QpFJPdkblJCS7chrs2Wth+Kl3VTKQc6iRN3706FCqzrGOE3/yp5qt8UgCW2toFgA98Fbt/31ZAR93ilked0bd7HZ8hLt1bsglJXNl4TPm4k0qz57kJuY434lPBwaXohIx3FU2apXHOLk88z0hsUIMXBkvGo3+rUXRHMjjXgtajhSv9UdeB81L0H8zpAZxnWAjVQlPHDeN0jxyFubV9OnUeWgLjYMZEtgIkHREh9cnay58ZdJ1JkeBMzNPob9VKGomWjspExKri7quzdQhE62REeuGoU6mnOSpmNwsTLecVY03xsTCiNS2JuFN/MOGi1OO3uWsL1/KpNkxpqNv5wcl24Wuwgni0XYu3G7GD4oxb5/3oDU9vkJYhzl3emrKhvl0h8x15UgIfVy5JoIZ79D7kpyX4jBC7ozYI7C9zFVSn1kBRyJTwn+TxINf1YCDmnnx4nqoA1eegaLPCPpwdfj1pVZjeeiWyUTTNgDE9bD1DhX4NHjAIvfG0a5EzcxuhCo09tO93b1I9t4L4wuYHjtPZ4mSMvNmtDnpx1frKUmMNELa33qyWmUDdEqApwOeNqAQN3zLOnsaVe8bSFfVf+P2Kw2O+fb9fXDCVdnrSpDlCDZ69j/AJgNXoHVHn/B/vkHG8WCY9ElBirgdte59vs/wx45T0vX8JSMnmWaqr79FIrW3w85eNNRRDkDQpNs+g== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2024 13:27:44.6528 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bbb1b28-bbeb-4a1e-8ea3-08dc0f846eb1 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6171 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: UjFSBNaNi6AdoS5N7DokGPqnx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704634073437100005 Content-Type: text/plain; charset="utf-8" From: Abner Chang Update Supported function to check it the given controller handle is already started. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy --- RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c b/RedfishPkg= /RedfishRestExDxe/RedfishRestExDriver.c index 39221989c49..741a8c1e938 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c @@ -357,6 +357,21 @@ RedfishRestExDriverBindingSupported ( IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL ) { + EFI_STATUS Status; + UINT32 *Id; + + Status =3D gBS->OpenProtocol ( + ControllerHandle, + &gEfiCallerIdGuid, + (VOID **)&Id, + This->DriverBindingHandle, + ControllerHandle, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (!EFI_ERROR (Status)) { + return EFI_ALREADY_STARTED; + } + // // Test for the HttpServiceBinding Protocol. // --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113333): https://edk2.groups.io/g/devel/message/113333 Mute This Topic: https://groups.io/mt/103577253/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-