commit:     a37eb25a8d5369998006b01444ec729abde63195
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Wed Apr 12 18:32:40 2023 +0000
Commit:     orbea <orbea <AT> riseup <DOT> net>
CommitDate: Wed Apr 12 18:35:48 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=a37eb25a

dev-libs/libressl: Add patch

Gentoo uses 'openssl genrsa -rand' in ssl-cert.eclass, but LibreSSL
doesn't support -rand so this patch makes it a no-op for compatibility.

Upstream-issue: https://github.com/libressl/portable/issues/839
Signed-off-by: orbea <orbea <AT> riseup.net>

 .../files/libressl-3.6.2-genrsa-rand.patch         | 26 ++++++++++++++++++++++
 .../files/libressl-3.7.2-genrsa-rand.patch         | 26 ++++++++++++++++++++++
 ...ressl-3.6.2.ebuild => libressl-3.6.2-r1.ebuild} |  6 ++++-
 ...ressl-3.7.2.ebuild => libressl-3.7.2-r1.ebuild} |  4 ++++
 4 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/dev-libs/libressl/files/libressl-3.6.2-genrsa-rand.patch 
b/dev-libs/libressl/files/libressl-3.6.2-genrsa-rand.patch
new file mode 100644
index 0000000..69458d7
--- /dev/null
+++ b/dev-libs/libressl/files/libressl-3.6.2-genrsa-rand.patch
@@ -0,0 +1,26 @@
+Gentoo's ssl-cert.eclass uses 'openssl genrsa -rand'.
+
+Upstream Issue: https://github.com/libressl/portable/issues/839
+
+--- a/apps/openssl/genrsa.c.orig
++++ b/apps/openssl/genrsa.c
+@@ -90,6 +90,7 @@
+       unsigned long f4;
+       char *outfile;
+       char *passargout;
++      char *rand_dummy;
+ } genrsa_config;
+ 
+ static int
+@@ -252,6 +253,11 @@
+               .type = OPTION_ARG,
+               .opt.arg = &genrsa_config.passargout,
+       },
++      {
++              .name = "rand",
++              .type = OPTION_ARG,
++              .opt.arg = &genrsa_config.rand_dummy,
++      },
+       { NULL },
+ };
+ 

diff --git a/dev-libs/libressl/files/libressl-3.7.2-genrsa-rand.patch 
b/dev-libs/libressl/files/libressl-3.7.2-genrsa-rand.patch
new file mode 100644
index 0000000..66fe21a
--- /dev/null
+++ b/dev-libs/libressl/files/libressl-3.7.2-genrsa-rand.patch
@@ -0,0 +1,26 @@
+Gentoo's ssl-cert.eclass uses 'openssl genrsa -rand'.
+
+Upstream Issue: https://github.com/libressl/portable/issues/839
+
+--- a/apps/openssl/genrsa.c.orig
++++ b/apps/openssl/genrsa.c
+@@ -90,6 +90,7 @@ static struct {
+       unsigned long f4;
+       char *outfile;
+       char *passargout;
++      char *rand_dummy;
+ } cfg;
+ 
+ static int
+@@ -251,6 +252,11 @@ static const struct option genrsa_option
+               .desc = "Output file passphrase source",
+               .type = OPTION_ARG,
+               .opt.arg = &cfg.passargout,
++      },
++      {
++              .name = "rand",
++              .type = OPTION_ARG,
++              .opt.arg = &cfg.rand_dummy,
+       },
+       { NULL },
+ };

diff --git a/dev-libs/libressl/libressl-3.6.2.ebuild 
b/dev-libs/libressl/libressl-3.6.2-r1.ebuild
similarity index 86%
rename from dev-libs/libressl/libressl-3.6.2.ebuild
rename to dev-libs/libressl/libressl-3.6.2-r1.ebuild
index da82d96..b7e8276 100644
--- a/dev-libs/libressl/libressl-3.6.2.ebuild
+++ b/dev-libs/libressl/libressl-3.6.2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -29,6 +29,10 @@ 
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/libressl.asc
 
 PATCHES=(
        "${FILESDIR}"/${PN}-2.8.3-solaris10.patch
+       # Gentoo's ssl-cert.eclass uses 'openssl genrsa -rand'
+       # which LibreSSL doesn't support.
+       # https://github.com/libressl/portable/issues/839
+       "${FILESDIR}"/${PN}-3.6.2-genrsa-rand.patch
 )
 
 src_prepare() {

diff --git a/dev-libs/libressl/libressl-3.7.2.ebuild 
b/dev-libs/libressl/libressl-3.7.2-r1.ebuild
similarity index 88%
rename from dev-libs/libressl/libressl-3.7.2.ebuild
rename to dev-libs/libressl/libressl-3.7.2-r1.ebuild
index 168cab3..4658dc0 100644
--- a/dev-libs/libressl/libressl-3.7.2.ebuild
+++ b/dev-libs/libressl/libressl-3.7.2-r1.ebuild
@@ -30,6 +30,10 @@ MULTILIB_WRAPPED_HEADERS=( 
/usr/include/openssl/opensslconf.h )
 
 PATCHES=(
        "${FILESDIR}"/${PN}-2.8.3-solaris10.patch
+       # Gentoo's ssl-cert.eclass uses 'openssl genrsa -rand'
+       # which LibreSSL doesn't support.
+       # https://github.com/libressl/portable/issues/839
+       "${FILESDIR}"/${PN}-3.7.2-genrsa-rand.patch
 )
 
 src_prepare() {

Reply via email to