From: "Chang, Abner via groups.io" <abner.chang=amd.com@groups.io>
To: <devel@edk2.groups.io>
Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>,
Zachary Clark-williams <zachary.clark-williams@intel.com>,
Michael Brown <mcb30@ipxe.org>, Nickle Wang <nicklew@nvidia.com>,
Igor Kulchytskyy <igork@ami.com>
Subject: [edk2-devel] [PATCH 3/5] NetwokrPkg/HttpDxe: Add HttpEventTlsConfigured HTTP callback event
Date: Fri, 5 Jan 2024 16:37:14 +0800 [thread overview]
Message-ID: <20240105083716.340-4-abner.chang@amd.com> (raw)
In-Reply-To: <20240105083716.340-1-abner.chang@amd.com>
From: Abner Chang <abner.chang@amd.com>
Add HttpEventTlsConfigured HTTP callback event and notify
callback functions when TlsConfigureSession () returns.
Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
Cc: Zachary Clark-williams <zachary.clark-williams@intel.com>
Cc: Michael Brown <mcb30@ipxe.org>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
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/Include/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,
+ ///
+ /// The Status of Event to configure TLS configuration data.
+ /// EventStatus:
+ /// EFI_SUCCESS The TLS is configured successfully with the default value.
+ /// EFI_INVALID_PARAMETER One or more input parameters to SetSessionData() is invalid.
+ /// EFI_NOT_READY Current TLS session state is NOT EfiTlsSessionStateNotStarted.
+ /// 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 = TlsConfigureSession (HttpInstance);
+ HttpNotify (HttpEventTlsConfigured, Status);
if (EFI_ERROR (Status)) {
return Status;
}
diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c b/NetworkPkg/HttpDxe/HttpsSupport.c
index 04a830f7152..8d7bffe1e9c 100644
--- a/NetworkPkg/HttpDxe/HttpsSupport.c
+++ b/NetworkPkg/HttpDxe/HttpsSupport.c
@@ -723,7 +723,7 @@ TlsConfigureSession (
Status = TlsConfigCertificate (HttpInstance);
if (EFI_ERROR (Status)) {
if (Status == 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 TlsConfigCertificate
// returns error, for the use case the platform doesn't require
@@ -734,7 +734,7 @@ TlsConfigureSession (
//
Status = EFI_SUCCESS;
} else {
- DEBUG((DEBUG_ERROR, "TLS Certificate Config Error!\n"));
+ DEBUG ((DEBUG_ERROR, "TLS Certificate Config Error!\n"));
return Status;
}
}
--
2.37.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
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]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-01-05 8:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-05 8:37 [edk2-devel] [PATCH 0/5] Refactor HTTP DXE to provide TLS reconfiguration capability Chang, Abner via groups.io
2024-01-05 8:37 ` [edk2-devel] [PATCH 1/5] NetwokrPkg/HttpDxe: Refactor TlsCreateChild Chang, Abner via groups.io
2024-01-05 17:11 ` Michael Brown
2024-01-05 21:32 ` Saloni Kasbekar
2024-01-07 12:08 ` Chang, Abner via groups.io
2024-01-09 4:31 ` Chang, Abner via groups.io
2024-01-05 8:37 ` [edk2-devel] [PATCH 2/5] NetwokrPkg/HttpDxe: Consider TLS certificate not found as a success case Chang, Abner via groups.io
2024-01-05 17:12 ` Michael Brown
2024-01-05 20:26 ` Saloni Kasbekar
2024-01-05 8:37 ` Chang, Abner via groups.io [this message]
2024-01-05 17:14 ` [edk2-devel] [PATCH 3/5] NetwokrPkg/HttpDxe: Add HttpEventTlsConfigured HTTP callback event Michael Brown
2024-01-07 12:19 ` Chang, Abner via groups.io
2024-01-07 13:26 ` Chang, Abner via groups.io
2024-01-05 8:37 ` [edk2-devel] [PATCH 4/5] RedfishPkg/RedfishRestExDxe: Implement EDKII_HTTP_CALLBACK_PROTOCOL Chang, Abner via groups.io
2024-01-05 8:37 ` [edk2-devel] [PATCH 5/5] RedfishPkg/RedfishRestExDxe: Update Supported function Chang, Abner via groups.io
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240105083716.340-4-abner.chang@amd.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox