1 --- a/src/lib-dcrypt/dcrypt-openssl.c
2 +++ b/src/lib-dcrypt/dcrypt-openssl.c
4 #include <openssl/engine.h>
5 #include <openssl/hmac.h>
6 #include <openssl/objects.h>
7 +#include <openssl/bn.h>
9 #include "dcrypt-private.h"
11 --- a/src/lib-ssl-iostream/dovecot-openssl-common.c
12 +++ b/src/lib-ssl-iostream/dovecot-openssl-common.c
13 @@ -63,9 +63,11 @@ void dovecot_openssl_common_global_ref(void)
14 /*i_warning("CRYPTO_set_mem_functions() was called too late");*/
17 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
19 SSL_load_error_strings();
20 OpenSSL_add_all_algorithms();
24 bool dovecot_openssl_common_global_unref(void)
25 @@ -79,6 +81,7 @@ bool dovecot_openssl_common_global_unref(void)
26 ENGINE_finish(dovecot_openssl_engine);
27 dovecot_openssl_engine = NULL;
29 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
30 /* OBJ_cleanup() is called automatically by EVP_cleanup() in
31 newer versions. Doesn't hurt to call it anyway. */
33 @@ -100,6 +103,7 @@ bool dovecot_openssl_common_global_unref(void)
35 #ifdef HAVE_OPENSSL_CLEANUP
41 --- a/src/lib-ssl-iostream/iostream-openssl-context.c
42 +++ b/src/lib-ssl-iostream/iostream-openssl-context.c
44 #include "dovecot-openssl-common.h"
46 #include <openssl/crypto.h>
47 +#include <openssl/rsa.h>
48 +#include <openssl/dh.h>
49 +#include <openssl/bn.h>
50 #include <openssl/x509.h>
51 #include <openssl/pem.h>
52 #include <openssl/ssl.h>
53 @@ -510,8 +513,10 @@ ssl_proxy_ctx_set_crypto_params(SSL_CTX *ssl_ctx,
55 const char *curve_name;
57 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
58 if (SSL_CTX_need_tmp_RSA(ssl_ctx) != 0)
59 SSL_CTX_set_tmp_rsa_callback(ssl_ctx, ssl_gen_rsa_key);
61 if (set->dh == NULL || *set->dh == '\0')
62 SSL_CTX_set_tmp_dh_callback(ssl_ctx, ssl_tmp_dh_callback);