nail: Fix compilation without deprecated OpenSSL APIs
authorRosen Penev <redacted>
Mon, 3 Dec 2018 01:01:44 +0000 (17:01 -0800)
committerRosen Penev <redacted>
Mon, 3 Dec 2018 01:01:44 +0000 (17:01 -0800)
Signed-off-by: Rosen Penev <redacted>
mail/nail/Makefile
mail/nail/patches/300-openssl-deprecated.patch [new file with mode: 0644]

index 2990084d2b3b2180753a19c930b8685022b1be91..9fefd3f9dae89524501278c0212313257e096325 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nail
 PKG_VERSION:=12.5
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 PKG_LICENSE:=BSD-2-Clause
 
 PKG_SOURCE:=heirloom-mailx_$(PKG_VERSION).orig.tar.gz
diff --git a/mail/nail/patches/300-openssl-deprecated.patch b/mail/nail/patches/300-openssl-deprecated.patch
new file mode 100644 (file)
index 0000000..8ba69ad
--- /dev/null
@@ -0,0 +1,47 @@
+--- a/openssl.c
++++ b/openssl.c
+@@ -174,7 +174,9 @@ ssl_init(void)
+ {
+       verbose = value("verbose") != NULL;
+       if (initialized == 0) {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+               SSL_library_init();
++#endif
+               initialized = 1;
+       }
+       if (rand_init == 0)
+@@ -215,12 +217,13 @@ ssl_verify_cb(int success, X509_STORE_CTX *store)
+ static const SSL_METHOD *
+ ssl_select_method(const char *uhp)
+ {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+       const SSL_METHOD *method;
+       char    *cp;
+       cp = ssl_method_string(uhp);
+       if (cp != NULL) {
+-#if !defined(OPENSSL_NO_SSL2) && !OPENSSL_VERSION_NUMBER >= 0x10100000L
++#ifndef OPENSSL_NO_SSL2
+               if (equal(cp, "ssl2"))
+                       method = SSLv2_client_method();
+               else
+@@ -240,6 +243,9 @@ ssl_select_method(const char *uhp)
+       } else
+               method = SSLv23_client_method();
+       return method;
++#else
++      return TLS_client_method();
++#endif
+ }
+ static void 
+@@ -427,7 +433,9 @@ ssl_gen_err(const char *fmt, ...)
+       va_start(ap, fmt);
+       vfprintf(stderr, fmt, ap);
+       va_end(ap);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+       SSL_load_error_strings();
++#endif
+       fprintf(stderr, ": %s\n",
+                       (ERR_error_string(ERR_get_error(), NULL)));
+ }
git clone https://git.99rst.org/PROJECT