linux-sgx/0105-Look-for-PCKRetrievalTool-config-file-in-etc.patch
Daniel P. Berrangé 109f4bc2ff Port to pycryptography and pyasn1 and make keyring optional
pyOpenSSL 24.0.0 removed several APIs required by pccsadmin, so
porting to pycryptography is required on Fedora. Since RHEL does
not ship pyOpenSSL, the port is useful here too.

Using pyasn1 instead of asn1 gives stronger validation during
parsing and brings compatibility with RHEL that lacks python3-asn1

The keyring package needs to be optional on RHEL which lacks this
module (currently).

Also drop the inappropriate pccs port number change

Related: https://issues.redhat.com/browse/RHEL-127046
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-12-10 11:22:41 +00:00

44 lines
1.9 KiB
Diff

From c8820c38a16ba9c572a6eafefd010b60ba037dde Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Thu, 29 Feb 2024 14:21:36 +0000
Subject: [PATCH 105/126] Look for PCKRetrievalTool config file in /etc/
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Looking for config files in the same directory as the binary is
inappropriate.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
tools/PCKRetrievalTool/App/linux/network_wrapper.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/PCKRetrievalTool/App/linux/network_wrapper.cpp b/tools/PCKRetrievalTool/App/linux/network_wrapper.cpp
index e423f38..36f219b 100644
--- a/tools/PCKRetrievalTool/App/linux/network_wrapper.cpp
+++ b/tools/PCKRetrievalTool/App/linux/network_wrapper.cpp
@@ -219,7 +219,8 @@ static void network_configuration(string &url, string &proxy_type, string &proxy
{
//firstly read local configuration File
char local_configuration_file_path[MAX_PATH] = "";
- bool ret = get_program_path(local_configuration_file_path, MAX_PATH -1);
+ bool ret = true;
+ strcpy(local_configuration_file_path, "/etc/PCKIDRetrievalTool/");
if (ret) {
if(strnlen(local_configuration_file_path ,MAX_PATH)+strnlen(LOCAL_NETWORK_SETTING,MAX_PATH)+sizeof(char) > MAX_PATH) {
ret = false;
@@ -378,7 +379,8 @@ network_post_error_t network_https_post(const uint8_t* raw_data, const uint32_t
bool is_server_url_available() {
char local_configuration_file_path[MAX_PATH] = "";
- bool ret = get_program_path(local_configuration_file_path, MAX_PATH -1);
+ bool ret = true;
+ strcpy(local_configuration_file_path, "/etc/PCKIDRetrievalTool/");
if (ret) {
if(strnlen(local_configuration_file_path ,MAX_PATH)+strnlen(LOCAL_NETWORK_SETTING,MAX_PATH)+sizeof(char) > MAX_PATH) {
return false;
--
2.51.1