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.

88 lines
2.3 KiB

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