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.

92 lines
2.5 KiB

  1. diff --git a/configure b/configure
  2. index d586ca2..ee39284 100755
  3. --- a/configure
  4. +++ b/configure
  5. @@ -11896,9 +11896,9 @@ fi
  6. fi
  7. if test x$with_openssl != xno ; then
  8. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5
  9. -$as_echo_n "checking for SSL_library_init in -lssl... " >&6; }
  10. -if test "${ac_cv_lib_ssl_SSL_library_init+set}" = set; then :
  11. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5
  12. +$as_echo_n "checking for SSL_new in -lssl... " >&6; }
  13. +if test "${ac_cv_lib_ssl_SSL_new+set}" = set; then :
  14. $as_echo_n "(cached) " >&6
  15. else
  16. ac_check_lib_save_LIBS=$LIBS
  17. @@ -11913,27 +11913,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  18. #ifdef __cplusplus
  19. extern "C"
  20. #endif
  21. -char SSL_library_init ();
  22. +char SSL_new ();
  23. int
  24. main ()
  25. {
  26. -return SSL_library_init ();
  27. +return SSL_new ();
  28. ;
  29. return 0;
  30. }
  31. _ACEOF
  32. if ac_fn_c_try_link "$LINENO"; then :
  33. - ac_cv_lib_ssl_SSL_library_init=yes
  34. + ac_cv_lib_ssl_SSL_new=yes
  35. else
  36. - ac_cv_lib_ssl_SSL_library_init=no
  37. + ac_cv_lib_ssl_SSL_new=no
  38. fi
  39. rm -f core conftest.err conftest.$ac_objext \
  40. conftest$ac_exeext conftest.$ac_ext
  41. LIBS=$ac_check_lib_save_LIBS
  42. fi
  43. -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5
  44. -$as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; }
  45. -if test "x$ac_cv_lib_ssl_SSL_library_init" = x""yes; then :
  46. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_new" >&5
  47. +$as_echo "$ac_cv_lib_ssl_SSL_new" >&6; }
  48. +if test "x$ac_cv_lib_ssl_SSL_new" = x""yes; then :
  49. with_openssl=yes
  50. LIBS="-lssl -lcrypto $LIBS"
  51. diff --git a/smtp-tls.c b/smtp-tls.c
  52. index 9a66806..5bdc191 100644
  53. --- a/smtp-tls.c
  54. +++ b/smtp-tls.c
  55. @@ -64,10 +64,12 @@ openssl_mutexcb (int mode, int n,
  56. const char *file __attribute__ ((unused)),
  57. int line __attribute__ ((unused)))
  58. {
  59. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  60. if (mode & CRYPTO_LOCK)
  61. pthread_mutex_lock (&openssl_mutex[n]);
  62. else
  63. pthread_mutex_unlock (&openssl_mutex[n]);
  64. +#endif
  65. }
  66. #endif
  67. @@ -76,7 +78,7 @@ starttls_init (void)
  68. {
  69. if (tls_init)
  70. return 1;
  71. -
  72. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  73. #ifdef USE_PTHREADS
  74. /* Set up mutexes for the OpenSSL library */
  75. if (openssl_mutex == NULL)
  76. @@ -94,9 +96,12 @@ starttls_init (void)
  77. CRYPTO_set_locking_callback (openssl_mutexcb);
  78. }
  79. #endif
  80. - tls_init = 1;
  81. SSL_load_error_strings ();
  82. SSL_library_init ();
  83. +#else
  84. + OPENSSL_init_ssl(0, NULL);
  85. +#endif
  86. + tls_init = 1;
  87. return 1;
  88. }