From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id DA831AC1018 for ; Fri, 5 Jan 2024 08:37:58 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=O7HW18faj8fSwZJoMUYQk1pVBTIbQWiinJjRDnOSqBA=; 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=1704443877; v=1; b=aefYWvbErzy7JBO2YfP75RB9MKRAsxwR4PawdYA2O6X42WQyje2U68QzwR0QBReMEARvo2iz 2WqD26QIDCPKHs9VuxvDzMwflisVuBhNKWFDt9lGtXVvz8k5aFP270isaK7Kl+86ejAWAI0edun SaxHx/YE8ZDEm9OQpwUWis3c= X-Received: by 127.0.0.2 with SMTP id 8FS4YY7687511xgJSiRIKhgQ; Fri, 05 Jan 2024 00:37:57 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.87]) by mx.groups.io with SMTP id smtpd.web10.19665.1704443875209276715 for ; Fri, 05 Jan 2024 00:37:55 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=idyJ1ai4vQuNE1q8D7X+DJwj7tCzkUTRRp3Key2FKk5tQEsMnUX84MEhoh3mmiCXPXIL+f74qO8JXxMq+CRE7/QVarhQG/47jESwO+VSZ1cFMVCdtvLayYwgqOedJlXlyx52zM9zwh3bzJX/TdStRvVQSrfEOAqFVW9n2tQQTCLHe1yIOxeR+oe5JMqbtnyhQHN1DvT6YoXMhbeLGpjgonRwZlpRsIu60tj69vn+x4W8AvmZ5rLlmwJdmP8uGYq0g/qndcNgS6kqi9djGNzS28fkq07lpeXqvE9a3NEzKoNnVaDz5vL9YYArDshaKVBs3jFXuqz/9X8zl2dPnAYEUg== 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=sRVAndtzfj4ssvxOqhNyW8gVdRdhN1cRuUXIkzeSj0g=; b=DtfRQoj7XYJ1wSyK4S90ZRfHRcGX6/oY39/wbWgGhz13vVJ8JVQKDkuMLetB2xPOHJyaagkrmo5FeAvhqZQUZRzFSRasRwJSrhkNizrSGMD5HmKE5qyJ0U2of87PUpu3nFPapHe5qj8elXuVn5gr+GxdvPhpUgU8rfXFGHtiSYxcBH19re3zAM6Id5c2qWiSiZVd8S5UJmIZnJuev8HbGo/NgzM8CfzHvRqLLdPNUodiqaxHJjo6CI/xpyCXHgo44ZBS0xilPWszhixoTlPYki3Di7q0rKBUuyaLfG+ohkhK9nKA7ouInTn1Egy6RZDt3Jn5d66a13yP8wVGZQ2Agg== 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 SJ0PR13CA0222.namprd13.prod.outlook.com (2603:10b6:a03:2c1::17) by BL1PR12MB5030.namprd12.prod.outlook.com (2603:10b6:208:313::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.17; Fri, 5 Jan 2024 08:37:53 +0000 X-Received: from SJ1PEPF00001CE6.namprd03.prod.outlook.com (2603:10b6:a03:2c1:cafe::ac) by SJ0PR13CA0222.outlook.office365.com (2603:10b6:a03:2c1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.9 via Frontend Transport; Fri, 5 Jan 2024 08:37:52 +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 (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 SJ1PEPF00001CE6.mail.protection.outlook.com (10.167.242.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7159.9 via Frontend Transport; Fri, 5 Jan 2024 08:37:52 +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; Fri, 5 Jan 2024 02:37:49 -0600 From: "Chang, Abner via groups.io" To: CC: Saloni Kasbekar , Zachary Clark-williams , Michael Brown , Nickle Wang , Igor Kulchytskyy Subject: [edk2-devel] [PATCH 3/5] NetwokrPkg/HttpDxe: Add HttpEventTlsConfigured HTTP callback event Date: Fri, 5 Jan 2024 16:37:14 +0800 Message-ID: <20240105083716.340-4-abner.chang@amd.com> In-Reply-To: <20240105083716.340-1-abner.chang@amd.com> References: <20240105083716.340-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: SJ1PEPF00001CE6:EE_|BL1PR12MB5030:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d1b3600-07af-41a3-cab8-08dc0dc99b44 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: mQ9IY0OxV2gA74xB4KfvrdOdWcGFu8FO9PxtehIOlUWgLfBlvZMR0f66p6r5KjbgTuRj3f3FQQkxublleiWNCyXpJPW7Fe1b4qDtyvRTM8d+win7/iQzbNAA5Wk56+wiG56tsDGGiSOiu73G9XNrdoB/1bC4807b9AHLYaHkSubjMwx/PLeuefQ1IAmWAZPYMzXXcL9RDLCNkRzci5IeFw93JgPjoHkBsmPYCj1scc+KCKTplx1wwuIvmwjZ2FxvQH0t6ul4OcMbEc+oEvwMgpb5IaJVCaxqFNklMb7I17IXTp/ZQD4SiwVzc98yor4QT3FFas8RqL0bbvWKPjaTWEgne3/0UljdwUHrrspEp/C/1+y3aZtTCBOFzlRjz+8dLlB5dUCl/lwt81JvyAyFi7R7LFOfuEZX/7NbbwwXVIDsw3QOH3v+PGuhDEqTewFsXD9MKQfBUCMXrw2MI3SLo+yxabBkX+znEaieit2bX0j8gLLCBHrXHZwwrb5Vo+4dJDotKusFi3nfmX++d2iEzU6jjwazIytmM4HCtaJtSFeAgiRk5gcHZN8xJyjIq8a45bAZh5452FD+8K8r2SifVhmuJaHMF0axJz7FWFrSTNxxjMqdZfXwhAGa53DKNvom7exZyfbmhrGiBdzes892W8VmcrCWz7zR82Z1jzxzHi+BBGfqoOj6sxXL0MVBHiGpPmQoEQOvvvEQ4Ly8cASXupqM7ZtlTA53Lsg8kqUxdG880iwaBnkExOgRiHYFmcjV5sEIQnetHNKtYJyh7K4MwQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 08:37:52.3082 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d1b3600-07af-41a3-cab8-08dc0dc99b44 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: SJ1PEPF00001CE6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5030 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: fHMfFArTHzfOKND8qflGkp9Ex7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=aefYWvbE; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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 --- NetworkPkg/Include/Protocol/HttpCallback.h | 11 +++++++++++ NetworkPkg/HttpDxe/HttpProto.c | 1 + NetworkPkg/HttpDxe/HttpsSupport.c | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/NetworkPkg/Include/Protocol/HttpCallback.h b/NetworkPkg/Includ= e/Protocol/HttpCallback.h index 3accd2f8424..a785c972f8f 100644 --- a/NetworkPkg/Include/Protocol/HttpCallback.h +++ b/NetworkPkg/Include/Protocol/HttpCallback.h @@ -39,6 +39,17 @@ typedef enum { /// HttpEventConnectTcp, =20 + /// + /// 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, + /// /// The Status of Event to connect one TLS session by finishing the TLS = handshake process. /// EventStatus: 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 (#113227): https://edk2.groups.io/g/devel/message/113227 Mute This Topic: https://groups.io/mt/103539580/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-