]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
des: fix compile break for OpenSSL without DES
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Wed, 16 Feb 2022 08:19:58 +0000 (09:19 +0100)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Thu, 17 Feb 2022 10:25:03 +0000 (11:25 +0100)
When `USE_OPENSSL` was defined but OpenSSL had no DES support and a
different crypto library was used for that, `Curl_des_set_odd_parity`
was called but not defined. This could for example happen on Windows
and macOS when using OpenSSL v3 with deprecated features disabled.

Use the same condition for the function definition as used at the
caller side, but leaving out the OpenSSL part to avoid including
OpenSSL headers.

Closes https://github.com/curl/curl/pull/8459

lib/curl_des.c
lib/curl_des.h

index 76185cbf2104c106e623681593ca6e0f27780642..8170f488a10aefae30c8c41b771b0a961f6c7243 100644 (file)
 
 #include "curl_setup.h"
 
-#if defined(USE_NTLM) && !defined(USE_OPENSSL) && !defined(USE_WOLFSSL)
+#if defined(USE_CURL_NTLM_CORE) && !defined(USE_WOLFSSL) && \
+    (defined(USE_GNUTLS) || \
+     defined(USE_NSS) || \
+     defined(USE_SECTRANSP) || \
+     defined(USE_OS400CRYPTO) || \
+     defined(USE_WIN32_CRYPTO))
 
 #include "curl_des.h"
 
@@ -60,4 +65,4 @@ void Curl_des_set_odd_parity(unsigned char *bytes, size_t len)
   }
 }
 
-#endif /* USE_NTLM && !USE_OPENSSL */
+#endif
index 438706a0d294517972b0e8d2d9c13baf0d19112a..737945240f0ce707c9c6d6e80c66822467a89912 100644 (file)
 
 #include "curl_setup.h"
 
-#if defined(USE_NTLM) && !defined(USE_OPENSSL)
+#if defined(USE_CURL_NTLM_CORE) && !defined(USE_WOLFSSL) && \
+    (defined(USE_GNUTLS) || \
+     defined(USE_NSS) || \
+     defined(USE_SECTRANSP) || \
+     defined(USE_OS400CRYPTO) || \
+     defined(USE_WIN32_CRYPTO))
 
 /* Applies odd parity to the given byte array */
 void Curl_des_set_odd_parity(unsigned char *bytes, size_t length);
 
-#endif /* USE_NTLM && !USE_OPENSSL */
+#endif
 
 #endif /* HEADER_CURL_DES_H */