Fix issues discovered by OSCI tests

Related: RHEL-124447

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2025-12-02 12:24:11 -05:00
parent ea24c62658
commit 893f67ca5f
No known key found for this signature in database
GPG Key ID: 45DB85A568286D11
3 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,38 @@
From f40d0070641543a140428d70211d53d36fd2c34b Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Tue, 2 Dec 2025 12:12:26 -0500
Subject: [PATCH 2/3] Avoid segfault on receiving bad CLI arguments
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
---
src/sscg.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/sscg.c b/src/sscg.c
index d2dce334cff1342d975e9867a2c82a222d76925e..070d567bb189d42a20fd0a80f8fe2f7caae4d9eb 100644
--- a/src/sscg.c
+++ b/src/sscg.c
@@ -59,7 +59,7 @@ int
main (int argc, const char **argv)
{
int ret, sret;
- struct sscg_options *options;
+ struct sscg_options *options = NULL;
bool build_client_cert = false;
char *dhparams_file = NULL;
@@ -361,7 +361,10 @@ main (int argc, const char **argv)
done:
if (ret != EOK)
{
- sscg_io_utils_delete_output_files (options->streams);
+ if (options)
+ {
+ sscg_io_utils_delete_output_files (options->streams);
+ }
}
talloc_zfree (main_ctx);
if (getenv ("SSCG_TALLOC_REPORT"))
--
2.52.0

View File

@ -0,0 +1,29 @@
From 08dacb632cc331027f39dcfa0b782aeb6f2f893a Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Tue, 2 Dec 2025 12:19:04 -0500
Subject: [PATCH 3/3] Restore error message
This was dropped in 4.0, but should be retained in RHEL 9 and 10 for
compatibility, particularly with existing tests that look for specific
messages.
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
---
src/sscg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/sscg.c b/src/sscg.c
index 070d567bb189d42a20fd0a80f8fe2f7caae4d9eb..9f46cd622a4d55bd634a370ccc81ff063422b5af 100644
--- a/src/sscg.c
+++ b/src/sscg.c
@@ -361,6 +361,7 @@ main (int argc, const char **argv)
done:
if (ret != EOK)
{
+ SSCG_ERROR ("%s\n", strerror (ret));
if (options)
{
sscg_io_utils_delete_output_files (options->streams);
--
2.52.0

View File

@ -28,6 +28,13 @@ BuildRequires: help2man
# dhparam file generation by default.
Patch: 0001-Restore-defaulting-to-dhparams.pem-creation.patch
# Upstream patch to avoid segfault when receiving bad CLI arguments
Patch: 0002-Avoid-segfault-on-receiving-bad-CLI-arguments.patch
# Downstream patch to restore error message at the end of execution that is
# checked by certain tests
Patch: 0003-Restore-error-message.patch
%description
A utility to aid in the creation of more secure "self-signed"
certificates. The certificates created by this tool are generated in a