mailx: support openssl 1.1.x

Long time no maintain from upstream since 2013-06-04,
backport a fix from openSUSE

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Hongxu Jia 2018-09-25 21:19:07 +08:00 committed by Khem Raj
parent 23d794b586
commit e46ed5b414
2 changed files with 74 additions and 1 deletions

View File

@ -0,0 +1,72 @@
From 7db6d8a657d13bb562a27c6181accaf3e53c0efd Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 25 Sep 2018 14:03:10 +0800
Subject: [PATCH] support openssl 1.1.x
Long time no maintain from upstream since 2013-06-04
(https://sourceforge.net/projects/nail/), backport a
fix from openSUSE
Upstream-Status: Backport [openSUSE]
https://build.opensuse.org/package/view_file/openSUSE:Leap:15.0/mailx/mailx-12.5-openssl-1.1.0f.patch?expand=1
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
openssl.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/openssl.c b/openssl.c
index 44fe4e5..0ccc517 100644
--- a/openssl.c
+++ b/openssl.c
@@ -137,7 +137,12 @@ ssl_rand_init(void)
if ((cp = value("ssl-rand-egd")) != NULL) {
cp = expand(cp);
- if (RAND_egd(cp) == -1) {
+#ifndef OPENSSL_NO_EGD
+ if (RAND_egd(cp) == -1)
+#else
+ if (1)
+#endif
+ {
fprintf(stderr, catgets(catd, CATSET, 245,
"entropy daemon at \"%s\" not available\n"),
cp);
@@ -216,6 +221,7 @@ ssl_select_method(const char *uhp)
cp = ssl_method_string(uhp);
if (cp != NULL) {
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010006fL
if (equal(cp, "ssl3"))
method = SSLv3_client_method();
else if (equal(cp, "tls1"))
@@ -225,8 +231,25 @@ ssl_select_method(const char *uhp)
"Invalid SSL method \"%s\"\n"), cp);
method = SSLv23_client_method();
}
+#else
+ method = NULL;
+ if (equal(cp, "tls"))
+ method = TLS_client_method();
+ else if (equal(cp, "dtls"))
+ method = DTLS_client_method();
+
+ if (!method) {
+ fprintf(stderr, catgets(catd, CATSET, 244,
+ "Invalid SSL method \"%s\"\n"), cp);
+ method = TLS_client_method();
+ }
+#endif
} else
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010006fL
method = SSLv23_client_method();
+#else
+ method = TLS_client_method();
+#endif
return method;
}
--
2.7.4

View File

@ -9,7 +9,7 @@ SECTION = "console/network"
LICENSE = "BSD & MPL-1"
LIC_FILES_CHKSUM = "file://COPYING;md5=4202a0a62910cf94f7af8a3436a2a2dd"
DEPENDS = "openssl10"
DEPENDS = "openssl"
SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/h/heirloom-mailx/heirloom-mailx_12.5.orig.tar.gz;name=archive \
file://0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch \
@ -21,6 +21,7 @@ SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/
file://0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch \
file://0015-usr-sbin-sendmail.patch \
file://explicitly.disable.krb5.support.patch \
file://0001-support-openssl-1.1.x.patch \
"
SRC_URI[archive.md5sum] = "29a6033ef1412824d02eb9d9213cb1f2"