[SECUR32]
[reactos.git] / reactos / dll / win32 / schannel / lsamode.c
1 /*
2 * LSA-mode functions of the SChannel security provider
3 *
4 * Copyright 2007 Yuval Fledel
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #include "precomp.h"
22
23 #include <schannel.h>
24
25 /***********************************************************************
26 * SpGetInfoUnified
27 */
28 static NTSTATUS WINAPI SpGetInfoUnified(PSecPkgInfoW PackageInfo)
29 {
30 TRACE("(%p)\n", PackageInfo);
31
32 PackageInfo->fCapabilities = SECPKG_FLAG_MUTUAL_AUTH |
33 SECPKG_FLAG_INTEGRITY | SECPKG_FLAG_PRIVACY |
34 SECPKG_FLAG_CONNECTION | SECPKG_FLAG_MULTI_REQUIRED |
35 SECPKG_FLAG_EXTENDED_ERROR | SECPKG_FLAG_IMPERSONATION |
36 SECPKG_FLAG_ACCEPT_WIN32_NAME | SECPKG_FLAG_STREAM;
37 PackageInfo->wVersion = 1;
38 PackageInfo->wRPCID = UNISP_RPC_ID;
39 PackageInfo->cbMaxToken = 0x4000;
40 PackageInfo->Name = (LPWSTR)UNISP_NAME_W;
41 PackageInfo->Comment = (LPWSTR)UNISP_NAME_W;
42
43 return STATUS_SUCCESS;
44 }
45
46 static SEC_WCHAR schannelCommentW[] = { 'S','c','h','a','n','n','e','l',
47 ' ','S','e','c','u','r','i','t','y',' ','P','a','c','k','a','g','e',0 };
48
49 /***********************************************************************
50 * SpGetInfoSChannel
51 */
52 static NTSTATUS WINAPI SpGetInfoSChannel(PSecPkgInfoW PackageInfo)
53 {
54 TRACE("(%p)\n", PackageInfo);
55
56 PackageInfo->fCapabilities = SECPKG_FLAG_MUTUAL_AUTH |
57 SECPKG_FLAG_INTEGRITY | SECPKG_FLAG_PRIVACY |
58 SECPKG_FLAG_CONNECTION | SECPKG_FLAG_MULTI_REQUIRED |
59 SECPKG_FLAG_EXTENDED_ERROR | SECPKG_FLAG_IMPERSONATION |
60 SECPKG_FLAG_ACCEPT_WIN32_NAME | SECPKG_FLAG_STREAM;
61 PackageInfo->wVersion = 1;
62 PackageInfo->wRPCID = UNISP_RPC_ID;
63 PackageInfo->cbMaxToken = 0x4000;
64 PackageInfo->Name = (LPWSTR)SCHANNEL_NAME_W;
65 PackageInfo->Comment = schannelCommentW;
66
67 return STATUS_SUCCESS;
68 }
69
70 static SECPKG_FUNCTION_TABLE secPkgFunctionTable[2] =
71 { {
72 NULL, /* InitializePackage */
73 NULL, /* LsaLogonUser */
74 NULL, /* CallPackage */
75 NULL, /* LogonTerminated */
76 NULL, /* CallPackageUntrusted */
77 NULL, /* CallPackagePassthrough */
78 NULL, /* LogonUserEx */
79 NULL, /* LogonUserEx2 */
80 NULL, /* Initialize */
81 NULL, /* Shutdown */
82 SpGetInfoUnified,
83 NULL, /* AcceptCredentials */
84 NULL, /* SpAcquireCredentialsHandle */
85 NULL, /* SpQueryCredentialsAttributes */
86 NULL, /* FreeCredentialsHandle */
87 NULL, /* SaveCredentials */
88 NULL, /* GetCredentials */
89 NULL, /* DeleteCredentials */
90 NULL, /* InitLsaModeContext */
91 NULL, /* AcceptLsaModeContext */
92 NULL, /* DeleteContext */
93 NULL, /* ApplyControlToken */
94 NULL, /* GetUserInfo */
95 NULL, /* GetExtendedInformation */
96 NULL, /* SpQueryContextAttributes */
97 NULL, /* SpAddCredentials */
98 NULL, /* SetExtendedInformation */
99 NULL, /* SetContextAttributes */
100 NULL, /* SetCredentialsAttributes */
101 NULL, /* ChangeAccountPassword */
102 NULL, /* QueryMetaData */
103 NULL, /* ExchangeMetaData */
104 NULL, /* GetCredUIContext */
105 NULL, /* UpdateCredentials */
106 NULL, /* ValidateTargetInfo */
107 }, {
108 NULL, /* InitializePackage */
109 NULL, /* LsaLogonUser */
110 NULL, /* CallPackage */
111 NULL, /* LogonTerminated */
112 NULL, /* CallPackageUntrusted */
113 NULL, /* CallPackagePassthrough */
114 NULL, /* LogonUserEx */
115 NULL, /* LogonUserEx2 */
116 NULL, /* Initialize */
117 NULL, /* Shutdown */
118 SpGetInfoSChannel,
119 NULL, /* AcceptCredentials */
120 NULL, /* SpAcquireCredentialsHandle */
121 NULL, /* SpQueryCredentialsAttributes */
122 NULL, /* FreeCredentialsHandle */
123 NULL, /* SaveCredentials */
124 NULL, /* GetCredentials */
125 NULL, /* DeleteCredentials */
126 NULL, /* InitLsaModeContext */
127 NULL, /* AcceptLsaModeContext */
128 NULL, /* DeleteContext */
129 NULL, /* ApplyControlToken */
130 NULL, /* GetUserInfo */
131 NULL, /* GetExtendedInformation */
132 NULL, /* SpQueryContextAttributes */
133 NULL, /* SpAddCredentials */
134 NULL, /* SetExtendedInformation */
135 NULL, /* SetContextAttributes */
136 NULL, /* SetCredentialsAttributes */
137 NULL, /* ChangeAccountPassword */
138 NULL, /* QueryMetaData */
139 NULL, /* ExchangeMetaData */
140 NULL, /* GetCredUIContext */
141 NULL, /* UpdateCredentials */
142 NULL, /* ValidateTargetInfo */
143 }
144 };
145
146 /***********************************************************************
147 * SpLsaModeInitialize (SCHANNEL.@)
148 */
149 NTSTATUS WINAPI SpLsaModeInitialize(ULONG LsaVersion, PULONG PackageVersion,
150 PSECPKG_FUNCTION_TABLE *ppTables, PULONG pcTables)
151 {
152 TRACE("(%u, %p, %p, %p)\n", LsaVersion, PackageVersion, ppTables, pcTables);
153
154 *PackageVersion = SECPKG_INTERFACE_VERSION_6;
155 *pcTables = 2;
156 *ppTables = secPkgFunctionTable;
157
158 return STATUS_SUCCESS;
159 }