schannel.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef HEADER_CURL_SCHANNEL_H
  2. #define HEADER_CURL_SCHANNEL_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) Marc Hoersken, <info@marc-hoersken.de>, et al.
  11. * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  12. *
  13. * This software is licensed as described in the file COPYING, which
  14. * you should have received as part of this distribution. The terms
  15. * are also available at https://curl.se/docs/copyright.html.
  16. *
  17. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  18. * copies of the Software, and permit persons to whom the Software is
  19. * furnished to do so, under the terms of the COPYING file.
  20. *
  21. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  22. * KIND, either express or implied.
  23. *
  24. * SPDX-License-Identifier: curl
  25. *
  26. ***************************************************************************/
  27. #include "curl_setup.h"
  28. #ifdef USE_SCHANNEL
  29. #ifdef _MSC_VER
  30. #pragma warning(push)
  31. #pragma warning(disable: 4201)
  32. #endif
  33. #include <subauth.h>
  34. #ifdef _MSC_VER
  35. #pragma warning(pop)
  36. #endif
  37. /* Wincrypt must be included before anything that could include OpenSSL. */
  38. #if defined(USE_WIN32_CRYPTO)
  39. #include <wincrypt.h>
  40. /* Undefine wincrypt conflicting symbols for BoringSSL. */
  41. #undef X509_NAME
  42. #undef X509_EXTENSIONS
  43. #undef PKCS7_ISSUER_AND_SERIAL
  44. #undef PKCS7_SIGNER_INFO
  45. #undef OCSP_REQUEST
  46. #undef OCSP_RESPONSE
  47. #endif
  48. #include <schnlsp.h>
  49. #include <schannel.h>
  50. #include "curl_sspi.h"
  51. #include "cfilters.h"
  52. #include "urldata.h"
  53. /* <wincrypt.h> has been included via the above <schnlsp.h>.
  54. * Or in case of ldap.c, it was included via <winldap.h>.
  55. * And since <wincrypt.h> has this:
  56. * #define X509_NAME ((LPCSTR) 7)
  57. *
  58. * And in BoringSSL's <openssl/base.h> there is:
  59. * typedef struct X509_name_st X509_NAME;
  60. * etc.
  61. *
  62. * this will cause all kinds of C-preprocessing paste errors in
  63. * BoringSSL's <openssl/x509.h>: So just undefine those defines here
  64. * (and only here).
  65. */
  66. #if defined(HAVE_BORINGSSL) || defined(OPENSSL_IS_BORINGSSL)
  67. # undef X509_NAME
  68. # undef X509_CERT_PAIR
  69. # undef X509_EXTENSIONS
  70. #endif
  71. extern const struct Curl_ssl Curl_ssl_schannel;
  72. CURLcode Curl_verify_certificate(struct Curl_cfilter *cf,
  73. struct Curl_easy *data);
  74. #endif /* USE_SCHANNEL */
  75. #endif /* HEADER_CURL_SCHANNEL_H */