xref: /third_party/curl/lib/vtls/schannel.h (revision 13498266)
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
29#ifdef USE_SCHANNEL
30
31#ifdef _MSC_VER
32#pragma warning(push)
33#pragma warning(disable: 4201)
34#endif
35#include <subauth.h>
36#ifdef _MSC_VER
37#pragma warning(pop)
38#endif
39/* Wincrypt must be included before anything that could include OpenSSL. */
40#if defined(USE_WIN32_CRYPTO)
41#include <wincrypt.h>
42/* Undefine wincrypt conflicting symbols for BoringSSL. */
43#undef X509_NAME
44#undef X509_EXTENSIONS
45#undef PKCS7_ISSUER_AND_SERIAL
46#undef PKCS7_SIGNER_INFO
47#undef OCSP_REQUEST
48#undef OCSP_RESPONSE
49#endif
50
51#include <schnlsp.h>
52#include <schannel.h>
53#include "curl_sspi.h"
54
55#include "cfilters.h"
56#include "urldata.h"
57
58/* <wincrypt.h> has been included via the above <schnlsp.h>.
59 * Or in case of ldap.c, it was included via <winldap.h>.
60 * And since <wincrypt.h> has this:
61 *   #define X509_NAME  ((LPCSTR) 7)
62 *
63 * And in BoringSSL's <openssl/base.h> there is:
64 *  typedef struct X509_name_st X509_NAME;
65 *  etc.
66 *
67 * this will cause all kinds of C-preprocessing paste errors in
68 * BoringSSL's <openssl/x509.h>: So just undefine those defines here
69 * (and only here).
70 */
71#if defined(OPENSSL_IS_BORINGSSL)
72# undef X509_NAME
73# undef X509_CERT_PAIR
74# undef X509_EXTENSIONS
75#endif
76
77extern const struct Curl_ssl Curl_ssl_schannel;
78
79CURLcode Curl_verify_host(struct Curl_cfilter *cf,
80                          struct Curl_easy *data);
81
82CURLcode Curl_verify_certificate(struct Curl_cfilter *cf,
83                                 struct Curl_easy *data);
84
85#endif /* USE_SCHANNEL */
86#endif /* HEADER_CURL_SCHANNEL_H */
87