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.

46 lines
1.4 KiB

  1. From d7bf6c919259a65d78b5bf67a3c75838f8894e91 Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Sun, 25 Nov 2018 19:59:49 -0800
  4. Subject: [PATCH] Fix compilation without deprecated OpenSSL APIs
  5. ---
  6. src/ngircd/conf-ssl.h | 4 ++++
  7. src/ngircd/conn-ssl.c | 3 ++-
  8. 2 files changed, 6 insertions(+), 1 deletion(-)
  9. diff --git a/src/ngircd/conf-ssl.h b/src/ngircd/conf-ssl.h
  10. index c2373797..af715af8 100644
  11. --- a/src/ngircd/conf-ssl.h
  12. +++ b/src/ngircd/conf-ssl.h
  13. @@ -13,6 +13,10 @@
  14. #ifdef HAVE_LIBSSL
  15. #define SSL_SUPPORT
  16. #include <openssl/ssl.h>
  17. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  18. +#define OpenSSL_version SSLeay_version
  19. +#define OPENSSL_VERSION SSLEAY_VERSION
  20. +#endif
  21. #endif
  22. #ifdef HAVE_LIBGNUTLS
  23. #define SSL_SUPPORT
  24. diff --git a/src/ngircd/conn-ssl.c b/src/ngircd/conn-ssl.c
  25. index 705c29d5..ba47e513 100644
  26. --- a/src/ngircd/conn-ssl.c
  27. +++ b/src/ngircd/conn-ssl.c
  28. @@ -42,6 +42,7 @@ extern struct SSLOptions Conf_SSLOptions;
  29. #ifdef HAVE_LIBSSL
  30. #include <openssl/err.h>
  31. #include <openssl/rand.h>
  32. +#include <openssl/dh.h>
  33. static SSL_CTX * ssl_ctx;
  34. static DH *dh_params;
  35. @@ -326,7 +327,7 @@ ConnSSL_InitLibrary( void )
  36. Verify_openssl);
  37. SSL_CTX_free(ssl_ctx);
  38. ssl_ctx = newctx;
  39. - Log(LOG_INFO, "%s initialized.", SSLeay_version(SSLEAY_VERSION));
  40. + Log(LOG_INFO, "%s initialized.", OpenSSL_version(OPENSSL_VERSION));
  41. return true;
  42. out:
  43. SSL_CTX_free(newctx);