From 0bc2461066cc7f08f2296bc9b943a239807bc34d Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 2 Jan 2018 21:16:13 -0500 Subject: [PATCH 1/3] Build with embedded popt on EPEL Signed-off-by: Stephen Gallagher --- sscg.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sscg.spec b/sscg.spec index a3e9a40..fdc643a 100644 --- a/sscg.spec +++ b/sscg.spec @@ -19,11 +19,12 @@ Source0: https://%{provider_prefix}/releases/download/%{repo}-%{version}/ BuildRequires: gcc BuildRequires: libtalloc-devel BuildRequires: openssl-devel -BuildRequires: popt-devel BuildRequires: libpath_utils-devel BuildRequires: meson BuildRequires: ninja-build +Provides: bundled(popt) = 1.16 + %description A utility to aid in the creation of more secure "self-signed" certificates. The certificates created by this tool are generated in a From 83d445c230d562c733441346bc87588ec7965a38 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 12 Feb 2019 16:45:07 -0500 Subject: [PATCH 2/3] Add patch to properly initialize OpenSSL 1.0 Signed-off-by: Stephen Gallagher --- ...nitialize-OpenSSL-with-OpenSSL-1.1.0.patch | 40 +++++++++++++++++++ sscg.spec | 7 +++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 0001-Initialize-OpenSSL-with-OpenSSL-1.1.0.patch diff --git a/0001-Initialize-OpenSSL-with-OpenSSL-1.1.0.patch b/0001-Initialize-OpenSSL-with-OpenSSL-1.1.0.patch new file mode 100644 index 0000000..0042bf5 --- /dev/null +++ b/0001-Initialize-OpenSSL-with-OpenSSL-1.1.0.patch @@ -0,0 +1,40 @@ +From b9c3f63af5a77cf295788bb9c7ba33274956a65e Mon Sep 17 00:00:00 2001 +From: Patrick Uiterwijk +Date: Tue, 12 Feb 2019 21:53:42 +0100 +Subject: [PATCH] Initialize OpenSSL with OpenSSL <1.1.0 + +This is needed for `EVP_get_digestbyname` to work on OpenSSL<1.1.0, because we +need to manually initialize the name->digest lookup table. +This didn't get caught before probably because the default used `EVP_sha256`, +which does an implicit initialization for just sha256. + +Without this, on OpenSSL 1.0, you get `Unsupported hashing algorithm.Invalid argument.`. + +Signed-off-by: Patrick Uiterwijk +--- + src/sscg.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/sscg.c b/src/sscg.c +index ee41c76c624fef176fe4428b0d9ee9aaffe8aa05..553bf2d134f63d1a2d8e2859581021f469bf24c4 100644 +--- a/src/sscg.c ++++ b/src/sscg.c +@@ -216,10 +216,15 @@ main (int argc, const char **argv) + /* Always use umask 0577 for generating certificates and keys + This means that it's opened as write-only by the effective + user. */ + umask (0577); + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ /* In OpenSSL <1.1.0, we need to initialize the library. */ ++ OpenSSL_add_all_algorithms(); ++#endif ++ + TALLOC_CTX *main_ctx = talloc_new (NULL); + if (!main_ctx) + { + fprintf (stderr, "Could not allocate memory."); + return ENOMEM; +-- +2.20.1 + diff --git a/sscg.spec b/sscg.spec index 7206fe6..ad0983f 100644 --- a/sscg.spec +++ b/sscg.spec @@ -28,6 +28,10 @@ BuildRequires: clang Provides: bundled(popt) = 1.16 + +# Patches +Patch0001: 0001-Initialize-OpenSSL-with-OpenSSL-1.1.0.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 @@ -37,7 +41,7 @@ up a full PKI environment and without exposing the machine to a risk of false signatures from the service certificate. %prep -%autosetup +%autosetup -p1 %build @@ -63,6 +67,7 @@ false signatures from the service certificate. * Wed Nov 28 2018 Stephen Gallagher - 2.5.1-1 - Update to 2.5.1 - Fixes discovered by automated testing. +- Fix use of non-default hash algorithms on OpenSSL 1.0 * Wed Nov 28 2018 Stephen Gallagher - 2.5.0-1 - Update to 2.5.0 From 32dd48671e01fb3747c3cdc117a226babb632c42 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 23 Jun 2020 15:52:02 -0400 Subject: [PATCH 3/3] Drop upstreamed patch Signed-off-by: Stephen Gallagher --- sscg.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/sscg.spec b/sscg.spec index f2d03bd..1299663 100644 --- a/sscg.spec +++ b/sscg.spec @@ -24,8 +24,6 @@ BuildRequires: meson BuildRequires: ninja-build BuildRequires: help2man -Patch0001: 0001-Make-clang-format-optional.patch - Provides: bundled(popt) = 1.16