4cccfe6259940aa6898645181279d8a757177ffd
[reactos.git] / reactos / dll / win32 / secur32 / sspi.c
1 #include <precomp.h>
2
3 #define NDEBUG
4 #include <debug.h>
5
6 SECURITY_STATUS WINAPI ApplyControlTokenW(PCtxtHandle Handle, PSecBufferDesc Buffer);
7 SECURITY_STATUS WINAPI ApplyControlTokenA(PCtxtHandle Handle, PSecBufferDesc Buffer);
8
9 static SecurityFunctionTableA securityFunctionTableA =
10 {
11 SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION,
12 EnumerateSecurityPackagesA,
13 QueryCredentialsAttributesA,
14 AcquireCredentialsHandleA,
15 FreeCredentialsHandle,
16 NULL, /* Reserved2 */
17 InitializeSecurityContextA,
18 AcceptSecurityContext,
19 CompleteAuthToken,
20 DeleteSecurityContext,
21 ApplyControlTokenA,
22 QueryContextAttributesA,
23 ImpersonateSecurityContext,
24 RevertSecurityContext,
25 MakeSignature,
26 VerifySignature,
27 FreeContextBuffer,
28 QuerySecurityPackageInfoA,
29 EncryptMessage, /* Reserved3 */
30 DecryptMessage, /* Reserved4 */
31 ExportSecurityContext,
32 ImportSecurityContextA,
33 AddCredentialsA,
34 NULL, /* Reserved8 */
35 QuerySecurityContextToken,
36 EncryptMessage,
37 DecryptMessage,
38 NULL
39 };
40
41 static SecurityFunctionTableW securityFunctionTableW =
42 {
43 SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION,
44 EnumerateSecurityPackagesW,
45 QueryCredentialsAttributesW,
46 AcquireCredentialsHandleW,
47 FreeCredentialsHandle,
48 NULL, /* Reserved2 */
49 InitializeSecurityContextW,
50 AcceptSecurityContext,
51 CompleteAuthToken,
52 DeleteSecurityContext,
53 ApplyControlTokenW,
54 QueryContextAttributesW,
55 ImpersonateSecurityContext,
56 RevertSecurityContext,
57 MakeSignature,
58 VerifySignature,
59 FreeContextBuffer,
60 QuerySecurityPackageInfoW,
61 EncryptMessage, /* Reserved3 */
62 DecryptMessage, /* Reserved4 */
63 ExportSecurityContext,
64 ImportSecurityContextW,
65 AddCredentialsW,
66 NULL, /* Reserved8 */
67 QuerySecurityContextToken,
68 EncryptMessage,
69 DecryptMessage,
70 NULL
71 };
72
73 SECURITY_STATUS
74 WINAPI
75 EnumerateSecurityPackagesW (
76 PULONG pulong,
77 PSecPkgInfoW* psecpkginfow
78 )
79 {
80 UNIMPLEMENTED;
81 return ERROR_CALL_NOT_IMPLEMENTED;
82 }
83
84 SECURITY_STATUS
85 WINAPI
86 EnumerateSecurityPackagesA(
87 PULONG pulong,
88 PSecPkgInfoA* psecpkginfoa
89 )
90 {
91 UNIMPLEMENTED;
92 return ERROR_CALL_NOT_IMPLEMENTED;
93 }
94
95 SECURITY_STATUS
96 WINAPI
97 FreeContextBuffer (
98 PVOID pvoid
99 )
100 {
101 HeapFree(GetProcessHeap(), 0, pvoid);
102 return SEC_E_OK;
103 }
104
105 SECURITY_STATUS
106 WINAPI
107 FreeCredentialsHandle(PCredHandle Handle)
108 {
109 UNIMPLEMENTED;
110 return ERROR_CALL_NOT_IMPLEMENTED;
111 }
112
113 SECURITY_STATUS
114 WINAPI
115 DeleteSecurityContext(PCtxtHandle Handle)
116 {
117 UNIMPLEMENTED;
118 return ERROR_CALL_NOT_IMPLEMENTED;
119 }
120
121 PSecurityFunctionTableW
122 WINAPI
123 InitSecurityInterfaceW(VOID)
124 {
125 DPRINT("InitSecurityInterfaceW() called\n");
126 return &securityFunctionTableW;
127 }
128
129 SECURITY_STATUS
130 WINAPI
131 EncryptMessage(PCtxtHandle Handle,
132 ULONG Foo,
133 PSecBufferDesc Buffer,
134 ULONG Bar)
135 {
136 UNIMPLEMENTED;
137 return ERROR_CALL_NOT_IMPLEMENTED;
138 }
139
140 SECURITY_STATUS
141 WINAPI
142 DecryptMessage(PCtxtHandle Handle,
143 PSecBufferDesc Buffer,
144 ULONG Foo,
145 PULONG Bar)
146 {
147 UNIMPLEMENTED;
148 return ERROR_CALL_NOT_IMPLEMENTED;
149 }
150
151 SECURITY_STATUS
152 WINAPI
153 ApplyControlTokenW(PCtxtHandle Handle,
154 PSecBufferDesc Buffer)
155 {
156 UNIMPLEMENTED;
157 return ERROR_CALL_NOT_IMPLEMENTED;
158 }
159
160 SECURITY_STATUS
161 WINAPI
162 ApplyControlTokenA(PCtxtHandle Handle,
163 PSecBufferDesc Buffer)
164 {
165 UNIMPLEMENTED;
166 return ERROR_CALL_NOT_IMPLEMENTED;
167 }
168
169 SECURITY_STATUS
170 WINAPI
171 CompleteAuthToken(PCtxtHandle Handle,
172 PSecBufferDesc Buffer)
173 {
174 UNIMPLEMENTED;
175 return ERROR_CALL_NOT_IMPLEMENTED;
176 }
177
178 SECURITY_STATUS
179 WINAPI
180 QueryContextAttributesA(PCtxtHandle Handle,
181 ULONG Foo,
182 PVOID Bar)
183 {
184 UNIMPLEMENTED;
185 return ERROR_CALL_NOT_IMPLEMENTED;
186 }
187
188 SECURITY_STATUS
189 WINAPI
190 QueryContextAttributesW(PCtxtHandle Handle,
191 ULONG Foo,
192 PVOID Bar)
193 {
194 UNIMPLEMENTED;
195 return ERROR_CALL_NOT_IMPLEMENTED;
196 }
197
198 SECURITY_STATUS
199 WINAPI
200 AcquireCredentialsHandleA (
201 SEC_CHAR* pszPrincipal,
202 SEC_CHAR* pszPackage,
203 ULONG fUsage,
204 PLUID pID,
205 PVOID pAuth,
206 SEC_GET_KEY_FN pGetKeyFn,
207 PVOID pvGetKeyArgument,
208 PCredHandle phCred,
209 PTimeStamp pExpires
210 )
211 {
212 UNIMPLEMENTED;
213 return ERROR_CALL_NOT_IMPLEMENTED;
214 }
215
216 SECURITY_STATUS
217 WINAPI
218 AcquireCredentialsHandleW (
219 SEC_WCHAR* pszPrincipal,
220 SEC_WCHAR* pszPackage,
221 ULONG fUsage,
222 PLUID pID,
223 PVOID pAuth,
224 SEC_GET_KEY_FN pGetKeyFn,
225 PVOID pvGetKeyArgument,
226 PCredHandle phCred,
227 PTimeStamp pExpires
228 )
229 {
230 UNIMPLEMENTED;
231 return ERROR_CALL_NOT_IMPLEMENTED;
232 }
233
234 SECURITY_STATUS
235 WINAPI
236 InitializeSecurityContextW (
237 PCredHandle phCred,
238 PCtxtHandle phContext,
239 SEC_WCHAR* pszTarget,
240 ULONG fContextReq,
241 ULONG Reserved,
242 ULONG TargetData,
243 PSecBufferDesc pInput,
244 ULONG Reserved2,
245 PCtxtHandle phNewContext,
246 PSecBufferDesc pOut,
247 PULONG pfContextAttributes,
248 PTimeStamp pExpires
249 )
250 {
251 UNIMPLEMENTED;
252 return ERROR_CALL_NOT_IMPLEMENTED;
253 }
254
255 SECURITY_STATUS
256 WINAPI
257 InitializeSecurityContextA (
258 PCredHandle phCred,
259 PCtxtHandle phContext,
260 SEC_CHAR* pszTarget,
261 ULONG fContextReq,
262 ULONG Reserved,
263 ULONG TargetData,
264 PSecBufferDesc pInput,
265 ULONG Reserved2,
266 PCtxtHandle phNewContext,
267 PSecBufferDesc pOut,
268 PULONG pfContextAttributes,
269 PTimeStamp pExpires
270 )
271 {
272 UNIMPLEMENTED;
273 return ERROR_CALL_NOT_IMPLEMENTED;
274 }
275
276
277 SECURITY_STATUS
278 SEC_ENTRY
279 MakeSignature(
280 PCtxtHandle phContext,
281 ULONG fQOP,
282 PSecBufferDesc pMessage,
283 ULONG MessageSeqNo
284 )
285 {
286 UNIMPLEMENTED;
287 return ERROR_CALL_NOT_IMPLEMENTED;
288 }
289
290
291 SECURITY_STATUS
292 SEC_ENTRY
293 VerifySignature(
294 PCtxtHandle phContext,
295 PSecBufferDesc pMessage,
296 ULONG MessageSeqNo,
297 PULONG pfQOP
298 )
299 {
300 UNIMPLEMENTED;
301 return ERROR_CALL_NOT_IMPLEMENTED;
302 }
303
304 SECURITY_STATUS
305 SEC_ENTRY
306 QuerySecurityPackageInfoA(
307 SEC_CHAR* pszPackageName,
308 PSecPkgInfoA* ppPackageInfo
309 )
310 {
311 UNIMPLEMENTED;
312 return ERROR_CALL_NOT_IMPLEMENTED;
313 }
314
315 SECURITY_STATUS
316 SEC_ENTRY
317 QuerySecurityPackageInfoW(
318 SEC_WCHAR* pszPackageName,
319 PSecPkgInfoW* ppPackageInfo
320 )
321 {
322 UNIMPLEMENTED;
323 return ERROR_CALL_NOT_IMPLEMENTED;
324 }
325
326 SECURITY_STATUS
327 WINAPI
328 AcceptSecurityContext(
329 PCredHandle phCredential,
330 PCtxtHandle phContext,
331 PSecBufferDesc pInput,
332 ULONG fContextReq,
333 ULONG TargetDataRep,
334 PCtxtHandle phNewContext,
335 PSecBufferDesc pOutput,
336 ULONG *pfContextAttr,
337 PTimeStamp ptsExpiry
338 )
339 {
340 UNIMPLEMENTED;
341 return ERROR_CALL_NOT_IMPLEMENTED;
342 }
343
344 SECURITY_STATUS
345 WINAPI
346 AddCredentialsA(
347 PCredHandle hCredentials,
348 SEC_CHAR *pszPrincipal,
349 SEC_CHAR *pszPackage,
350 ULONG fCredentialUse,
351 LPVOID pAuthData,
352 SEC_GET_KEY_FN pGetKeyFn,
353 LPVOID pvGetKeyArgument,
354 PTimeStamp ptsExpiry
355 )
356 {
357 UNIMPLEMENTED;
358 return ERROR_CALL_NOT_IMPLEMENTED;
359 }
360
361 SECURITY_STATUS
362 WINAPI
363 AddCredentialsW(
364 PCredHandle hCredentials,
365 SEC_WCHAR *pszPrincipal,
366 SEC_WCHAR *pszPackage,
367 ULONG fCredentialUse,
368 LPVOID pAuthData,
369 SEC_GET_KEY_FN pGetKeyFn,
370 LPVOID pvGetKeyArgument,
371 PTimeStamp ptsExpiry
372 )
373 {
374 UNIMPLEMENTED;
375 return ERROR_CALL_NOT_IMPLEMENTED;
376 }
377
378 SECURITY_STATUS
379 WINAPI
380 ExportSecurityContext(
381 PCtxtHandle phContext,
382 ULONG fFlags,
383 PSecBuffer pPackedContext,
384 LPVOID *pToken
385 )
386 {
387 UNIMPLEMENTED;
388 return ERROR_CALL_NOT_IMPLEMENTED;
389 }
390
391 SECURITY_STATUS
392 WINAPI
393 ImpersonateSecurityContext(
394 PCtxtHandle phContext
395 )
396 {
397 UNIMPLEMENTED;
398 return ERROR_CALL_NOT_IMPLEMENTED;
399 }
400
401 SECURITY_STATUS
402 WINAPI
403 ImportSecurityContextA(
404 SEC_CHAR *pszPackage,
405 PSecBuffer pPackedContext,
406 LPVOID Token,
407 PCtxtHandle phContext
408 )
409 {
410 UNIMPLEMENTED;
411 return ERROR_CALL_NOT_IMPLEMENTED;
412 }
413
414 SECURITY_STATUS
415 WINAPI
416 ImportSecurityContextW(
417 SEC_WCHAR *pszPackage,
418 PSecBuffer pPackedContext,
419 LPVOID Token,
420 PCtxtHandle phContext
421 )
422 {
423 UNIMPLEMENTED;
424 return ERROR_CALL_NOT_IMPLEMENTED;
425 }
426
427 SECURITY_STATUS
428 WINAPI
429 QueryCredentialsAttributesA(
430 PCredHandle phCredential,
431 ULONG ulAttribute,
432 LPVOID pBuffer
433 )
434 {
435 UNIMPLEMENTED;
436 return ERROR_CALL_NOT_IMPLEMENTED;
437 }
438
439 SECURITY_STATUS
440 WINAPI
441 QueryCredentialsAttributesW(
442 PCredHandle phCredential,
443 ULONG ulAttribute,
444 LPVOID pBuffer
445 )
446 {
447 UNIMPLEMENTED;
448 return ERROR_CALL_NOT_IMPLEMENTED;
449 }
450
451 SECURITY_STATUS
452 WINAPI
453 QuerySecurityContextToken(
454 PCtxtHandle phContext,
455 PHANDLE phToken
456 )
457 {
458 UNIMPLEMENTED;
459 return ERROR_CALL_NOT_IMPLEMENTED;
460 }
461
462 SECURITY_STATUS
463 WINAPI
464 RevertSecurityContext(
465 PCtxtHandle phContext
466 )
467 {
468 UNIMPLEMENTED;
469 return ERROR_CALL_NOT_IMPLEMENTED;
470 }
471
472 PSecurityFunctionTableA
473 WINAPI
474 InitSecurityInterfaceA(VOID)
475 {
476 DPRINT("InitSecurityInterfaceA() called\n");
477 return &securityFunctionTableA;
478 }
479
480 BOOLEAN
481 WINAPI
482 TranslateNameA(
483 LPCSTR lpAccountName,
484 EXTENDED_NAME_FORMAT AccountNameFormat,
485 EXTENDED_NAME_FORMAT DesiredNameFormat,
486 LPSTR lpTranslatedName,
487 PULONG nSize
488 )
489 {
490 UNIMPLEMENTED;
491 return FALSE;
492 }
493
494 BOOLEAN
495 WINAPI
496 TranslateNameW(
497 LPCWSTR lpAccountName,
498 EXTENDED_NAME_FORMAT AccountNameFormat,
499 EXTENDED_NAME_FORMAT DesiredNameFormat,
500 LPWSTR lpTranslatedName,
501 PULONG nSize
502 )
503 {
504 UNIMPLEMENTED;
505 return FALSE;
506 }