From 2cca3857abd69af15ee1e11fd5918ddd17cf703c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 2 Dec 2018 16:25:17 -0800 Subject: [PATCH] msmtp: Fix compilation without deprecated OpenSSL APIs Signed-off-by: Rosen Penev --- mail/msmtp/Makefile | 2 +- .../patches/010-openssl-deprecated.patch | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 mail/msmtp/patches/010-openssl-deprecated.patch diff --git a/mail/msmtp/Makefile b/mail/msmtp/Makefile index 6bc23912c..2c9ec3249 100644 --- a/mail/msmtp/Makefile +++ b/mail/msmtp/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=msmtp PKG_VERSION:=1.6.8 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://marlam.de/msmtp/releases diff --git a/mail/msmtp/patches/010-openssl-deprecated.patch b/mail/msmtp/patches/010-openssl-deprecated.patch new file mode 100644 index 000000000..2a229aad5 --- /dev/null +++ b/mail/msmtp/patches/010-openssl-deprecated.patch @@ -0,0 +1,42 @@ +--- a/src/tls.c ++++ b/src/tls.c +@@ -45,6 +45,10 @@ + # include + # include + # include ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#define X509_getm_notBefore X509_get_notBefore ++#define X509_getm_notAfter X509_get_notAfter ++#endif + #endif /* HAVE_LIBSSL */ + + #ifdef HAVE_LIBIDN +@@ -167,8 +171,10 @@ int tls_lib_init(char **errstr) + #ifdef HAVE_LIBSSL + int e; + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_load_error_strings(); + SSL_library_init(); ++#endif + if ((e = seed_prng(errstr)) != TLS_EOK) + { + return e; +@@ -518,7 +524,7 @@ int tls_cert_info_get(tls_t *tls, tls_cert_info_t *tci, char **errstr) + *errstr = xasprintf(_("%s: error getting SHA1 fingerprint"), errmsg); + return TLS_ECERT; + } +- asn1time = X509_get_notBefore(x509cert); ++ asn1time = X509_getm_notBefore(x509cert); + if (asn1time_to_time_t((char *)asn1time->data, + (asn1time->type != V_ASN1_GENERALIZEDTIME), + &(tci->activation_time)) != 0) +@@ -528,7 +534,7 @@ int tls_cert_info_get(tls_t *tls, tls_cert_info_t *tci, char **errstr) + tls_cert_info_free(tci); + return TLS_ECERT; + } +- asn1time = X509_get_notAfter(x509cert); ++ asn1time = X509_getm_notAfter(x509cert); + if (asn1time_to_time_t((char *)asn1time->data, + (asn1time->type != V_ASN1_GENERALIZEDTIME), + &(tci->expiration_time)) != 0)