Skip to content

Commit

Permalink
package/git-crypt: fix build with libressl >= 3.5.0
Browse files Browse the repository at this point in the history
Fix the following build failure with libressl raised since bump to
version 3.5.2 in commit 8b21692:

crypto-openssl-10.cpp:78:18: error: field 'ctx' has incomplete type 'HMAC_CTX' {aka 'hmac_ctx_st'}
   78 |         HMAC_CTX ctx;
      |                  ^~~

Fixes:
 - http://autobuild.buildroot.org/results/98747d470c2ad59280934e160d24bd3fdad1503c

Signed-off-by: Fabrice Fontaine <[email protected]>
Signed-off-by: Peter Korsgaard <[email protected]>
  • Loading branch information
ffontaine authored and jacmet committed May 15, 2022
1 parent c1dcf18 commit 5bd97b1
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions package/git-crypt/0001-fix-build-with-libressl-3.5.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
From c21cde9010175e2355df17d4e81fedd6020603f8 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <[email protected]>
Date: Sat, 14 May 2022 00:03:51 +0200
Subject: [PATCH] fix build with libressl >= 3.5.0

Fix the following build failure with libressl >= 3.5.0:

crypto-openssl-10.cpp:78:18: error: field 'ctx' has incomplete type 'HMAC_CTX' {aka 'hmac_ctx_st'}
78 | HMAC_CTX ctx;
| ^~~

Fixes:
- http://autobuild.buildroot.org/results/98747d470c2ad59280934e160d24bd3fdad1503c

Signed-off-by: Fabrice Fontaine <[email protected]>
[Upstream status: https://github.com/AGWA/git-crypt/pull/249]
---
crypto-openssl-10.cpp | 4 +++-
crypto-openssl-11.cpp | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/crypto-openssl-10.cpp b/crypto-openssl-10.cpp
index f0f2c53..a7a5d52 100644
--- a/crypto-openssl-10.cpp
+++ b/crypto-openssl-10.cpp
@@ -29,8 +29,10 @@
*/

#include <openssl/opensslconf.h>
+#include <openssl/opensslv.h>

-#if !defined(OPENSSL_API_COMPAT)
+#if !defined(OPENSSL_API_COMPAT) && \
+ !(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x30500000L)

#include "crypto.hpp"
#include "key.hpp"
diff --git a/crypto-openssl-11.cpp b/crypto-openssl-11.cpp
index adf03bb..32c2483 100644
--- a/crypto-openssl-11.cpp
+++ b/crypto-openssl-11.cpp
@@ -29,8 +29,10 @@
*/

#include <openssl/opensslconf.h>
+#include <openssl/opensslv.h>

-#if defined(OPENSSL_API_COMPAT)
+#if defined(OPENSSL_API_COMPAT) || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x30500000L)

#include "crypto.hpp"
#include "key.hpp"
--
2.35.1

0 comments on commit 5bd97b1

Please sign in to comment.