Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | From 7db6d8a657d13bb562a27c6181accaf3e53c0efd Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Tue, 25 Sep 2018 14:03:10 +0800 |
| 4 | Subject: [PATCH] support openssl 1.1.x |
| 5 | |
| 6 | Long time no maintain from upstream since 2013-06-04 |
| 7 | (https://sourceforge.net/projects/nail/), backport a |
| 8 | fix from openSUSE |
| 9 | |
| 10 | Upstream-Status: Backport [openSUSE] |
| 11 | https://build.opensuse.org/package/view_file/openSUSE:Leap:15.0/mailx/mailx-12.5-openssl-1.1.0f.patch?expand=1 |
| 12 | |
| 13 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 14 | --- |
| 15 | openssl.c | 25 ++++++++++++++++++++++++- |
| 16 | 1 file changed, 24 insertions(+), 1 deletion(-) |
| 17 | |
| 18 | diff --git a/openssl.c b/openssl.c |
| 19 | index 44fe4e5..0ccc517 100644 |
| 20 | --- a/openssl.c |
| 21 | +++ b/openssl.c |
| 22 | @@ -137,7 +137,12 @@ ssl_rand_init(void) |
| 23 | |
| 24 | if ((cp = value("ssl-rand-egd")) != NULL) { |
| 25 | cp = expand(cp); |
| 26 | - if (RAND_egd(cp) == -1) { |
| 27 | +#ifndef OPENSSL_NO_EGD |
| 28 | + if (RAND_egd(cp) == -1) |
| 29 | +#else |
| 30 | + if (1) |
| 31 | +#endif |
| 32 | + { |
| 33 | fprintf(stderr, catgets(catd, CATSET, 245, |
| 34 | "entropy daemon at \"%s\" not available\n"), |
| 35 | cp); |
| 36 | @@ -216,6 +221,7 @@ ssl_select_method(const char *uhp) |
| 37 | |
| 38 | cp = ssl_method_string(uhp); |
| 39 | if (cp != NULL) { |
| 40 | +#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010006fL |
| 41 | if (equal(cp, "ssl3")) |
| 42 | method = SSLv3_client_method(); |
| 43 | else if (equal(cp, "tls1")) |
| 44 | @@ -225,8 +231,25 @@ ssl_select_method(const char *uhp) |
| 45 | "Invalid SSL method \"%s\"\n"), cp); |
| 46 | method = SSLv23_client_method(); |
| 47 | } |
| 48 | +#else |
| 49 | + method = NULL; |
| 50 | + if (equal(cp, "tls")) |
| 51 | + method = TLS_client_method(); |
| 52 | + else if (equal(cp, "dtls")) |
| 53 | + method = DTLS_client_method(); |
| 54 | + |
| 55 | + if (!method) { |
| 56 | + fprintf(stderr, catgets(catd, CATSET, 244, |
| 57 | + "Invalid SSL method \"%s\"\n"), cp); |
| 58 | + method = TLS_client_method(); |
| 59 | + } |
| 60 | +#endif |
| 61 | } else |
| 62 | +#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010006fL |
| 63 | method = SSLv23_client_method(); |
| 64 | +#else |
| 65 | + method = TLS_client_method(); |
| 66 | +#endif |
| 67 | return method; |
| 68 | } |
| 69 | |
| 70 | -- |
| 71 | 2.7.4 |
| 72 | |