aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Duskett <aduskett@gmail.com>2017-10-17 22:32:35 -0400
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-10-21 21:28:13 +0200
commit9f145e4957fa562ed8df89527433fccd438b3502 (patch)
treee3b1378170f4623ce83f25769c634ed2e628695e
parent123e0c9fefcf53641b8e80254929d485a1783f36 (diff)
downloadbuildroot-9f145e4957fa562ed8df89527433fccd438b3502.tar.gz
buildroot-9f145e4957fa562ed8df89527433fccd438b3502.tar.bz2
heirloom-mailx: add libressl support patch
heirloom-mailx has two small issues when compiling against LibreSSL: - RAND_egd is used (LibreSSL does not support RAND_egd) Solution: "Guard" the code calling RAND_egd - SSLv3_client_method function is used (LibreSSL does not support SSLv3) Solution: "Guard" the code with #ifndef OPENSSL_NO_SSL3 Signed-off-by: Adam Duskett <Adamduskett@outlook.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/heirloom-mailx/0002-fix-libressl-support.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/package/heirloom-mailx/0002-fix-libressl-support.patch b/package/heirloom-mailx/0002-fix-libressl-support.patch
new file mode 100644
index 0000000000..0fafa4ae0b
--- /dev/null
+++ b/package/heirloom-mailx/0002-fix-libressl-support.patch
@@ -0,0 +1,54 @@
+From aad28d30af6c3a74c522dd61943788e908860c84 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <Adamduskett@outlook.com>
+Date: Fri, 4 Aug 2017 07:22:47 -0400
+Subject: [PATCH] fix libressl support
+
+heirloom-mailx has two small issues when compiling against LibreSSL:
+ - RAND_egd is used (LibreSSL does not support RAND_egd)
+ Solution: "Guard" the code calling RAND_egd
+
+ - SSLv3_client_method function is used (LibreSSL does not support SSLv3)
+ Solution: "Guard" the code with #ifndef OPENSSL_NO_SSL3
+
+Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
+---
+ openssl.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/openssl.c b/openssl.c
+index 44fe4e5..c4a1bb7 100644
+--- a/openssl.c
++++ b/openssl.c
+@@ -137,11 +137,13 @@ ssl_rand_init(void)
+
+ if ((cp = value("ssl-rand-egd")) != NULL) {
+ cp = expand(cp);
++#ifndef OPENSSL_NO_EGD
+ if (RAND_egd(cp) == -1) {
+ fprintf(stderr, catgets(catd, CATSET, 245,
+ "entropy daemon at \"%s\" not available\n"),
+ cp);
+ } else
++#endif
+ state = 1;
+ } else if ((cp = value("ssl-rand-file")) != NULL) {
+ cp = expand(cp);
+@@ -216,10 +218,15 @@ ssl_select_method(const char *uhp)
+
+ cp = ssl_method_string(uhp);
+ if (cp != NULL) {
++ #ifndef OPENSSL_NO_SSL3
+ if (equal(cp, "ssl3"))
+ method = SSLv3_client_method();
+ else if (equal(cp, "tls1"))
+ method = TLSv1_client_method();
++ #else
++ if (equal(cp, "tls1"))
++ method = TLSv1_client_method();
++ #endif
+ else {
+ fprintf(stderr, catgets(catd, CATSET, 244,
+ "Invalid SSL method \"%s\"\n"), cp);
+--
+2.13.3
+