From 3b43c4f4451d621acaa15d1edf1bc597928581ed Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sat, 10 Jul 2021 11:20:01 +1000 Subject: [PATCH] Make mz_crypt_openssl.c work with BoringSSL BoringSSL does not provide cms.h but this is an optional dependency for minizip, conditional on defined(MZ_ZIP_SIGNING). For the functions called by mz_crypt_init: - The OpenSSL_add_all_algorithms function is declared in evp.h. OpenSSL's hmac.h includes evp.h but BoringSSL's hmac.h does not. - The ERR_* functions are declared in err.h in both. - The ENGINE_* functions are declared in engine.h in OpenSSL but are in crypto.h for BoringSSL. --- mz_crypt_openssl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mz_crypt_openssl.c b/mz_crypt_openssl.c index e0db8d72..2a6a4ac8 100644 --- a/mz_crypt_openssl.c +++ b/mz_crypt_openssl.c @@ -16,10 +16,19 @@ #include #include #include +#include +#include #include -#include + +#if defined(MZ_ZIP_SIGNING) +/* Note: https://www.imperialviolet.org/2015/10/17/boringssl.html says that + BoringSSL does not support CMS. "#include " will fail. See + https://bugs.chromium.org/p/boringssl/issues/detail?id=421 +*/ #include +#include #include +#endif /***************************************************************************/