1 #ifndef HEADER_CURL_SCHANNEL_H
2 #define HEADER_CURL_SCHANNEL_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 2012, Marc Hoersken, <info@marc-hoersken.de>, et al.
11 * Copyright (C) 2012 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
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.haxx.se/docs/copyright.html.
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.
21 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
22 * KIND, either express or implied.
24 ***************************************************************************/
25 #include "curl_setup.h"
32 #define UNISP_NAME_A "Microsoft Unified Security Protocol Provider"
36 #define UNISP_NAME_W L"Microsoft Unified Security Protocol Provider"
41 #define UNISP_NAME UNISP_NAME_W
43 #define UNISP_NAME UNISP_NAME_A
47 #ifndef SP_PROT_SSL2_CLIENT
48 #define SP_PROT_SSL2_CLIENT 0x00000008
51 #ifndef SP_PROT_SSL3_CLIENT
52 #define SP_PROT_SSL3_CLIENT 0x00000008
55 #ifndef SP_PROT_TLS1_CLIENT
56 #define SP_PROT_TLS1_CLIENT 0x00000080
59 #ifndef SP_PROT_TLS1_0_CLIENT
60 #define SP_PROT_TLS1_0_CLIENT SP_PROT_TLS1_CLIENT
63 #ifndef SP_PROT_TLS1_1_CLIENT
64 #define SP_PROT_TLS1_1_CLIENT 0x00000200
67 #ifndef SP_PROT_TLS1_2_CLIENT
68 #define SP_PROT_TLS1_2_CLIENT 0x00000800
71 #ifndef SECBUFFER_ALERT
72 #define SECBUFFER_ALERT 17
75 /* Both schannel buffer sizes must be > 0 */
76 #define CURL_SCHANNEL_BUFFER_INIT_SIZE 4096
77 #define CURL_SCHANNEL_BUFFER_FREE_SIZE 1024
80 CURLcode Curl_schannel_connect(struct connectdata *conn, int sockindex);
82 CURLcode Curl_schannel_connect_nonblocking(struct connectdata *conn,
86 bool Curl_schannel_data_pending(const struct connectdata *conn, int sockindex);
87 void Curl_schannel_close(struct connectdata *conn, int sockindex);
88 int Curl_schannel_shutdown(struct connectdata *conn, int sockindex);
89 void Curl_schannel_session_free(void *ptr);
91 int Curl_schannel_init(void);
92 void Curl_schannel_cleanup(void);
93 size_t Curl_schannel_version(char *buffer, size_t size);
95 CURLcode Curl_schannel_random(unsigned char *entropy, size_t length);
97 /* Set the API backend definition to Schannel */
98 #define CURL_SSL_BACKEND CURLSSLBACKEND_SCHANNEL
100 /* this backend supports CURLOPT_CERTINFO */
101 #define have_curlssl_certinfo 1
103 /* API setup for Schannel */
104 #define curlssl_init Curl_schannel_init
105 #define curlssl_cleanup Curl_schannel_cleanup
106 #define curlssl_connect Curl_schannel_connect
107 #define curlssl_connect_nonblocking Curl_schannel_connect_nonblocking
108 #define curlssl_session_free Curl_schannel_session_free
109 #define curlssl_close_all(x) ((void)x)
110 #define curlssl_close Curl_schannel_close
111 #define curlssl_shutdown Curl_schannel_shutdown
112 #define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
113 #define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
114 #define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
115 #define curlssl_version Curl_schannel_version
116 #define curlssl_check_cxn(x) ((void)x, -1)
117 #define curlssl_data_pending Curl_schannel_data_pending
118 #define curlssl_random(x,y,z) ((void)x, Curl_schannel_random(y,z))
120 #endif /* USE_SCHANNEL */
121 #endif /* HEADER_CURL_SCHANNEL_H */