Removed trailing whitespaces.
[platform/upstream/curl.git] / lib / curl_sspi.h
1 #ifndef HEADER_CURL_SSPI_H
2 #define HEADER_CURL_SSPI_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at http://curl.haxx.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  ***************************************************************************/
24
25 #include "setup.h"
26
27 #ifdef USE_WINDOWS_SSPI
28
29 #include <curl/curl.h>
30
31 /*
32  * When including the following three headers, it is mandatory to define either
33  * SECURITY_WIN32 or SECURITY_KERNEL, indicating who is compiling the code.
34  */
35
36 #undef SECURITY_WIN32
37 #undef SECURITY_KERNEL
38 #define SECURITY_WIN32 1
39 #include <security.h>
40 #include <sspi.h>
41 #include <rpc.h>
42
43 CURLcode Curl_sspi_global_init(void);
44 void Curl_sspi_global_cleanup(void);
45 CURLcode Curl_sspi_version(int *major, int *minor, int *build, int *special);
46
47 /* Forward-declaration of global variables defined in curl_sspi.c */
48
49 extern HMODULE s_hSecDll;
50 extern PSecurityFunctionTableA s_pSecFn;
51
52 /* Provide some definitions missing in old headers */
53
54 #ifndef SEC_E_INSUFFICIENT_MEMORY
55 # define SEC_E_INSUFFICIENT_MEMORY             ((HRESULT)0x80090300L)
56 #endif
57 #ifndef SEC_E_INVALID_HANDLE
58 # define SEC_E_INVALID_HANDLE                  ((HRESULT)0x80090301L)
59 #endif
60 #ifndef SEC_E_UNSUPPORTED_FUNCTION
61 # define SEC_E_UNSUPPORTED_FUNCTION            ((HRESULT)0x80090302L)
62 #endif
63 #ifndef SEC_E_TARGET_UNKNOWN
64 # define SEC_E_TARGET_UNKNOWN                  ((HRESULT)0x80090303L)
65 #endif
66 #ifndef SEC_E_INTERNAL_ERROR
67 # define SEC_E_INTERNAL_ERROR                  ((HRESULT)0x80090304L)
68 #endif
69 #ifndef SEC_E_SECPKG_NOT_FOUND
70 # define SEC_E_SECPKG_NOT_FOUND                ((HRESULT)0x80090305L)
71 #endif
72 #ifndef SEC_E_NOT_OWNER
73 # define SEC_E_NOT_OWNER                       ((HRESULT)0x80090306L)
74 #endif
75 #ifndef SEC_E_CANNOT_INSTALL
76 # define SEC_E_CANNOT_INSTALL                  ((HRESULT)0x80090307L)
77 #endif
78 #ifndef SEC_E_INVALID_TOKEN
79 # define SEC_E_INVALID_TOKEN                   ((HRESULT)0x80090308L)
80 #endif
81 #ifndef SEC_E_CANNOT_PACK
82 # define SEC_E_CANNOT_PACK                     ((HRESULT)0x80090309L)
83 #endif
84 #ifndef SEC_E_QOP_NOT_SUPPORTED
85 # define SEC_E_QOP_NOT_SUPPORTED               ((HRESULT)0x8009030AL)
86 #endif
87 #ifndef SEC_E_NO_IMPERSONATION
88 # define SEC_E_NO_IMPERSONATION                ((HRESULT)0x8009030BL)
89 #endif
90 #ifndef SEC_E_LOGON_DENIED
91 # define SEC_E_LOGON_DENIED                    ((HRESULT)0x8009030CL)
92 #endif
93 #ifndef SEC_E_UNKNOWN_CREDENTIALS
94 # define SEC_E_UNKNOWN_CREDENTIALS             ((HRESULT)0x8009030DL)
95 #endif
96 #ifndef SEC_E_NO_CREDENTIALS
97 # define SEC_E_NO_CREDENTIALS                  ((HRESULT)0x8009030EL)
98 #endif
99 #ifndef SEC_E_MESSAGE_ALTERED
100 # define SEC_E_MESSAGE_ALTERED                 ((HRESULT)0x8009030FL)
101 #endif
102 #ifndef SEC_E_OUT_OF_SEQUENCE
103 # define SEC_E_OUT_OF_SEQUENCE                 ((HRESULT)0x80090310L)
104 #endif
105 #ifndef SEC_E_NO_AUTHENTICATING_AUTHORITY
106 # define SEC_E_NO_AUTHENTICATING_AUTHORITY     ((HRESULT)0x80090311L)
107 #endif
108 #ifndef SEC_E_BAD_PKGID
109 # define SEC_E_BAD_PKGID                       ((HRESULT)0x80090316L)
110 #endif
111 #ifndef SEC_E_CONTEXT_EXPIRED
112 # define SEC_E_CONTEXT_EXPIRED                 ((HRESULT)0x80090317L)
113 #endif
114 #ifndef SEC_E_INCOMPLETE_MESSAGE
115 # define SEC_E_INCOMPLETE_MESSAGE              ((HRESULT)0x80090318L)
116 #endif
117 #ifndef SEC_E_INCOMPLETE_CREDENTIALS
118 # define SEC_E_INCOMPLETE_CREDENTIALS          ((HRESULT)0x80090320L)
119 #endif
120 #ifndef SEC_E_BUFFER_TOO_SMALL
121 # define SEC_E_BUFFER_TOO_SMALL                ((HRESULT)0x80090321L)
122 #endif
123 #ifndef SEC_E_WRONG_PRINCIPAL
124 # define SEC_E_WRONG_PRINCIPAL                 ((HRESULT)0x80090322L)
125 #endif
126 #ifndef SEC_E_TIME_SKEW
127 # define SEC_E_TIME_SKEW                       ((HRESULT)0x80090324L)
128 #endif
129 #ifndef SEC_E_UNTRUSTED_ROOT
130 # define SEC_E_UNTRUSTED_ROOT                  ((HRESULT)0x80090325L)
131 #endif
132 #ifndef SEC_E_ILLEGAL_MESSAGE
133 # define SEC_E_ILLEGAL_MESSAGE                 ((HRESULT)0x80090326L)
134 #endif
135 #ifndef SEC_E_CERT_UNKNOWN
136 # define SEC_E_CERT_UNKNOWN                    ((HRESULT)0x80090327L)
137 #endif
138 #ifndef SEC_E_CERT_EXPIRED
139 # define SEC_E_CERT_EXPIRED                    ((HRESULT)0x80090328L)
140 #endif
141 #ifndef SEC_E_ENCRYPT_FAILURE
142 # define SEC_E_ENCRYPT_FAILURE                 ((HRESULT)0x80090329L)
143 #endif
144 #ifndef SEC_E_DECRYPT_FAILURE
145 # define SEC_E_DECRYPT_FAILURE                 ((HRESULT)0x80090330L)
146 #endif
147 #ifndef SEC_E_ALGORITHM_MISMATCH
148 # define SEC_E_ALGORITHM_MISMATCH              ((HRESULT)0x80090331L)
149 #endif
150 #ifndef SEC_E_SECURITY_QOS_FAILED
151 # define SEC_E_SECURITY_QOS_FAILED             ((HRESULT)0x80090332L)
152 #endif
153 #ifndef SEC_E_UNFINISHED_CONTEXT_DELETED
154 # define SEC_E_UNFINISHED_CONTEXT_DELETED      ((HRESULT)0x80090333L)
155 #endif
156 #ifndef SEC_E_NO_TGT_REPLY
157 # define SEC_E_NO_TGT_REPLY                    ((HRESULT)0x80090334L)
158 #endif
159 #ifndef SEC_E_NO_IP_ADDRESSES
160 # define SEC_E_NO_IP_ADDRESSES                 ((HRESULT)0x80090335L)
161 #endif
162 #ifndef SEC_E_WRONG_CREDENTIAL_HANDLE
163 # define SEC_E_WRONG_CREDENTIAL_HANDLE         ((HRESULT)0x80090336L)
164 #endif
165 #ifndef SEC_E_CRYPTO_SYSTEM_INVALID
166 # define SEC_E_CRYPTO_SYSTEM_INVALID           ((HRESULT)0x80090337L)
167 #endif
168 #ifndef SEC_E_MAX_REFERRALS_EXCEEDED
169 # define SEC_E_MAX_REFERRALS_EXCEEDED          ((HRESULT)0x80090338L)
170 #endif
171 #ifndef SEC_E_MUST_BE_KDC
172 # define SEC_E_MUST_BE_KDC                     ((HRESULT)0x80090339L)
173 #endif
174 #ifndef SEC_E_STRONG_CRYPTO_NOT_SUPPORTED
175 # define SEC_E_STRONG_CRYPTO_NOT_SUPPORTED     ((HRESULT)0x8009033AL)
176 #endif
177 #ifndef SEC_E_TOO_MANY_PRINCIPALS
178 # define SEC_E_TOO_MANY_PRINCIPALS             ((HRESULT)0x8009033BL)
179 #endif
180 #ifndef SEC_E_NO_PA_DATA
181 # define SEC_E_NO_PA_DATA                      ((HRESULT)0x8009033CL)
182 #endif
183 #ifndef SEC_E_PKINIT_NAME_MISMATCH
184 # define SEC_E_PKINIT_NAME_MISMATCH            ((HRESULT)0x8009033DL)
185 #endif
186 #ifndef SEC_E_SMARTCARD_LOGON_REQUIRED
187 # define SEC_E_SMARTCARD_LOGON_REQUIRED        ((HRESULT)0x8009033EL)
188 #endif
189 #ifndef SEC_E_SHUTDOWN_IN_PROGRESS
190 # define SEC_E_SHUTDOWN_IN_PROGRESS            ((HRESULT)0x8009033FL)
191 #endif
192 #ifndef SEC_E_KDC_INVALID_REQUEST
193 # define SEC_E_KDC_INVALID_REQUEST             ((HRESULT)0x80090340L)
194 #endif
195 #ifndef SEC_E_KDC_UNABLE_TO_REFER
196 # define SEC_E_KDC_UNABLE_TO_REFER             ((HRESULT)0x80090341L)
197 #endif
198 #ifndef SEC_E_KDC_UNKNOWN_ETYPE
199 # define SEC_E_KDC_UNKNOWN_ETYPE               ((HRESULT)0x80090342L)
200 #endif
201 #ifndef SEC_E_UNSUPPORTED_PREAUTH
202 # define SEC_E_UNSUPPORTED_PREAUTH             ((HRESULT)0x80090343L)
203 #endif
204 #ifndef SEC_E_DELEGATION_REQUIRED
205 # define SEC_E_DELEGATION_REQUIRED             ((HRESULT)0x80090345L)
206 #endif
207 #ifndef SEC_E_BAD_BINDINGS
208 # define SEC_E_BAD_BINDINGS                    ((HRESULT)0x80090346L)
209 #endif
210 #ifndef SEC_E_MULTIPLE_ACCOUNTS
211 # define SEC_E_MULTIPLE_ACCOUNTS               ((HRESULT)0x80090347L)
212 #endif
213 #ifndef SEC_E_NO_KERB_KEY
214 # define SEC_E_NO_KERB_KEY                     ((HRESULT)0x80090348L)
215 #endif
216 #ifndef SEC_E_CERT_WRONG_USAGE
217 # define SEC_E_CERT_WRONG_USAGE                ((HRESULT)0x80090349L)
218 #endif
219 #ifndef SEC_E_DOWNGRADE_DETECTED
220 # define SEC_E_DOWNGRADE_DETECTED              ((HRESULT)0x80090350L)
221 #endif
222 #ifndef SEC_E_SMARTCARD_CERT_REVOKED
223 # define SEC_E_SMARTCARD_CERT_REVOKED          ((HRESULT)0x80090351L)
224 #endif
225 #ifndef SEC_E_ISSUING_CA_UNTRUSTED
226 # define SEC_E_ISSUING_CA_UNTRUSTED            ((HRESULT)0x80090352L)
227 #endif
228 #ifndef SEC_E_REVOCATION_OFFLINE_C
229 # define SEC_E_REVOCATION_OFFLINE_C            ((HRESULT)0x80090353L)
230 #endif
231 #ifndef SEC_E_PKINIT_CLIENT_FAILURE
232 # define SEC_E_PKINIT_CLIENT_FAILURE           ((HRESULT)0x80090354L)
233 #endif
234 #ifndef SEC_E_SMARTCARD_CERT_EXPIRED
235 # define SEC_E_SMARTCARD_CERT_EXPIRED          ((HRESULT)0x80090355L)
236 #endif
237 #ifndef SEC_E_NO_S4U_PROT_SUPPORT
238 # define SEC_E_NO_S4U_PROT_SUPPORT             ((HRESULT)0x80090356L)
239 #endif
240 #ifndef SEC_E_CROSSREALM_DELEGATION_FAILURE
241 # define SEC_E_CROSSREALM_DELEGATION_FAILURE   ((HRESULT)0x80090357L)
242 #endif
243 #ifndef SEC_E_REVOCATION_OFFLINE_KDC
244 # define SEC_E_REVOCATION_OFFLINE_KDC          ((HRESULT)0x80090358L)
245 #endif
246 #ifndef SEC_E_ISSUING_CA_UNTRUSTED_KDC
247 # define SEC_E_ISSUING_CA_UNTRUSTED_KDC        ((HRESULT)0x80090359L)
248 #endif
249 #ifndef SEC_E_KDC_CERT_EXPIRED
250 # define SEC_E_KDC_CERT_EXPIRED                ((HRESULT)0x8009035AL)
251 #endif
252 #ifndef SEC_E_KDC_CERT_REVOKED
253 # define SEC_E_KDC_CERT_REVOKED                ((HRESULT)0x8009035BL)
254 #endif
255 #ifndef SEC_E_INVALID_PARAMETER
256 # define SEC_E_INVALID_PARAMETER               ((HRESULT)0x8009035DL)
257 #endif
258 #ifndef SEC_E_DELEGATION_POLICY
259 # define SEC_E_DELEGATION_POLICY               ((HRESULT)0x8009035EL)
260 #endif
261 #ifndef SEC_E_POLICY_NLTM_ONLY
262 # define SEC_E_POLICY_NLTM_ONLY                ((HRESULT)0x8009035FL)
263 #endif
264
265 #ifndef SEC_I_CONTINUE_NEEDED
266 # define SEC_I_CONTINUE_NEEDED                 ((HRESULT)0x00090312L)
267 #endif
268 #ifndef SEC_I_COMPLETE_NEEDED
269 # define SEC_I_COMPLETE_NEEDED                 ((HRESULT)0x00090313L)
270 #endif
271 #ifndef SEC_I_COMPLETE_AND_CONTINUE
272 # define SEC_I_COMPLETE_AND_CONTINUE           ((HRESULT)0x00090314L)
273 #endif
274 #ifndef SEC_I_LOCAL_LOGON
275 # define SEC_I_LOCAL_LOGON                     ((HRESULT)0x00090315L)
276 #endif
277 #ifndef SEC_I_CONTEXT_EXPIRED
278 # define SEC_I_CONTEXT_EXPIRED                 ((HRESULT)0x00090317L)
279 #endif
280 #ifndef SEC_I_INCOMPLETE_CREDENTIALS
281 # define SEC_I_INCOMPLETE_CREDENTIALS          ((HRESULT)0x00090320L)
282 #endif
283 #ifndef SEC_I_RENEGOTIATE
284 # define SEC_I_RENEGOTIATE                     ((HRESULT)0x00090321L)
285 #endif
286 #ifndef SEC_I_NO_LSA_CONTEXT
287 # define SEC_I_NO_LSA_CONTEXT                  ((HRESULT)0x00090323L)
288 #endif
289 #ifndef SEC_I_SIGNATURE_NEEDED
290 # define SEC_I_SIGNATURE_NEEDED                ((HRESULT)0x0009035CL)
291 #endif
292
293 #endif /* USE_WINDOWS_SSPI */
294 #endif /* HEADER_CURL_SSPI_H */