0002-include-ssl_compat.h-fix-build-with-libressl-3.5.0.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 79ed770a37c8669390a58a4485dd8f5565fe2497 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sun, 15 Jan 2023 19:12:05 +0100
  4. Subject: [PATCH] include/ssl_compat.h: fix build with libressl >= 3.5.0
  5. Fix the following build failure with libressl >= 3.5.0:
  6. In file included from /tmp/instance-10/output-1/build/mariadb-10.3.36/vio/viosslfactories.c:18:
  7. /tmp/instance-10/output-1/build/mariadb-10.3.36/vio/viosslfactories.c: In function 'get_dh2048':
  8. /tmp/instance-10/output-1/build/mariadb-10.3.36/include/ssl_compat.h:68:45: error: invalid use of incomplete typedef 'DH' {aka 'struct dh_st'}
  9. 68 | #define DH_set0_pqg(D,P,Q,G) ((D)->p= (P), (D)->g= (G))
  10. | ^~
  11. Fixes:
  12. - http://autobuild.buildroot.org/results/524198344aafca58d214537af64c5961c407b0f8
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. [Upstream status: https://github.com/MariaDB/server/pull/2435]
  15. ---
  16. include/ssl_compat.h | 3 ++-
  17. 1 file changed, 2 insertions(+), 1 deletion(-)
  18. diff --git a/include/ssl_compat.h b/include/ssl_compat.h
  19. index 664f3aac87c..3678e5fa084 100644
  20. --- a/include/ssl_compat.h
  21. +++ b/include/ssl_compat.h
  22. @@ -19,7 +19,8 @@
  23. /* OpenSSL version specific definitions */
  24. #if defined(OPENSSL_VERSION_NUMBER)
  25. -#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
  26. +#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \
  27. + !(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x30500000L)
  28. #define HAVE_OPENSSL11 1
  29. #define SSL_LIBRARY OpenSSL_version(OPENSSL_VERSION)
  30. #define ERR_remove_state(X) ERR_clear_error()
  31. --
  32. 2.39.0