public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/sscg] f45: Update to sscg 4.0.4
@ 2026-09-23 18:45 Stephen Gallagher
  0 siblings, 0 replies; only message in thread
From: Stephen Gallagher @ 2026-09-23 18:45 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/sscg
            Branch : f45
            Commit : 8a9266c4add1e3747baba69705b972a6cf9c107e
            Author : Stephen Gallagher <sgallagh@redhat.com>
            Date   : 2026-09-23T14:43:28-04:00
            Stats  : +3/-229 in 5 file(s)
            URL    : https://src.fedoraproject.org/rpms/sscg/c/8a9266c4add1e3747baba69705b972a6cf9c107e?branch=f45

            Log:
            Update to sscg 4.0.4

* Avoid segfault and add more tests by @sgallagher in https://github.com/sgallagher/sscg/pull/102
* Adapt to OpenSSL 4 by @sgallagher in https://github.com/sgallagher/sscg/pull/104
* Assortment of minor fixes by @sgallagher in https://github.com/sgallagher/sscg/pull/106
* Add fixes for minor issues discovered by Coverity by @sgallagher in https://github.com/sgallagher/sscg/pull/107
* Assorted fixes by @sgallagher in https://github.com/sgallagher/sscg/pull/108

**Full Changelog**: https://github.com/sgallagher/sscg/compare/sscg-4.0.3...sscg-4.0.4

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>

---
diff --git a/.gitignore b/.gitignore
index 9d784f4..2b7abf9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,4 @@
 /sscg-4.0.1.tar.gz
 /sscg-4.0.2.tar.gz
 /sscg-4.0.3.tar.gz
+/sscg-4.0.4.tar.gz

diff --git a/0001-Avoid-segfault-on-receiving-bad-CLI-arguments.patch b/0001-Avoid-segfault-on-receiving-bad-CLI-arguments.patch
deleted file mode 100644
index c80dc87..0000000
--- a/0001-Avoid-segfault-on-receiving-bad-CLI-arguments.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 0c37e7ace585cfb550a0ffd9d5c331d059fd687f Mon Sep 17 00:00:00 2001
-From: Stephen Gallagher <sgallagh@redhat.com>
-Date: Tue, 2 Dec 2025 12:12:26 -0500
-Subject: [PATCH] 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 b9b191f109300f6447262858f57a3a8321a14966..00e2862c2d6be5c44a4a362fc926e1a07d31d7bf 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;
- 
-@@ -342,7 +342,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
-

diff --git a/0002-Adapt-to-OpenSSL-4.patch b/0002-Adapt-to-OpenSSL-4.patch
deleted file mode 100644
index f6d3507..0000000
--- a/0002-Adapt-to-OpenSSL-4.patch
+++ /dev/null
@@ -1,181 +0,0 @@
-From c321549d1eed073f2673326872b2148c0c13bc60 Mon Sep 17 00:00:00 2001
-From: Stephen Gallagher <sgallagh@redhat.com>
-Date: Fri, 17 Apr 2026 11:45:00 -0400
-Subject: [PATCH 2/2] Adapt to OpenSSL 4
-
-OpenSSL returns const pointers for some functions that were previously
-non-const. This also revealed that it was probably a bad idea to be
-modifying the CSR subject name in-place, so we now create a completely
-new X509_NAME object, populate it and then store it into the CSR.
-
-Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
----
- include/x509.h          |  5 +++++
- src/x509.c              | 37 ++++++++++++++++++++++++++++---------
- test/create_ca_test.c   |  4 ++--
- test/create_cert_test.c |  4 ++--
- 4 files changed, 37 insertions(+), 13 deletions(-)
-
-diff --git a/include/x509.h b/include/x509.h
-index a378c6a7910c75fe7889b75055ac6a39eb08fc70..b4520b932b3d0a8826839fce5fffba27a14c1689 100644
---- a/include/x509.h
-+++ b/include/x509.h
-@@ -70,6 +70,11 @@ struct sscg_x509_req
-   X509_REQ *x509_req;
- };
- 
-+struct sscg_x509_name
-+{
-+  X509_NAME *name;
-+};
-+
- struct sscg_x509_cert
- {
-   X509 *certificate;
-diff --git a/src/x509.c b/src/x509.c
-index cc9503ec968cfc94bd305e80450973bc36b87534..b1e43ad5972bef3d4ff87666b69d200a13aa7d9d 100644
---- a/src/x509.c
-+++ b/src/x509.c
-@@ -135,6 +135,17 @@ _sscg_csr_destructor (TALLOC_CTX *ctx)
-   return 0;
- }
- 
-+static int
-+_sscg_x509_name_destructor (TALLOC_CTX *ctx)
-+{
-+  struct sscg_x509_name *subject_name =
-+    talloc_get_type_abort (ctx, struct sscg_x509_name);
-+
-+  X509_NAME_free (subject_name->name);
-+
-+  return 0;
-+}
-+
- int
- sscg_x509v3_csr_new (TALLOC_CTX *mem_ctx,
-                      struct sscg_cert_info *certinfo,
-@@ -143,7 +154,7 @@ sscg_x509v3_csr_new (TALLOC_CTX *mem_ctx,
- {
-   int ret, sslret;
-   size_t i;
--  X509_NAME *subject;
-+  struct sscg_x509_name *subject = NULL;
-   char *alt_name = NULL;
-   char *tmp = NULL;
-   char *san = NULL;
-@@ -173,11 +184,16 @@ sscg_x509v3_csr_new (TALLOC_CTX *mem_ctx,
-   sslret = X509_REQ_set_version (csr->x509_req, 0);
-   CHECK_SSL (sslret, X509_REQ_set_version);
- 
--  subject = X509_REQ_get_subject_name (csr->x509_req);
-+  subject = talloc_zero (tmp_ctx, struct sscg_x509_name);
-+  CHECK_MEM (subject);
-+
-+  subject->name = X509_NAME_new ();
-+  CHECK_MEM (subject->name);
-+  talloc_set_destructor ((TALLOC_CTX *)subject, _sscg_x509_name_destructor);
- 
-   /* Country */
-   sslret =
--    X509_NAME_add_entry_by_NID (subject,
-+    X509_NAME_add_entry_by_NID (subject->name,
-                                 NID_countryName,
-                                 MBSTRING_UTF8,
-                                 (const unsigned char *)certinfo->country,
-@@ -190,7 +206,7 @@ sscg_x509v3_csr_new (TALLOC_CTX *mem_ctx,
-   if (certinfo->state && certinfo->state[0])
-     {
-       sslret =
--        X509_NAME_add_entry_by_NID (subject,
-+        X509_NAME_add_entry_by_NID (subject->name,
-                                     NID_stateOrProvinceName,
-                                     MBSTRING_UTF8,
-                                     (const unsigned char *)certinfo->state,
-@@ -204,7 +220,7 @@ sscg_x509v3_csr_new (TALLOC_CTX *mem_ctx,
-   if (certinfo->locality && certinfo->locality[0])
-     {
-       sslret =
--        X509_NAME_add_entry_by_NID (subject,
-+        X509_NAME_add_entry_by_NID (subject->name,
-                                     NID_localityName,
-                                     MBSTRING_UTF8,
-                                     (const unsigned char *)certinfo->locality,
-@@ -218,7 +234,7 @@ sscg_x509v3_csr_new (TALLOC_CTX *mem_ctx,
-   if (certinfo->org && certinfo->org[0])
-     {
-       sslret =
--        X509_NAME_add_entry_by_NID (subject,
-+        X509_NAME_add_entry_by_NID (subject->name,
-                                     NID_organizationName,
-                                     MBSTRING_UTF8,
-                                     (const unsigned char *)certinfo->org,
-@@ -232,7 +248,7 @@ sscg_x509v3_csr_new (TALLOC_CTX *mem_ctx,
-   if (certinfo->org_unit && certinfo->org_unit[0])
-     {
-       sslret =
--        X509_NAME_add_entry_by_NID (subject,
-+        X509_NAME_add_entry_by_NID (subject->name,
-                                     NID_organizationalUnitName,
-                                     MBSTRING_UTF8,
-                                     (const unsigned char *)certinfo->org_unit,
-@@ -243,7 +259,7 @@ sscg_x509v3_csr_new (TALLOC_CTX *mem_ctx,
-     }
- 
-   /* Common Name */
--  sslret = X509_NAME_add_entry_by_NID (subject,
-+  sslret = X509_NAME_add_entry_by_NID (subject->name,
-                                        NID_commonName,
-                                        MBSTRING_UTF8,
-                                        (const unsigned char *)certinfo->cn,
-@@ -256,7 +272,7 @@ sscg_x509v3_csr_new (TALLOC_CTX *mem_ctx,
-   if (certinfo->email && certinfo->email[0])
-     {
-       sslret =
--        X509_NAME_add_entry_by_NID (subject,
-+        X509_NAME_add_entry_by_NID (subject->name,
-                                     NID_pkcs9_emailAddress,
-                                     MBSTRING_UTF8,
-                                     (const unsigned char *)certinfo->email,
-@@ -266,6 +282,9 @@ sscg_x509v3_csr_new (TALLOC_CTX *mem_ctx,
-       CHECK_SSL (sslret, X509_NAME_add_entry_by_NID (Email));
-     }
- 
-+  sslret = X509_REQ_set_subject_name (csr->x509_req, subject->name);
-+  CHECK_SSL (sslret, X509_REQ_set_subject_name);
-+
-   /* SubjectAltNames */
-   alt_name = talloc_asprintf (tmp_ctx, "DNS:%s", certinfo->cn);
-   CHECK_MEM (alt_name);
-diff --git a/test/create_ca_test.c b/test/create_ca_test.c
-index ecaa5660986d943d134b0deff96f3d859725fa78..60fbc48de701c21e94ece96c72e9e86f7df3fc9f 100644
---- a/test/create_ca_test.c
-+++ b/test/create_ca_test.c
-@@ -567,8 +567,8 @@ verify_name_constraints (struct sscg_x509_cert *ca_cert,
-   int ret = EOK;
-   TALLOC_CTX *tmp_ctx = NULL;
-   X509 *x509 = ca_cert->certificate;
--  X509_EXTENSION *name_constraints_ext = NULL;
--  ASN1_OCTET_STRING *ext_data = NULL;
-+  const X509_EXTENSION *name_constraints_ext = NULL;
-+  const ASN1_OCTET_STRING *ext_data = NULL;
-   BIO *bio = NULL;
-   char *ext_str = NULL;
-   char *ext_str_copy = NULL;
-diff --git a/test/create_cert_test.c b/test/create_cert_test.c
-index be28c96b504548b839321fbbe899f4339cf965b5..5389b5b77de4c01be7566c5111ded930c5e0289b 100644
---- a/test/create_cert_test.c
-+++ b/test/create_cert_test.c
-@@ -51,8 +51,8 @@ verify_name_constraints (struct sscg_x509_cert *ca_cert,
-   int ret = EOK;
-   TALLOC_CTX *tmp_ctx = NULL;
-   X509 *x509 = ca_cert->certificate;
--  X509_EXTENSION *name_constraints_ext = NULL;
--  ASN1_OCTET_STRING *ext_data = NULL;
-+  const X509_EXTENSION *name_constraints_ext = NULL;
-+  const ASN1_OCTET_STRING *ext_data = NULL;
-   BIO *bio = NULL;
-   char *ext_str = NULL;
-   int ext_len = 0;
--- 
-2.53.0
-

diff --git a/sources b/sources
index ebbdfd3..de70a9a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (sscg-4.0.3.tar.gz) = f629cf7e32d4d4e7c1f58c4a53be925b96980e6fb3106e3a36a72f85c723bd79fba6aecdbf092b50f915a8833297bc7c6c1ccbe04fef488db38bbdc1e3a95b96
+SHA512 (sscg-4.0.4.tar.gz) = ecb3bb0c6deb33bf4d12cb33bedff1a8a10afec5328d7b61d35c72b765cb50167e3aa534e9f57e7f124a9a7816617475af9b655a37289c29d3b561073cf00464

diff --git a/sscg.spec b/sscg.spec
index 78db950..aab358d 100644
--- a/sscg.spec
+++ b/sscg.spec
@@ -9,7 +9,7 @@
 %{!?meson_test: %global meson_test %{__meson} test -C %{_vpath_builddir} --num-processes %{_smp_build_ncpus} --print-errorlogs}
 
 Name:           sscg
-Version:        4.0.3
+Version:        4.0.4
 Release:        %autorelease
 Summary:        Simple Signed Certificate Generator
 
@@ -25,14 +25,6 @@ BuildRequires:  meson
 BuildRequires:  ninja-build
 BuildRequires:  help2man
 
-# Upstream patch to avoid segfaults when receiving bad CLI arguments
-# https://github.com/sgallagher/sscg/commit/0c37e7ace585cfb550a0ffd9d5c331d059fd687f
-Patch: 0001-Avoid-segfault-on-receiving-bad-CLI-arguments.patch
-
-# Upstream patch to support OpenSSL API adjustments without warnings
-# https://github.com/sgallagher/sscg/commit/5547334edbf609ee987157fb19444865f8d351dc
-Patch: 0002-Adapt-to-OpenSSL-4.patch
-
 
 %description
 A utility to aid in the creation of more secure "self-signed"

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-23 18:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23 18:45 [rpms/sscg] f45: Update to sscg 4.0.4 Stephen Gallagher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox