public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nickle Wang" <nicklew@nvidia.com>
To: <devel@edk2.groups.io>
Cc: Abner Chang <abner.chang@amd.com>,
	Igor Kulchytskyy <igork@ami.com>,
	"Nick Ramirez" <nramirez@nvidia.com>
Subject: [PATCH 2/2] RedfishPkg/RedfishDiscoverDxe: provide PCD to disable TLS host verify
Date: Wed, 1 Feb 2023 11:46:46 +0800	[thread overview]
Message-ID: <20230201034646.665-1-nicklew@nvidia.com> (raw)

Introduce PCD PcdRedfishTlsHostVerifyDisabled to RedfishDiscoverDxe
driver. Setting this PCD to true will turn off TLS host verify in
HTTPS connection between host and BMC.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
---
 RedfishPkg/RedfishPkg.dec                            | 5 +++++
 RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.inf | 3 ++-
 RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c   | 8 +++++---
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index d2b189b13d..707228d22e 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -3,6 +3,7 @@
 #
 # Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
+# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
@@ -97,3 +98,7 @@
   # protocol instance.
   #
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDiscoverAccessModeInBand|FALSE|BOOLEAN|0x00001002
+  #
+  # Setting this PCD to TRUE will turn off TLS host verify during HTTPS handshake.
+  #
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishTlsHostVerifyDisabled|TRUE|BOOLEAN|0x00001003
diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.inf b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.inf
index 345bacf44d..e872966693 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.inf
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.inf
@@ -2,6 +2,7 @@
 #  Implementation of EFI_REDFISH_DISCOVER_PROTOCOL interfaces.
 #
 #  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
+#  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -52,4 +53,4 @@
 
 [Pcd]
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDiscoverAccessModeInBand ## CONSUMES
-
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishTlsHostVerifyDisabled    ## CONSUMES
diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
index 042d6d5fd5..1d4398e9d7 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
@@ -4,6 +4,7 @@
 
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
   Copyright (c) 2022, AMD Incorporated. All rights reserved.
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -840,9 +841,10 @@ AddAndSignalNewRedfishService (
         goto EXIT_FREE_CONFIG_DATA;
       }
 
-      RestExHttpConfigData->SendReceiveTimeout                = 5000;
-      RestExHttpConfigData->HttpConfigData.HttpVersion        = HttpVersion11;
-      RestExHttpConfigData->HttpConfigData.LocalAddressIsIPv6 = CheckIsIpVersion6 (NetworkInterface);
+      RestExHttpConfigData->SendReceiveTimeout                           = 5000;
+      RestExHttpConfigData->HttpConfigData.HttpVersion                   = HttpVersion11;
+      RestExHttpConfigData->HttpConfigData.LocalAddressIsIPv6            = CheckIsIpVersion6 (NetworkInterface);
+      RestExHttpConfigData->HttpConfigData.HostCertificateVerifyDisabled = PcdGetBool (PcdRedfishTlsHostVerifyDisabled);
       if (RestExHttpConfigData->HttpConfigData.LocalAddressIsIPv6) {
         RestExHttpConfigData->HttpConfigData.AccessPoint.IPv6Node = AllocateZeroPool (sizeof (EFI_HTTPv6_ACCESS_POINT));
         if (RestExHttpConfigData->HttpConfigData.AccessPoint.IPv6Node == NULL) {
-- 
2.39.1.windows.1


                 reply	other threads:[~2023-02-01  3:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230201034646.665-1-nicklew@nvidia.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