From c3c5af5d837673d48a5ad682fe16caa005f44989 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 6 Nov 2018 18:51:26 -0800 Subject: [PATCH] alpine: Fix compilation without deprecated APIs on OpenSSL 1.0.2 Signed-off-by: Rosen Penev --- mail/alpine/Makefile | 2 +- .../patches/010-openssl-deprecated.patch | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 mail/alpine/patches/010-openssl-deprecated.patch diff --git a/mail/alpine/Makefile b/mail/alpine/Makefile index 3baddcd44..ded0999f8 100644 --- a/mail/alpine/Makefile +++ b/mail/alpine/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=alpine PKG_VERSION:=2.21.9999 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/mail/alpine/patches/010-openssl-deprecated.patch b/mail/alpine/patches/010-openssl-deprecated.patch new file mode 100644 index 000000000..5426b8163 --- /dev/null +++ b/mail/alpine/patches/010-openssl-deprecated.patch @@ -0,0 +1,61 @@ +diff --git a/imap/src/osdep/unix/ssl_unix.c b/imap/src/osdep/unix/ssl_unix.c +index 4c4d6ef..f2df2f2 100644 +--- a/imap/src/osdep/unix/ssl_unix.c ++++ b/imap/src/osdep/unix/ssl_unix.c +@@ -33,9 +33,9 @@ + #include + #include + #include +-#ifdef OPENSSL_1_1_0 + #include + #include ++#ifdef OPENSSL_1_1_0 + #ifdef TLSv1_1_client_method + #undef TLSv1_1_client_method + #endif /* TLSv1_1_client_method */ +@@ -862,22 +862,16 @@ static RSA *ssl_genkey (SSL_CTX_TYPE *con,int export,int keylength) + static RSA *key = NIL; + if (!key) { /* if don't have a key already */ + /* generate key */ +-#ifdef OPENSSL_1_1_0 + BIGNUM *e = BN_new(); + if (!RSA_generate_key_ex (key, export ? keylength : 1024, e,NIL)) { +-#else +- if (!(key = RSA_generate_key (export ? keylength : 1024,RSA_F4,NIL,NIL))) { +-#endif /* OPENSSL_1_1_0 */ + syslog (LOG_ALERT,"Unable to generate temp key, host=%.80s", + tcp_clienthost ()); + while ((i = ERR_get_error ()) != 0L) + syslog (LOG_ALERT,"SSL error status: %s",ERR_error_string (i,NIL)); + exit (1); + } +-#ifdef OPENSSL_1_1_0 + BN_free(e); + e = NULL; +-#endif /* OPENSSL_1_1_0 */ + } + return key; + } +diff --git a/pith/smkeys.h b/pith/smkeys.h +index e37eea3..a6c143b 100644 +--- a/pith/smkeys.h ++++ b/pith/smkeys.h +@@ -32,6 +32,8 @@ + #include + #include + #include ++#include ++#include + + #ifndef OPENSSL_1_1_0 + #define X509_get0_notBefore(x) ((x) && (x)->cert_info \ +@@ -47,9 +49,6 @@ + ? (x)->cert_info->validity->notAfter \ + : NULL) + #define X509_REQ_get0_pubkey(x) (X509_REQ_get_pubkey((x))) +-#else +-#include +-#include + #endif /* OPENSSL_1_1_0 */ + + #define EMAILADDRLEADER "emailAddress="