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.

47 lines
1.1 KiB

  1. --- a/crypto.c
  2. +++ b/crypto.c
  3. @@ -14,6 +14,12 @@
  4. #include <openssl/pem.h>
  5. #include <openssl/ssl.h>
  6. +#ifndef OPENSSL_VERSION
  7. +#define OPENSSL_VERSION SSLEAY_VERSION
  8. +#define OpenSSL_version(x) SSLeay_version(x)
  9. +#define OpenSSL_version_num SSLeay
  10. +#endif
  11. +
  12. /*
  13. This checks data in a struct string against a signature in a second
  14. @@ -250,14 +256,18 @@ bail_out:
  15. void
  16. crypto_init(void)
  17. {
  18. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  19. /* Just load the crypto library error strings, not SSL */
  20. ERR_load_crypto_strings();
  21. +#endif
  22. }
  23. void
  24. crypto_finish(void)
  25. {
  26. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  27. ERR_free_strings();
  28. +#endif
  29. }
  30. void
  31. @@ -268,10 +278,10 @@ crypto_warn_openssl_version_changed(void
  32. * OpenSSL library used.
  33. * Output a warning if not.
  34. */
  35. - if (SSLeay() != OPENSSL_VERSION_NUMBER) {
  36. + if (OpenSSL_version_num() != OPENSSL_VERSION_NUMBER) {
  37. log_info("Note: compiled using OpenSSL version '%s' headers, but linked to "
  38. "OpenSSL version '%s' library",
  39. OPENSSL_VERSION_TEXT,
  40. - SSLeay_version(SSLEAY_VERSION));
  41. + OpenSSL_version(OPENSSL_VERSION));
  42. }
  43. }