]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: Fix wincrypt symbols conflict with BoringSSL
authorJay Satiro <raysatiro@yahoo.com>
Wed, 26 Aug 2020 05:49:47 +0000 (01:49 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 27 Aug 2020 03:24:41 +0000 (23:24 -0400)
OpenSSL undefines the conflicting symbols but BoringSSL does not so we
must do it ourselves.

Reported-by: Samuel Tranchet
Assisted-by: Javier Blazquez
Ref: https://bugs.chromium.org/p/boringssl/issues/detail?id=371
Ref: https://github.com/openssl/openssl/blob/OpenSSL_1_1_1g/include/openssl/ossl_typ.h#L66-L73

Fixes https://github.com/curl/curl/issues/5669
Closes https://github.com/curl/curl/pull/5857

lib/vtls/openssl.c

index 4bfd040d3b3a82613454768dae02330e3d169875..25b7dfab8e49c96cc30c15181493bf8b10c440df 100644 (file)
 /* 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
 
 #include "urldata.h"