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>
Reviewed-by: Michael Brown <mcb30@ipxe.org>
---
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/Include/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.
Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -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 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
+
} EDKII_HTTP_CALLBACK_EVENT;
/**
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 (#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]
-=-=-=-=-=-=-=-=-=-=-=-
Reviewed-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
-----Original Message-----
From: abner.chang@amd.com <abner.chang@amd.com>
Sent: Sunday, January 7, 2024 5:27 AM
To: devel@edk2.groups.io
Cc: Kasbekar, Saloni <saloni.kasbekar@intel.com>; Clark-williams, Zachary <zachary.clark-williams@intel.com>; Michael Brown <mcb30@ipxe.org>; Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>
Subject: [PATCH V2 3/6] NetworkPkg/HttpDxe: Add HttpEventTlsConfigured HTTP callback event
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>
Reviewed-by: Michael Brown <mcb30@ipxe.org>
---
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/Include/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.
Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+ reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent **/
@@ -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 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
+
} EDKII_HTTP_CALLBACK_EVENT;
/**
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 (#113494): https://edk2.groups.io/g/devel/message/113494
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]
-=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2026 Red Hat, Inc.