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.8 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(v
  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
  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. @@ -101,6 +104,7 @@ bool dovecot_openssl_common_global_unref
  31. #ifdef HAVE_OPENSSL_CLEANUP
  32. OPENSSL_cleanup();
  33. #endif
  34. +#endif
  35. return FALSE;
  36. }
  37. --- a/src/lib-ssl-iostream/iostream-openssl-context.c
  38. +++ b/src/lib-ssl-iostream/iostream-openssl-context.c
  39. @@ -6,6 +6,9 @@
  40. #include "dovecot-openssl-common.h"
  41. #include <openssl/crypto.h>
  42. +#include <openssl/rsa.h>
  43. +#include <openssl/dh.h>
  44. +#include <openssl/bn.h>
  45. #include <openssl/x509.h>
  46. #include <openssl/pem.h>
  47. #include <openssl/ssl.h>
  48. @@ -514,8 +517,10 @@ ssl_proxy_ctx_set_crypto_params(SSL_CTX
  49. int nid;
  50. const char *curve_name;
  51. #endif
  52. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  53. if (SSL_CTX_need_tmp_RSA(ssl_ctx) != 0)
  54. SSL_CTX_set_tmp_rsa_callback(ssl_ctx, ssl_gen_rsa_key);
  55. +#endif
  56. if (set->dh == NULL || *set->dh == '\0')
  57. SSL_CTX_set_tmp_dh_callback(ssl_ctx, ssl_tmp_dh_callback);
  58. #ifdef HAVE_ECDH