Merge pull request #8518 from neheb/i
[feed/packages.git] / mail / dovecot / patches / 100-openssl-deprecated.patch
1 --- a/src/lib-dcrypt/dcrypt-openssl.c
2 +++ b/src/lib-dcrypt/dcrypt-openssl.c
3 @@ -20,6 +20,7 @@
4 #include <openssl/engine.h>
5 #include <openssl/hmac.h>
6 #include <openssl/objects.h>
7 +#include <openssl/bn.h>
8 #include "dcrypt.h"
9 #include "dcrypt-private.h"
10
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");*/
15 }
16
17 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
18 SSL_library_init();
19 SSL_load_error_strings();
20 OpenSSL_add_all_algorithms();
21 +#endif
22 }
23
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;
28 }
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. */
32 OBJ_cleanup();
33 @@ -100,6 +103,7 @@ bool dovecot_openssl_common_global_unref(void)
34 ERR_free_strings();
35 #ifdef HAVE_OPENSSL_CLEANUP
36 OPENSSL_cleanup();
37 +#endif
38 #endif
39 return FALSE;
40 }
41 --- a/src/lib-ssl-iostream/iostream-openssl-context.c
42 +++ b/src/lib-ssl-iostream/iostream-openssl-context.c
43 @@ -6,6 +6,9 @@
44 #include "dovecot-openssl-common.h"
45
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,
54 int nid;
55 const char *curve_name;
56 #endif
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);
60 +#endif
61 if (set->dh == NULL || *set->dh == '\0')
62 SSL_CTX_set_tmp_dh_callback(ssl_ctx, ssl_tmp_dh_callback);
63 #ifdef HAVE_ECDH