You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.9 KiB

  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. --- a/src/lib-ssl-iostream/dovecot-openssl-common.c
  11. +++ b/src/lib-ssl-iostream/dovecot-openssl-common.c
  12. @@ -63,9 +63,11 @@ void dovecot_openssl_common_global_ref(void)
  13. /*i_warning("CRYPTO_set_mem_functions() was called too late");*/
  14. }
  15. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  16. SSL_library_init();
  17. SSL_load_error_strings();
  18. OpenSSL_add_all_algorithms();
  19. +#endif
  20. }
  21. bool dovecot_openssl_common_global_unref(void)
  22. @@ -79,6 +81,7 @@ bool dovecot_openssl_common_global_unref(void)
  23. ENGINE_finish(dovecot_openssl_engine);
  24. dovecot_openssl_engine = NULL;
  25. }
  26. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  27. /* OBJ_cleanup() is called automatically by EVP_cleanup() in
  28. newer versions. Doesn't hurt to call it anyway. */
  29. OBJ_cleanup();
  30. @@ -100,6 +103,7 @@ bool dovecot_openssl_common_global_unref(void)
  31. ERR_free_strings();
  32. #ifdef HAVE_OPENSSL_CLEANUP
  33. OPENSSL_cleanup();
  34. +#endif
  35. #endif
  36. return FALSE;
  37. }
  38. --- a/src/lib-ssl-iostream/iostream-openssl-context.c
  39. +++ b/src/lib-ssl-iostream/iostream-openssl-context.c
  40. @@ -6,6 +6,9 @@
  41. #include "dovecot-openssl-common.h"
  42. #include <openssl/crypto.h>
  43. +#include <openssl/rsa.h>
  44. +#include <openssl/dh.h>
  45. +#include <openssl/bn.h>
  46. #include <openssl/x509.h>
  47. #include <openssl/pem.h>
  48. #include <openssl/ssl.h>
  49. @@ -510,8 +513,10 @@ ssl_proxy_ctx_set_crypto_params(SSL_CTX *ssl_ctx,
  50. int nid;
  51. const char *curve_name;
  52. #endif
  53. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  54. if (SSL_CTX_need_tmp_RSA(ssl_ctx) != 0)
  55. SSL_CTX_set_tmp_rsa_callback(ssl_ctx, ssl_gen_rsa_key);
  56. +#endif
  57. if (set->dh == NULL || *set->dh == '\0')
  58. SSL_CTX_set_tmp_dh_callback(ssl_ctx, ssl_tmp_dh_callback);
  59. #ifdef HAVE_ECDH