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.

90 lines
2.7 KiB

  1. Description: Build and work with either openssl 1.0.2 or 1.1.0
  2. * Add patch to build with either openssl 1.0.2 or 1.1.0 (Closes: #828466)
  3. - Thanks to Sebastian Andrzej Siewior for the patch
  4. Author: Sebastian Andrzej Siewior
  5. Bug-Debian: http://bugs.debian.org/828466
  6. Origin: vendor
  7. Forwarded: no
  8. Reviewed-By: Scott Kitterman <scott@kitterman.com>
  9. Last-Update: <YYYY-MM-DD>
  10. --- opendkim-2.11.0~alpha.orig/configure.ac
  11. +++ opendkim-2.11.0~alpha/configure.ac
  12. @@ -864,26 +864,28 @@ then
  13. AC_SEARCH_LIBS([ERR_peek_error], [crypto], ,
  14. AC_MSG_ERROR([libcrypto not found]))
  15. - AC_SEARCH_LIBS([SSL_library_init], [ssl], ,
  16. - [
  17. - if test x"$enable_shared" = x"yes"
  18. - then
  19. - AC_MSG_ERROR([Cannot build shared opendkim
  20. - against static openssl libraries.
  21. - Configure with --disable-shared
  22. - to get this working or obtain a
  23. - shared libssl library for
  24. - opendkim to use.])
  25. - fi
  26. - # avoid caching issue - last result of SSL_library_init
  27. - # shouldn't be cached for this next check
  28. - unset ac_cv_search_SSL_library_init
  29. - LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl"
  30. - AC_SEARCH_LIBS([SSL_library_init], [ssl], ,
  31. - AC_MSG_ERROR([libssl not found]), [-ldl])
  32. - ]
  33. - )
  34. + AC_LINK_IFELSE(
  35. + [AC_LANG_PROGRAM([[#include <openssl/ssl.h>]],
  36. + [[SSL_library_init();]])],
  37. + [od_have_ossl="yes";],
  38. + [od_have_ossl="no";])
  39. + if test x"$od_have_ossl" = x"no"
  40. + then
  41. + if test x"$enable_shared" = x"yes"
  42. + then
  43. + AC_MSG_ERROR([Cannot build shared opendkim
  44. + against static openssl libraries.
  45. + Configure with --disable-shared
  46. + to get this working or obtain a
  47. + shared libssl library for
  48. + opendkim to use.])
  49. + fi
  50. +
  51. + LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl"
  52. + AC_SEARCH_LIBS([SSL_library_init], [ssl], ,
  53. + AC_MSG_ERROR([libssl not found]), [-ldl])
  54. + fi
  55. AC_CHECK_DECL([SHA256_DIGEST_LENGTH],
  56. AC_DEFINE([HAVE_SHA256], 1,
  57. --- opendkim-2.11.0~alpha.orig/opendkim/opendkim-crypto.c
  58. +++ opendkim-2.11.0~alpha/opendkim/opendkim-crypto.c
  59. @@ -222,7 +222,11 @@ dkimf_crypto_free_id(void *ptr)
  60. {
  61. assert(pthread_setspecific(id_key, ptr) == 0);
  62. +#if OPENSSL_VERSION_NUMBER >= 0x10100000
  63. + OPENSSL_thread_stop();
  64. +#else
  65. ERR_remove_state(0);
  66. +#endif
  67. free(ptr);
  68. @@ -392,11 +396,15 @@ dkimf_crypto_free(void)
  69. {
  70. if (crypto_init_done)
  71. {
  72. +#if OPENSSL_VERSION_NUMBER >= 0x10100000
  73. + OPENSSL_thread_stop();
  74. +#else
  75. CRYPTO_cleanup_all_ex_data();
  76. CONF_modules_free();
  77. EVP_cleanup();
  78. ERR_free_strings();
  79. ERR_remove_state(0);
  80. +#endif
  81. if (nmutexes > 0)
  82. {