public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
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] [RFC][PATCH 1/2] NetworkPkg: EDKII HTTPS platform TLS policy
Date: Tue, 26 Dec 2023 19:28:38 +0800	[thread overview]
Message-ID: <20231226112839.1152-2-abner.chang@amd.com> (raw)
In-Reply-To: <20231226112839.1152-1-abner.chang@amd.com>

From: Abner Chang <abner.chang@amd.com>

Definitions of EDKII_HTTPS_TLS_PLATFORM_POLICY_PROTOCOL.

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/NetworkPkg.dec                     |  3 +
 .../Protocol/HttpsTlsPlatformPolicyProtocol.h | 72 +++++++++++++++++++
 2 files changed, 75 insertions(+)
 create mode 100644 NetworkPkg/Include/Protocol/HttpsTlsPlatformPolicyProtocol.h

diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec
index e06f35e7747..88676c7eaf6 100644
--- a/NetworkPkg/NetworkPkg.dec
+++ b/NetworkPkg/NetworkPkg.dec
@@ -94,6 +94,9 @@
   ## Include/Protocol/WiFiProfileSyncProtocol.h
   gEdkiiWiFiProfileSyncProtocolGuid = {0x399a2b8a, 0xc267, 0x44aa, {0x9a, 0xb4, 0x30, 0x58, 0x8c, 0xd2, 0x2d, 0xcc}}
 
+  ## Include/Protocol/HttpsTlsPlatformPolicyProtocol.h
+  gEdkiiHttpsTlsPlatformPolicyProtocolGuid = {0xbfe8e3e3, 0xb884, 0x4a6f, {0xae, 0xd3, 0xb8, 0xdb, 0xeb, 0xc5, 0x58, 0xc0}}
+
 [PcdsFixedAtBuild]
   ## The max attempt number will be created by iSCSI driver.
   # @Prompt Max attempt number.
diff --git a/NetworkPkg/Include/Protocol/HttpsTlsPlatformPolicyProtocol.h b/NetworkPkg/Include/Protocol/HttpsTlsPlatformPolicyProtocol.h
new file mode 100644
index 00000000000..5f82ceba924
--- /dev/null
+++ b/NetworkPkg/Include/Protocol/HttpsTlsPlatformPolicyProtocol.h
@@ -0,0 +1,72 @@
+/** @file
+  This file defines the EDKII HTTPS TLS Platform Protocol interface.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef EDKII_HTTPS_TLS_PLATFORM_POLICY_PROTOCOL_H_
+#define EDKII_HTTPS_TLS_PLATFORM_POLICY_PROTOCOL_H_
+
+#include <Protocol/Http.h>
+#include <Protocol/Tls.h>
+
+#define EEDKII_HTTPS_TLS_PLATFORM_POLICY_PROTOCOL_GUID \
+  { \
+    0xbfe8e3e3, 0xb884, 0x4a6f, {0xae, 0xd3, 0xb8, 0xdb, 0xeb, 0xc5, 0x58, 0xc0} \
+  }
+
+typedef struct _EDKII_HTTPS_TLS_PLATFORM_POLICY_PROTOCOL EDKII_HTTPS_TLS_PLATFORM_POLICY_PROTOCOL;
+
+///
+/// EDKII_PLATFORM_HTTPS_TLS_CONFIG_DATA_VERSION
+///
+typedef struct {
+  UINT8    Major;
+  UINT8    Minor;
+} EDKII_PLATFORM_HTTPS_TLS_CONFIG_DATA_VERSION;
+
+typedef struct {
+  EDKII_PLATFORM_HTTPS_TLS_CONFIG_DATA_VERSION    Version;
+  ///
+  /// EDKII_PLATFORM_HTTPS_TLS_CONFIG_DATA_VERSION V1.0
+  ///
+  EFI_TLS_CONNECTION_END                          ConnectionEnd;
+  EFI_TLS_VERIFY                                  VerifyMethod;
+  EFI_TLS_VERIFY_HOST                             VerifyHost;
+} EDKII_PLATFORM_HTTPS_TLS_CONFIG_DATA;
+
+/**
+  Function to get platform HTTPS TLS Policy.
+
+  @param[in]   This                   Pointer to the EDKII_HTTPS_TLS_PLATFORM_POLICY_PROTOCOL
+                                      instance.
+  @param[in]   HttpHandle             EFI_HTTP_PROTOCOL handle used to transfer HTTP payload.
+  @param[out]  PlatformPolicy         Pointer to retrieve EDKII_PLATFORM_HTTPS_TLS_CONFIG_DATA.
+
+  @retval EFI_SUCCESS                 Platform HTTPS TLS config data is returned in
+                                      PlatformPolicy.
+  @retval EFI_INVALID_PARAMETER       Either HttpHandle or PlatformPolicy is NULL, or both are NULL.
+  @retval EFI_NOT_FOUND               No HTTP protocol insterface is found on HttpHandle.
+  @retval EFI_UNSUPPORTED             HttpProtocolInstance is not the HTTP instance platform
+                                      would like to config.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_HTTPS_TLS_GET_PLATFORM_POLICY)(
+  IN   EDKII_HTTPS_TLS_PLATFORM_POLICY_PROTOCOL  *This,
+  IN   EFI_HANDLE                                HttpHandle,
+  OUT  EDKII_PLATFORM_HTTPS_TLS_CONFIG_DATA      *PlatformPolicy
+  );
+
+///
+/// Platform can install more than one EDKII_HTTPS_TLS_PLATFORM_POLICY_PROTOCOL
+/// instances to return the platfrom HTTP TLS policy config data for the
+/// multiple HTTP instances.
+///
+struct _EDKII_HTTPS_TLS_PLATFORM_POLICY_PROTOCOL {
+  EDKII_HTTPS_TLS_GET_PLATFORM_POLICY    PlatformGetPolicy;
+};
+
+extern EFI_GUID  gEdkiiHttpsTlsPlatformPolicyProtocolGuid;
+#endif // EDKII_HTTPS_TLS_PLATFORM_POLICY_PROTOCOL_H_
-- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112914): https://edk2.groups.io/g/devel/message/112914
Mute This Topic: https://groups.io/mt/103368440/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-12-26 11:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26 11:28 [edk2-devel] [RFC][PATCH 0/2] Introduce HTTPS Platform TLS policy Chang, Abner via groups.io
2023-12-26 11:28 ` Chang, Abner via groups.io [this message]
2023-12-26 11:28 ` [edk2-devel] [RFC][PATCH 2/2] NetworkPkg: Check platform " Chang, Abner via groups.io
2023-12-27 15:55 ` [edk2-devel] [RFC][PATCH 0/2] Introduce HTTPS Platform " Michael Brown
2023-12-28  2:47   ` Chang, Abner via groups.io
2023-12-28 14:16     ` Michael Brown
2023-12-28 15:04       ` Chang, Abner via groups.io
2023-12-28 15:31         ` Michael Brown
2023-12-28 23:37           ` Chang, Abner via groups.io
2023-12-29  0:01             ` Michael Brown
2023-12-29 15:07               ` Chang, Abner via groups.io
2023-12-30 11:31                 ` Chang, Abner via groups.io
2024-01-01 23:07                 ` Michael Brown
2024-01-02  6:06                   ` Chang, Abner via groups.io
2024-01-02 12:42                     ` Michael Brown
2024-01-02 16:31                       ` Chang, Abner via groups.io
2024-01-02 17:46                         ` Michael Brown
2024-01-04  3:13                           ` Chang, Abner via groups.io
2024-01-05  8:41                         ` Chang, Abner via groups.io
2024-01-05 17:16                           ` Michael Brown

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=20231226112839.1152-2-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