ReactOS 0.4.15-dev-7942-gd23573b
negotiate.c File Reference
#include "precomp.h"
#include <wine/debug.h>
Include dependency graph for negotiate.c:

Go to the source code of this file.

Macros

#define NEGO_MAX_TOKEN   12000
 
#define CAPS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (secur32)
 
static SECURITY_STATUS SEC_ENTRY nego_QueryCredentialsAttributesA (PCredHandle phCredential, ULONG ulAttribute, PVOID pBuffer)
 
static SECURITY_STATUS SEC_ENTRY nego_QueryCredentialsAttributesW (PCredHandle phCredential, ULONG ulAttribute, PVOID pBuffer)
 
static SECURITY_STATUS SEC_ENTRY nego_AcquireCredentialsHandleW (SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialUse, PLUID pLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY nego_AcquireCredentialsHandleA (SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialUse, PLUID pLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY nego_InitializeSecurityContextW (PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY nego_InitializeSecurityContextA (PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY nego_AcceptSecurityContext (PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY nego_CompleteAuthToken (PCtxtHandle phContext, PSecBufferDesc pToken)
 
static SECURITY_STATUS SEC_ENTRY nego_DeleteSecurityContext (PCtxtHandle phContext)
 
static SECURITY_STATUS SEC_ENTRY nego_ApplyControlToken (PCtxtHandle phContext, PSecBufferDesc pInput)
 
static SECURITY_STATUS SEC_ENTRY nego_QueryContextAttributesW (PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
 
static SECURITY_STATUS SEC_ENTRY nego_QueryContextAttributesA (PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
 
static SECURITY_STATUS SEC_ENTRY nego_ImpersonateSecurityContext (PCtxtHandle phContext)
 
static SECURITY_STATUS SEC_ENTRY nego_RevertSecurityContext (PCtxtHandle phContext)
 
static SECURITY_STATUS SEC_ENTRY nego_MakeSignature (PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
 
static SECURITY_STATUS SEC_ENTRY nego_VerifySignature (PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
 
static SECURITY_STATUS SEC_ENTRY nego_FreeCredentialsHandle (PCredHandle phCredential)
 
static SECURITY_STATUS SEC_ENTRY nego_EncryptMessage (PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
 
static SECURITY_STATUS SEC_ENTRY nego_DecryptMessage (PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
 
void SECUR32_initNegotiateSP (void)
 

Variables

static const SecurityFunctionTableA negoTableA
 
static const SecurityFunctionTableW negoTableW
 
static WCHAR nego_name_W [] = {'N','e','g','o','t','i','a','t','e',0}
 
static char nego_name_A [] = "Negotiate"
 
static WCHAR negotiate_comment_W []
 
static CHAR negotiate_comment_A [] = "Microsoft Package Negotiator"
 

Macro Definition Documentation

◆ CAPS

#define CAPS
Value:
( \
#define SECPKG_FLAG_IMPERSONATION
Definition: sspi.h:134
#define SECPKG_FLAG_EXTENDED_ERROR
Definition: sspi.h:133
#define SECPKG_FLAG_PRIVACY
Definition: sspi.h:127
#define SECPKG_FLAG_RESTRICTED_TOKENS
Definition: sspi.h:145
#define SECPKG_FLAG_MULTI_REQUIRED
Definition: sspi.h:131
#define SECPKG_FLAG_CONNECTION
Definition: sspi.h:130
#define SECPKG_FLAG_NEGOTIABLE
Definition: sspi.h:137
#define SECPKG_FLAG_INTEGRITY
Definition: sspi.h:126
#define SECPKG_FLAG_LOGON
Definition: sspi.h:139
#define SECPKG_FLAG_ACCEPT_WIN32_NAME
Definition: sspi.h:135
#define SECPKG_FLAG_GSS_COMPATIBLE
Definition: sspi.h:138

Definition at line 503 of file negotiate.c.

◆ NEGO_MAX_TOKEN

#define NEGO_MAX_TOKEN   12000

Definition at line 493 of file negotiate.c.

Function Documentation

◆ nego_AcceptSecurityContext()

static SECURITY_STATUS SEC_ENTRY nego_AcceptSecurityContext ( PCredHandle  phCredential,
PCtxtHandle  phContext,
PSecBufferDesc  pInput,
ULONG  fContextReq,
ULONG  TargetDataRep,
PCtxtHandle  phNewContext,
PSecBufferDesc  pOutput,
ULONG pfContextAttr,
PTimeStamp  ptsExpiry 
)
static

Definition at line 213 of file negotiate.c.

217{
218 TRACE("%p, %p, %p, 0x%08x, %u, %p, %p, %p, %p\n", phCredential, phContext,
219 pInput, fContextReq, TargetDataRep, phNewContext, pOutput, pfContextAttr,
220 ptsExpiry);
221
222 return ntlm_AcceptSecurityContext( phCredential, phContext, pInput,
223 fContextReq, TargetDataRep, phNewContext,
224 pOutput, pfContextAttr, ptsExpiry );
225}
SECURITY_STATUS SEC_ENTRY ntlm_AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
Definition: ntlm.c:1029
#define TRACE(s)
Definition: solgame.cpp:4

◆ nego_AcquireCredentialsHandleA()

static SECURITY_STATUS SEC_ENTRY nego_AcquireCredentialsHandleA ( SEC_CHAR pszPrincipal,
SEC_CHAR pszPackage,
ULONG  fCredentialUse,
PLUID  pLogonID,
PVOID  pAuthData,
SEC_GET_KEY_FN  pGetKeyFn,
PVOID  pGetKeyArgument,
PCredHandle  phCredential,
PTimeStamp  ptsExpiry 
)
static

Definition at line 78 of file negotiate.c.

82{
84 SEC_WCHAR *user = NULL, *domain = NULL, *passwd = NULL, *package = NULL;
86
87 TRACE("%s, %s, 0x%08x, %p, %p, %p, %p, %p, %p\n",
88 debugstr_a(pszPrincipal), debugstr_a(pszPackage), fCredentialUse,
89 pLogonID, pAuthData, pGetKeyFn, pGetKeyArgument, phCredential, ptsExpiry);
90
91 if (pszPackage)
92 {
93 int package_len = MultiByteToWideChar( CP_ACP, 0, pszPackage, -1, NULL, 0 );
94 package = HeapAlloc( GetProcessHeap(), 0, package_len * sizeof(SEC_WCHAR) );
95 if (!package) return SEC_E_INSUFFICIENT_MEMORY;
96 MultiByteToWideChar( CP_ACP, 0, pszPackage, -1, package, package_len );
97 }
98 if (pAuthData)
99 {
101 int user_len, domain_len, passwd_len;
102
104 {
105 identityW = HeapAlloc( GetProcessHeap(), 0, sizeof(*identityW) );
106 if (!identityW) goto done;
107
108 if (!identity->UserLength) user_len = 0;
109 else
110 {
111 user_len = MultiByteToWideChar( CP_ACP, 0, (LPCSTR)identity->User,
112 identity->UserLength, NULL, 0 );
113 user = HeapAlloc( GetProcessHeap(), 0, user_len * sizeof(SEC_WCHAR) );
114 if (!user) goto done;
115 MultiByteToWideChar( CP_ACP, 0, (LPCSTR)identity->User, identity->UserLength,
116 user, user_len );
117 }
118 if (!identity->DomainLength) domain_len = 0;
119 else
120 {
121 domain_len = MultiByteToWideChar( CP_ACP, 0, (LPCSTR)identity->Domain,
122 identity->DomainLength, NULL, 0 );
123 domain = HeapAlloc( GetProcessHeap(), 0, domain_len * sizeof(SEC_WCHAR) );
124 if (!domain) goto done;
125 MultiByteToWideChar( CP_ACP, 0, (LPCSTR)identity->Domain, identity->DomainLength,
126 domain, domain_len );
127 }
128 if (!identity->PasswordLength) passwd_len = 0;
129 else
130 {
131 passwd_len = MultiByteToWideChar( CP_ACP, 0, (LPCSTR)identity->Password,
132 identity->PasswordLength, NULL, 0 );
133 passwd = HeapAlloc( GetProcessHeap(), 0, passwd_len * sizeof(SEC_WCHAR) );
134 if (!passwd) goto done;
135 MultiByteToWideChar( CP_ACP, 0, (LPCSTR)identity->Password, identity->PasswordLength,
136 passwd, passwd_len );
137 }
138 identityW->Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
139 identityW->User = user;
140 identityW->UserLength = user_len;
141 identityW->Domain = domain;
142 identityW->DomainLength = domain_len;
143 identityW->Password = passwd;
144 identityW->PasswordLength = passwd_len;
145 }
146 else identityW = (SEC_WINNT_AUTH_IDENTITY_W *)identity;
147 }
148 ret = nego_AcquireCredentialsHandleW( NULL, package, fCredentialUse, pLogonID, identityW,
149 pGetKeyFn, pGetKeyArgument, phCredential, ptsExpiry );
150done:
151 HeapFree( GetProcessHeap(), 0, package );
154 HeapFree( GetProcessHeap(), 0, passwd );
155 HeapFree( GetProcessHeap(), 0, identityW );
156 return ret;
157}
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define MultiByteToWideChar
Definition: compat.h:110
static SECURITY_STATUS SEC_ENTRY nego_AcquireCredentialsHandleW(SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialUse, PLUID pLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
Definition: negotiate.c:51
#define debugstr_a
Definition: kernel32.h:31
LONG SECURITY_STATUS
Definition: sspi.h:34
WCHAR SEC_WCHAR
Definition: sspi.h:29
#define SEC_WINNT_AUTH_IDENTITY_UNICODE
Definition: rpcdce.h:310
#define SEC_WINNT_AUTH_IDENTITY_ANSI
Definition: rpcdce.h:309
Definition: cookie.c:42
int ret
#define SEC_E_INSUFFICIENT_MEMORY
Definition: winerror.h:2909
const char * LPCSTR
Definition: xmlstorage.h:183

◆ nego_AcquireCredentialsHandleW()

static SECURITY_STATUS SEC_ENTRY nego_AcquireCredentialsHandleW ( SEC_WCHAR pszPrincipal,
SEC_WCHAR pszPackage,
ULONG  fCredentialUse,
PLUID  pLogonID,
PVOID  pAuthData,
SEC_GET_KEY_FN  pGetKeyFn,
PVOID  pGetKeyArgument,
PCredHandle  phCredential,
PTimeStamp  ptsExpiry 
)
static

Definition at line 51 of file negotiate.c.

55{
56 static SEC_WCHAR ntlmW[] = {'N','T','L','M',0};
58
59 TRACE("%s, %s, 0x%08x, %p, %p, %p, %p, %p, %p\n",
60 debugstr_w(pszPrincipal), debugstr_w(pszPackage), fCredentialUse,
61 pLogonID, pAuthData, pGetKeyFn, pGetKeyArgument, phCredential, ptsExpiry);
62
63 FIXME("forwarding to NTLM\n");
64 ret = ntlm_AcquireCredentialsHandleW( pszPrincipal, ntlmW, fCredentialUse,
65 pLogonID, pAuthData, pGetKeyFn, pGetKeyArgument,
66 phCredential, ptsExpiry );
67 if (ret == SEC_E_OK)
68 {
69 NtlmCredentials *cred = (NtlmCredentials *)phCredential->dwLower;
70 cred->no_cached_credentials = (pAuthData == NULL);
71 }
72 return ret;
73}
#define FIXME(fmt,...)
Definition: debug.h:111
SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleW(SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialUse, PLUID pLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
Definition: ntlm.c:127
#define debugstr_w
Definition: kernel32.h:32
static const WCHAR ntlmW[]
int no_cached_credentials
Definition: ntlm.h:65
ULONG_PTR dwLower
Definition: sspi.h:53
#define SEC_E_OK
Definition: winerror.h:2356

Referenced by nego_AcquireCredentialsHandleA().

◆ nego_ApplyControlToken()

static SECURITY_STATUS SEC_ENTRY nego_ApplyControlToken ( PCtxtHandle  phContext,
PSecBufferDesc  pInput 
)
static

Definition at line 260 of file negotiate.c.

262{
264
265 TRACE("%p %p\n", phContext, pInput);
266 if (phContext)
267 {
269 }
270 else
271 {
273 }
274 return ret;
275}
#define SEC_E_INVALID_HANDLE
Definition: winerror.h:2910
#define SEC_E_UNSUPPORTED_FUNCTION
Definition: winerror.h:2911

◆ nego_CompleteAuthToken()

static SECURITY_STATUS SEC_ENTRY nego_CompleteAuthToken ( PCtxtHandle  phContext,
PSecBufferDesc  pToken 
)
static

Definition at line 230 of file negotiate.c.

232{
234
235 TRACE("%p %p\n", phContext, pToken);
236 if (phContext)
237 {
239 }
240 else
241 {
243 }
244 return ret;
245}

◆ nego_DecryptMessage()

static SECURITY_STATUS SEC_ENTRY nego_DecryptMessage ( PCtxtHandle  phContext,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo,
PULONG  pfQOP 
)
static

Definition at line 423 of file negotiate.c.

425{
426 TRACE("%p, %p, %u, %p\n", phContext, pMessage, MessageSeqNo, pfQOP);
427
428 return ntlm_DecryptMessage( phContext, pMessage, MessageSeqNo, pfQOP );
429}
SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
Definition: ntlm.c:1863

◆ nego_DeleteSecurityContext()

static SECURITY_STATUS SEC_ENTRY nego_DeleteSecurityContext ( PCtxtHandle  phContext)
static

Definition at line 250 of file negotiate.c.

251{
252 TRACE("%p\n", phContext);
253
254 return ntlm_DeleteSecurityContext( phContext );
255}
SECURITY_STATUS SEC_ENTRY ntlm_DeleteSecurityContext(PCtxtHandle phContext)
Definition: ntlm.c:1398

◆ nego_EncryptMessage()

static SECURITY_STATUS SEC_ENTRY nego_EncryptMessage ( PCtxtHandle  phContext,
ULONG  fQOP,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo 
)
static

Definition at line 412 of file negotiate.c.

414{
415 TRACE("%p, 0x%08x, %p, %u\n", phContext, fQOP, pMessage, MessageSeqNo);
416
417 return ntlm_EncryptMessage( phContext, fQOP, pMessage, MessageSeqNo );
418}
SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
Definition: ntlm.c:1792

◆ nego_FreeCredentialsHandle()

static SECURITY_STATUS SEC_ENTRY nego_FreeCredentialsHandle ( PCredHandle  phCredential)
static

Definition at line 402 of file negotiate.c.

403{
404 TRACE("%p\n", phCredential);
405
406 return ntlm_FreeCredentialsHandle( phCredential );
407}
SECURITY_STATUS SEC_ENTRY ntlm_FreeCredentialsHandle(PCredHandle phCredential)
Definition: ntlm.c:1767

◆ nego_ImpersonateSecurityContext()

static SECURITY_STATUS SEC_ENTRY nego_ImpersonateSecurityContext ( PCtxtHandle  phContext)
static

Definition at line 342 of file negotiate.c.

343{
345
346 TRACE("%p\n", phContext);
347 if (phContext)
348 {
350 }
351 else
352 {
354 }
355 return ret;
356}

◆ nego_InitializeSecurityContextA()

static SECURITY_STATUS SEC_ENTRY nego_InitializeSecurityContextA ( PCredHandle  phCredential,
PCtxtHandle  phContext,
SEC_CHAR pszTargetName,
ULONG  fContextReq,
ULONG  Reserved1,
ULONG  TargetDataRep,
PSecBufferDesc  pInput,
ULONG  Reserved2,
PCtxtHandle  phNewContext,
PSecBufferDesc  pOutput,
ULONG pfContextAttr,
PTimeStamp  ptsExpiry 
)
static

Definition at line 182 of file negotiate.c.

187{
190
191 TRACE("%p, %p, %s, 0x%08x, %u, %u, %p, %u, %p, %p, %p, %p\n",
192 phCredential, phContext, debugstr_a(pszTargetName), fContextReq,
193 Reserved1, TargetDataRep, pInput, Reserved1, phNewContext, pOutput,
194 pfContextAttr, ptsExpiry);
195
196 if (pszTargetName)
197 {
198 int target_len = MultiByteToWideChar( CP_ACP, 0, pszTargetName, -1, NULL, 0 );
199 target = HeapAlloc(GetProcessHeap(), 0, target_len * sizeof(SEC_WCHAR) );
201 MultiByteToWideChar( CP_ACP, 0, pszTargetName, -1, target, target_len );
202 }
203 ret = nego_InitializeSecurityContextW( phCredential, phContext, target, fContextReq,
204 Reserved1, TargetDataRep, pInput, Reserved2,
205 phNewContext, pOutput, pfContextAttr, ptsExpiry );
207 return ret;
208}
@ Reserved2
Definition: bcd.h:202
@ Reserved1
Definition: bcd.h:201
static SECURITY_STATUS SEC_ENTRY nego_InitializeSecurityContextW(PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
Definition: negotiate.c:162
GLenum target
Definition: glext.h:7315

◆ nego_InitializeSecurityContextW()

static SECURITY_STATUS SEC_ENTRY nego_InitializeSecurityContextW ( PCredHandle  phCredential,
PCtxtHandle  phContext,
SEC_WCHAR pszTargetName,
ULONG  fContextReq,
ULONG  Reserved1,
ULONG  TargetDataRep,
PSecBufferDesc  pInput,
ULONG  Reserved2,
PCtxtHandle  phNewContext,
PSecBufferDesc  pOutput,
ULONG pfContextAttr,
PTimeStamp  ptsExpiry 
)
static

Definition at line 162 of file negotiate.c.

167{
168 TRACE("%p, %p, %s, 0x%08x, %u, %u, %p, %u, %p, %p, %p, %p\n",
169 phCredential, phContext, debugstr_w(pszTargetName), fContextReq,
170 Reserved1, TargetDataRep, pInput, Reserved1, phNewContext, pOutput,
171 pfContextAttr, ptsExpiry);
172
173 return ntlm_InitializeSecurityContextW( phCredential, phContext, pszTargetName,
174 fContextReq, Reserved1, TargetDataRep,
175 pInput, Reserved2, phNewContext,
176 pOutput, pfContextAttr, ptsExpiry );
177}
SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
Definition: ntlm.c:484

Referenced by nego_InitializeSecurityContextA().

◆ nego_MakeSignature()

static SECURITY_STATUS SEC_ENTRY nego_MakeSignature ( PCtxtHandle  phContext,
ULONG  fQOP,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo 
)
static

Definition at line 380 of file negotiate.c.

382{
383 TRACE("%p, 0x%08x, %p, %u\n", phContext, fQOP, pMessage, MessageSeqNo);
384
385 return ntlm_MakeSignature( phContext, fQOP, pMessage, MessageSeqNo );
386}
SECURITY_STATUS SEC_ENTRY ntlm_MakeSignature(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
Definition: ntlm.c:1662

◆ nego_QueryContextAttributesA()

static SECURITY_STATUS SEC_ENTRY nego_QueryContextAttributesA ( PCtxtHandle  phContext,
ULONG  ulAttribute,
void pBuffer 
)
static

Definition at line 311 of file negotiate.c.

313{
314 TRACE("%p, %u, %p\n", phContext, ulAttribute, pBuffer);
315
316 switch (ulAttribute)
317 {
319 {
321 sizes->cbMaxToken = 2888;
322 sizes->cbMaxSignature = 16;
323 sizes->cbSecurityTrailer = 16;
324 sizes->cbBlockSize = 0;
325 return SEC_E_OK;
326 }
328 {
330 info->PackageInfo = ntlm_package_infoA;
331 info->NegotiationState = SECPKG_NEGOTIATION_COMPLETE;
332 return SEC_E_OK;
333 }
334 default:
335 return ntlm_QueryContextAttributesA( phContext, ulAttribute, pBuffer );
336 }
337}
SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
Definition: ntlm.c:1482
SecPkgInfoA * ntlm_package_infoA
Definition: ntlm.c:2023
static const struct @542 sizes[]
#define SECPKG_ATTR_NEGOTIATION_INFO
Definition: sspi.h:533
#define SECPKG_ATTR_SIZES
Definition: sspi.h:521
#define SECPKG_NEGOTIATION_COMPLETE
Definition: sspi.h:701
PVOID pBuffer

◆ nego_QueryContextAttributesW()

static SECURITY_STATUS SEC_ENTRY nego_QueryContextAttributesW ( PCtxtHandle  phContext,
ULONG  ulAttribute,
void pBuffer 
)
static

Definition at line 280 of file negotiate.c.

282{
283 TRACE("%p, %u, %p\n", phContext, ulAttribute, pBuffer);
284
285 switch (ulAttribute)
286 {
288 {
290 sizes->cbMaxToken = 2888;
291 sizes->cbMaxSignature = 16;
292 sizes->cbSecurityTrailer = 16;
293 sizes->cbBlockSize = 0;
294 return SEC_E_OK;
295 }
297 {
299 info->PackageInfo = ntlm_package_infoW;
300 info->NegotiationState = SECPKG_NEGOTIATION_COMPLETE;
301 return SEC_E_OK;
302 }
303 default:
304 return ntlm_QueryContextAttributesW( phContext, ulAttribute, pBuffer );
305 }
306}
SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
Definition: ntlm.c:1427
SecPkgInfoW * ntlm_package_infoW
Definition: ntlm.c:2024

◆ nego_QueryCredentialsAttributesA()

static SECURITY_STATUS SEC_ENTRY nego_QueryCredentialsAttributesA ( PCredHandle  phCredential,
ULONG  ulAttribute,
PVOID  pBuffer 
)
static

Definition at line 31 of file negotiate.c.

33{
34 FIXME("%p, %u, %p\n", phCredential, ulAttribute, pBuffer);
36}

◆ nego_QueryCredentialsAttributesW()

static SECURITY_STATUS SEC_ENTRY nego_QueryCredentialsAttributesW ( PCredHandle  phCredential,
ULONG  ulAttribute,
PVOID  pBuffer 
)
static

Definition at line 41 of file negotiate.c.

43{
44 FIXME("%p, %u, %p\n", phCredential, ulAttribute, pBuffer);
46}

◆ nego_RevertSecurityContext()

static SECURITY_STATUS SEC_ENTRY nego_RevertSecurityContext ( PCtxtHandle  phContext)
static

Definition at line 361 of file negotiate.c.

362{
364
365 TRACE("%p\n", phContext);
366 if (phContext)
367 {
369 }
370 else
371 {
373 }
374 return ret;
375}

◆ nego_VerifySignature()

static SECURITY_STATUS SEC_ENTRY nego_VerifySignature ( PCtxtHandle  phContext,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo,
PULONG  pfQOP 
)
static

Definition at line 391 of file negotiate.c.

393{
394 TRACE("%p, %p, %u, %p\n", phContext, pMessage, MessageSeqNo, pfQOP);
395
396 return ntlm_VerifySignature( phContext, pMessage, MessageSeqNo, pfQOP );
397}
SECURITY_STATUS SEC_ENTRY ntlm_VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
Definition: ntlm.c:1697

◆ SECUR32_initNegotiateSP()

void SECUR32_initNegotiateSP ( void  )

Definition at line 516 of file negotiate.c.

517{
519
524 SECUR32_addPackages(provider, 1L, &infoA, &infoW);
525}
#define NEGO_MAX_TOKEN
Definition: negotiate.c:493
static const SecurityFunctionTableA negoTableA
Definition: negotiate.c:431
#define CAPS
Definition: negotiate.c:503
static WCHAR negotiate_comment_W[]
Definition: negotiate.c:498
static WCHAR nego_name_W[]
Definition: negotiate.c:495
static const SecurityFunctionTableW negoTableW
Definition: negotiate.c:462
static char nego_name_A[]
Definition: negotiate.c:496
static CHAR negotiate_comment_A[]
Definition: negotiate.c:501
static const SecPkgInfoW infoW
Definition: kerberos.c:293
static const SecPkgInfoA infoA
Definition: kerberos.c:302
#define RPC_C_AUTHN_GSS_NEGOTIATE
Definition: rpcdce.h:157
SecureProvider * SECUR32_addProvider(const SecurityFunctionTableA *fnTableA, const SecurityFunctionTableW *fnTableW, PCWSTR moduleName) DECLSPEC_HIDDEN
Definition: secur32_wine.c:314
void SECUR32_addPackages(SecureProvider *provider, ULONG toAdd, const SecPkgInfoA *infoA, const SecPkgInfoW *infoW) DECLSPEC_HIDDEN
Definition: secur32_wine.c:362

Referenced by SECUR32_initializeProviders().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( secur32  )

Variable Documentation

◆ nego_name_A

char nego_name_A[] = "Negotiate"
static

Definition at line 496 of file negotiate.c.

Referenced by SECUR32_initNegotiateSP().

◆ nego_name_W

WCHAR nego_name_W[] = {'N','e','g','o','t','i','a','t','e',0}
static

Definition at line 495 of file negotiate.c.

Referenced by SECUR32_initNegotiateSP().

◆ negoTableA

const SecurityFunctionTableA negoTableA
static
Initial value:
= {
1,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
static SECURITY_STATUS SEC_ENTRY nego_QueryCredentialsAttributesA(PCredHandle phCredential, ULONG ulAttribute, PVOID pBuffer)
Definition: negotiate.c:31
static SECURITY_STATUS SEC_ENTRY nego_DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
Definition: negotiate.c:423
static SECURITY_STATUS SEC_ENTRY nego_VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
Definition: negotiate.c:391
static SECURITY_STATUS SEC_ENTRY nego_ApplyControlToken(PCtxtHandle phContext, PSecBufferDesc pInput)
Definition: negotiate.c:260
static SECURITY_STATUS SEC_ENTRY nego_AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
Definition: negotiate.c:213
static SECURITY_STATUS SEC_ENTRY nego_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
Definition: negotiate.c:412
static SECURITY_STATUS SEC_ENTRY nego_QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
Definition: negotiate.c:311
static SECURITY_STATUS SEC_ENTRY nego_DeleteSecurityContext(PCtxtHandle phContext)
Definition: negotiate.c:250
static SECURITY_STATUS SEC_ENTRY nego_RevertSecurityContext(PCtxtHandle phContext)
Definition: negotiate.c:361
static SECURITY_STATUS SEC_ENTRY nego_ImpersonateSecurityContext(PCtxtHandle phContext)
Definition: negotiate.c:342
static SECURITY_STATUS SEC_ENTRY nego_AcquireCredentialsHandleA(SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialUse, PLUID pLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
Definition: negotiate.c:78
static SECURITY_STATUS SEC_ENTRY nego_CompleteAuthToken(PCtxtHandle phContext, PSecBufferDesc pToken)
Definition: negotiate.c:230
static SECURITY_STATUS SEC_ENTRY nego_MakeSignature(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
Definition: negotiate.c:380
static SECURITY_STATUS SEC_ENTRY nego_FreeCredentialsHandle(PCredHandle phCredential)
Definition: negotiate.c:402
static SECURITY_STATUS SEC_ENTRY nego_InitializeSecurityContextA(PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
Definition: negotiate.c:182
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
Definition: sspi.c:699

Definition at line 431 of file negotiate.c.

Referenced by SECUR32_initNegotiateSP().

◆ negoTableW

const SecurityFunctionTableW negoTableW
static
Initial value:

Definition at line 462 of file negotiate.c.

Referenced by SECUR32_initNegotiateSP().

◆ negotiate_comment_A

CHAR negotiate_comment_A[] = "Microsoft Package Negotiator"
static

Definition at line 501 of file negotiate.c.

Referenced by SECUR32_initNegotiateSP().

◆ negotiate_comment_W

WCHAR negotiate_comment_W[]
static
Initial value:
=
{'M','i','c','r','o','s','o','f','t',' ','P','a','c','k','a','g','e',' ',
'N','e','g','o','t','i','a','t','o','r',0}

Definition at line 498 of file negotiate.c.

Referenced by SECUR32_initNegotiateSP().