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.

43 lines
1.3 KiB

  1. --- a/src/lib-ssl-iostream/dovecot-openssl-common.c
  2. +++ b/src/lib-ssl-iostream/dovecot-openssl-common.c
  3. @@ -63,9 +63,11 @@ void dovecot_openssl_common_global_ref(v
  4. /*i_warning("CRYPTO_set_mem_functions() was called too late");*/
  5. }
  6. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  7. SSL_library_init();
  8. SSL_load_error_strings();
  9. OpenSSL_add_all_algorithms();
  10. +#endif
  11. }
  12. bool dovecot_openssl_common_global_unref(void)
  13. @@ -79,6 +81,7 @@ bool dovecot_openssl_common_global_unref
  14. ENGINE_finish(dovecot_openssl_engine);
  15. dovecot_openssl_engine = NULL;
  16. }
  17. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  18. /* OBJ_cleanup() is called automatically by EVP_cleanup() in
  19. newer versions. Doesn't hurt to call it anyway. */
  20. OBJ_cleanup();
  21. @@ -101,6 +104,7 @@ bool dovecot_openssl_common_global_unref
  22. #ifdef HAVE_OPENSSL_CLEANUP
  23. OPENSSL_cleanup();
  24. #endif
  25. +#endif
  26. return FALSE;
  27. }
  28. --- a/src/lib-ssl-iostream/iostream-openssl-context.c
  29. +++ b/src/lib-ssl-iostream/iostream-openssl-context.c
  30. @@ -558,8 +558,10 @@ ssl_proxy_ctx_set_crypto_params(SSL_CTX
  31. int nid;
  32. const char *curve_name;
  33. #endif
  34. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  35. if (SSL_CTX_need_tmp_RSA(ssl_ctx) != 0)
  36. SSL_CTX_set_tmp_rsa_callback(ssl_ctx, ssl_gen_rsa_key);
  37. +#endif
  38. if (set->dh == NULL || *set->dh == '\0')
  39. SSL_CTX_set_tmp_dh_callback(ssl_ctx, ssl_tmp_dh_callback);
  40. #ifdef HAVE_ECDH