dovecot: Fix compilation with OpenSSL 1.1
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
b4c129f81d
commit
05c39b5dde
3 changed files with 24 additions and 9 deletions
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=dovecot
|
PKG_NAME:=dovecot
|
||||||
PKG_VERSION:=2.3.4.1
|
PKG_VERSION:=2.3.4.1
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://www.dovecot.org/releases/2.3
|
PKG_SOURCE_URL:=https://www.dovecot.org/releases/2.3
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
diff --git a/src/lib-dcrypt/dcrypt-openssl.c b/src/lib-dcrypt/dcrypt-openssl.c
|
|
||||||
index c2dbd30..201ab40 100644
|
|
||||||
--- a/src/lib-dcrypt/dcrypt-openssl.c
|
--- a/src/lib-dcrypt/dcrypt-openssl.c
|
||||||
+++ b/src/lib-dcrypt/dcrypt-openssl.c
|
+++ b/src/lib-dcrypt/dcrypt-openssl.c
|
||||||
@@ -20,6 +20,7 @@
|
@@ -20,6 +20,7 @@
|
||||||
|
@ -10,8 +8,24 @@ index c2dbd30..201ab40 100644
|
||||||
#include "dcrypt.h"
|
#include "dcrypt.h"
|
||||||
#include "dcrypt-private.h"
|
#include "dcrypt-private.h"
|
||||||
|
|
||||||
diff --git a/src/lib-ssl-iostream/iostream-openssl-context.c b/src/lib-ssl-iostream/iostream-openssl-context.c
|
--- a/src/lib-ssl-iostream/dovecot-openssl-common.c
|
||||||
index e3c902e..ad6a9c1 100644
|
+++ b/src/lib-ssl-iostream/dovecot-openssl-common.c
|
||||||
|
@@ -79,6 +79,7 @@ bool dovecot_openssl_common_global_unref(void)
|
||||||
|
ENGINE_finish(dovecot_openssl_engine);
|
||||||
|
dovecot_openssl_engine = NULL;
|
||||||
|
}
|
||||||
|
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
|
/* OBJ_cleanup() is called automatically by EVP_cleanup() in
|
||||||
|
newer versions. Doesn't hurt to call it anyway. */
|
||||||
|
OBJ_cleanup();
|
||||||
|
@@ -100,6 +101,7 @@ bool dovecot_openssl_common_global_unref(void)
|
||||||
|
ERR_free_strings();
|
||||||
|
#ifdef HAVE_OPENSSL_CLEANUP
|
||||||
|
OPENSSL_cleanup();
|
||||||
|
+#endif
|
||||||
|
#endif
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
--- a/src/lib-ssl-iostream/iostream-openssl-context.c
|
--- a/src/lib-ssl-iostream/iostream-openssl-context.c
|
||||||
+++ b/src/lib-ssl-iostream/iostream-openssl-context.c
|
+++ b/src/lib-ssl-iostream/iostream-openssl-context.c
|
||||||
@@ -6,6 +6,9 @@
|
@@ -6,6 +6,9 @@
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
#ifdef HAVE_SSL_NEW_MEM_FUNCS
|
#ifdef HAVE_SSL_NEW_MEM_FUNCS
|
||||||
static void *dovecot_openssl_malloc(size_t size, const char *u0 ATTR_UNUSED, int u1 ATTR_UNUSED)
|
static void *dovecot_openssl_malloc(size_t size, const char *u0 ATTR_UNUSED, int u1 ATTR_UNUSED)
|
||||||
@@ -75,17 +78,21 @@ bool dovecot_openssl_common_global_unref(void)
|
@@ -75,10 +78,12 @@ bool dovecot_openssl_common_global_unref(void)
|
||||||
if (--openssl_init_refcount > 0)
|
if (--openssl_init_refcount > 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@ -57,9 +57,10 @@
|
||||||
dovecot_openssl_engine = NULL;
|
dovecot_openssl_engine = NULL;
|
||||||
}
|
}
|
||||||
+#endif
|
+#endif
|
||||||
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
/* OBJ_cleanup() is called automatically by EVP_cleanup() in
|
/* OBJ_cleanup() is called automatically by EVP_cleanup() in
|
||||||
newer versions. Doesn't hurt to call it anyway. */
|
newer versions. Doesn't hurt to call it anyway. */
|
||||||
OBJ_cleanup();
|
@@ -86,7 +91,9 @@ bool dovecot_openssl_common_global_unref(void)
|
||||||
#ifdef HAVE_SSL_COMP_FREE_COMPRESSION_METHODS
|
#ifdef HAVE_SSL_COMP_FREE_COMPRESSION_METHODS
|
||||||
SSL_COMP_free_compression_methods();
|
SSL_COMP_free_compression_methods();
|
||||||
#endif
|
#endif
|
||||||
|
@ -69,7 +70,7 @@
|
||||||
EVP_cleanup();
|
EVP_cleanup();
|
||||||
CRYPTO_cleanup_all_ex_data();
|
CRYPTO_cleanup_all_ex_data();
|
||||||
#ifdef HAVE_OPENSSL_AUTO_THREAD_DEINIT
|
#ifdef HAVE_OPENSSL_AUTO_THREAD_DEINIT
|
||||||
@@ -107,6 +114,7 @@ bool dovecot_openssl_common_global_unref(void)
|
@@ -109,6 +116,7 @@ bool dovecot_openssl_common_global_unref(void)
|
||||||
int dovecot_openssl_common_global_set_engine(const char *engine,
|
int dovecot_openssl_common_global_set_engine(const char *engine,
|
||||||
const char **error_r)
|
const char **error_r)
|
||||||
{
|
{
|
||||||
|
@ -77,7 +78,7 @@
|
||||||
if (dovecot_openssl_engine != NULL)
|
if (dovecot_openssl_engine != NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@@ -128,5 +136,6 @@ int dovecot_openssl_common_global_set_engine(const char *engine,
|
@@ -130,5 +138,6 @@ int dovecot_openssl_common_global_set_engine(const char *engine,
|
||||||
dovecot_openssl_engine = NULL;
|
dovecot_openssl_engine = NULL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue