From 3e440ea0aba0660f356a3e5b9fc366d5d6960847 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 1 Aug 2023 02:54:53 +0000 Subject: sha256: avoid functions deprecated in OpenSSL 3+ OpenSSL 3+ deprecates the SHA256_Init, SHA256_Update, and SHA256_Final functions, leading to errors when building with `DEVELOPER=1'. Use the newer EVP_* API with OpenSSL 3+ despite being more error-prone and less efficient due to heap allocations. Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- hash-ll.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hash-ll.h') diff --git a/hash-ll.h b/hash-ll.h index 8050925137..5173a2698c 100644 --- a/hash-ll.h +++ b/hash-ll.h @@ -17,7 +17,11 @@ #define SHA256_NEEDS_CLONE_HELPER #include "sha256/gcrypt.h" #elif defined(SHA256_OPENSSL) -#include +# include +# if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 3 +# define SHA256_NEEDS_CLONE_HELPER +# include "sha256/openssl.h" +# endif #else #include "sha256/block/sha256.h" #endif -- cgit v1.2.3