0001-fix-build-with-libressl-3.5.0.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From c21cde9010175e2355df17d4e81fedd6020603f8 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 14 May 2022 00:03:51 +0200
  4. Subject: [PATCH] fix build with libressl >= 3.5.0
  5. Fix the following build failure with libressl >= 3.5.0:
  6. crypto-openssl-10.cpp:78:18: error: field 'ctx' has incomplete type 'HMAC_CTX' {aka 'hmac_ctx_st'}
  7. 78 | HMAC_CTX ctx;
  8. | ^~~
  9. Fixes:
  10. - http://autobuild.buildroot.org/results/98747d470c2ad59280934e160d24bd3fdad1503c
  11. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  12. [Upstream status: https://github.com/AGWA/git-crypt/pull/249]
  13. ---
  14. crypto-openssl-10.cpp | 4 +++-
  15. crypto-openssl-11.cpp | 4 +++-
  16. 2 files changed, 6 insertions(+), 2 deletions(-)
  17. diff --git a/crypto-openssl-10.cpp b/crypto-openssl-10.cpp
  18. index f0f2c53..a7a5d52 100644
  19. --- a/crypto-openssl-10.cpp
  20. +++ b/crypto-openssl-10.cpp
  21. @@ -29,8 +29,10 @@
  22. */
  23. #include <openssl/opensslconf.h>
  24. +#include <openssl/opensslv.h>
  25. -#if !defined(OPENSSL_API_COMPAT)
  26. +#if !defined(OPENSSL_API_COMPAT) && \
  27. + !(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x30500000L)
  28. #include "crypto.hpp"
  29. #include "key.hpp"
  30. diff --git a/crypto-openssl-11.cpp b/crypto-openssl-11.cpp
  31. index adf03bb..32c2483 100644
  32. --- a/crypto-openssl-11.cpp
  33. +++ b/crypto-openssl-11.cpp
  34. @@ -29,8 +29,10 @@
  35. */
  36. #include <openssl/opensslconf.h>
  37. +#include <openssl/opensslv.h>
  38. -#if defined(OPENSSL_API_COMPAT)
  39. +#if defined(OPENSSL_API_COMPAT) || \
  40. + (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x30500000L)
  41. #include "crypto.hpp"
  42. #include "key.hpp"
  43. --
  44. 2.35.1