nail: add compatibility with openssl 1.1
authorEneas U de Queiroz <redacted>
Thu, 24 May 2018 14:41:02 +0000 (11:41 -0300)
committerEneas U de Queiroz <redacted>
Thu, 24 May 2018 14:41:02 +0000 (11:41 -0300)
Openssl 1.1 doesn't support SSL2 and does not define the OPENSSL_NO_SSL2
flag either.  Also, it defaults to NO_EGD, so do not use EGD if it's not
enabled in openssl.

Signed-off-by: Eneas U de Queiroz <redacted>
mail/nail/Makefile
mail/nail/patches/100-handle-openssl-without-sslv2-sslv3.patch
mail/nail/patches/200-handle-openssl-no-egd.patch [new file with mode: 0644]

index 433cfc084db3c13087f2e920109ed0d5b5e8a6aa..20c12751360d532aa6f86a082d4595e21337c0a8 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nail
 PKG_VERSION:=12.5
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_LICENSE:=BSD-2-Clause
 
 PKG_SOURCE:=heirloom-mailx_$(PKG_VERSION).orig.tar.gz
index 793bc3dc09600053ff080cb890d929a331924904..96a51454972552c5c2a69ceed8b776bc97f8eddb 100644 (file)
@@ -4,7 +4,7 @@
  
        cp = ssl_method_string(uhp);
        if (cp != NULL) {
-+#ifndef OPENSSL_NO_SSL2
++#if !defined(OPENSSL_NO_SSL2) && !OPENSSL_VERSION_NUMBER >= 0x10100000L
                if (equal(cp, "ssl2"))
                        method = SSLv2_client_method();
 -              else if (equal(cp, "ssl3"))
diff --git a/mail/nail/patches/200-handle-openssl-no-egd.patch b/mail/nail/patches/200-handle-openssl-no-egd.patch
new file mode 100644 (file)
index 0000000..d14c2d2
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/openssl.c
++++ b/openssl.c
+@@ -137,7 +137,11 @@ ssl_rand_init(void)
+       if ((cp = value("ssl-rand-egd")) != NULL) {
+               cp = expand(cp);
++#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);
git clone https://git.99rst.org/PROJECT