0002-rutil-OpenSSLInit-disable-use-of-legacy-OpenSSL-memo.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From e7c33f4e078e6e5dfa7dea796fa4ffb88f48a37a Mon Sep 17 00:00:00 2001
  2. From: Daniel Pocock <daniel@pocock.pro>
  3. Date: Thu, 4 Aug 2022 10:55:30 +0200
  4. Subject: [PATCH] rutil: OpenSSLInit: disable use of legacy OpenSSL memory leak
  5. checking with OpenSSL 3.0 and later
  6. Upstream: https://github.com/resiprocate/resiprocate/commit/e7c33f4e078e6e5dfa7dea796fa4ffb88f48a37a
  7. Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
  8. ---
  9. rutil/ssl/OpenSSLInit.cxx | 7 ++++++-
  10. 1 file changed, 6 insertions(+), 1 deletion(-)
  11. diff --git a/rutil/ssl/OpenSSLInit.cxx b/rutil/ssl/OpenSSLInit.cxx
  12. index d42486f96b..65afed09fe 100644
  13. --- a/rutil/ssl/OpenSSLInit.cxx
  14. +++ b/rutil/ssl/OpenSSLInit.cxx
  15. @@ -69,14 +69,19 @@ OpenSSLInit::OpenSSLInit()
  16. CRYPTO_set_dynlock_lock_callback(::resip_OpenSSLInit_dynLockFunction);
  17. #endif
  18. +/* The OpenSSL memory leak checking has been deprecated since
  19. + OpenSSL v3.0. OpenSSL developers recommend that we rely
  20. + on modern compilers to provide the same functionality. */
  21. #if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
  22. CRYPTO_malloc_debug_init();
  23. CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
  24. -#else
  25. +#elsif (OPENSSL_VERSION_NUMBER < 0x30000000L)
  26. CRYPTO_set_mem_debug(1);
  27. #endif
  28. +#if (OPENSSL_VERSION_NUMBER < 0x30000000L) || defined(LIBRESSL_VERSION_NUMBER)
  29. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
  30. +#endif
  31. SSL_library_init();
  32. SSL_load_error_strings();