summaryrefslogtreecommitdiff
path: root/lib/ldap.c
diff options
context:
space:
mode:
authorViktor Szakats <commit@vsz.me>2022-07-14 07:14:22 +0000
committerViktor Szakats <commit@vsz.me>2022-07-14 07:14:22 +0000
commit4c46c829f5ed7c37b3313c67a6662b7332c1ff7f (patch)
tree5da0b9d9a57dadde22f028991bc1a87bba1315d5 /lib/ldap.c
parent451bcc1a9187e0cfaca6a346e5e55695b68e1851 (diff)
downloadcurl-4c46c829f5ed7c37b3313c67a6662b7332c1ff7f.tar.gz
openssl: fix BoringSSL symbol conflicts with LDAP and Schannel
Same issue as here [1], but this time when building curl with BoringSSL for Windows with LDAP(S) or Schannel support enabled. Apply the same fix [2] for these source files as well. This can also be fixed by moving `#include "urldata.h"` _before_ including `winldap.h` and `schnlsp.h` respectively. This seems like a cleaner fix, though I'm not sure why it works and if it has any downside. [1] https://github.com/curl/curl/issues/5669 [2] https://github.com/curl/curl/commit/fbe07c6829ba8c5793c84c2856526e19e9029ab9 Co-authored-by: Jay Satiro Closes #9110
Diffstat (limited to 'lib/ldap.c')
-rw-r--r--lib/ldap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ldap.c b/lib/ldap.c
index 51a32dc96..410dc72e8 100644
--- a/lib/ldap.c
+++ b/lib/ldap.c
@@ -37,6 +37,18 @@
* OpenLDAP library versions, USE_OPENLDAP shall not be defined.
*/
+/* Wincrypt must be included before anything that could include OpenSSL. */
+#if defined(USE_WIN32_CRYPTO)
+#include <wincrypt.h>
+/* Undefine wincrypt conflicting symbols for BoringSSL. */
+#undef X509_NAME
+#undef X509_EXTENSIONS
+#undef PKCS7_ISSUER_AND_SERIAL
+#undef PKCS7_SIGNER_INFO
+#undef OCSP_REQUEST
+#undef OCSP_RESPONSE
+#endif
+
#ifdef USE_WIN32_LDAP /* Use Windows LDAP implementation. */
# include <winldap.h>
# ifndef LDAP_VENDOR_NAME