ReactOS  0.4.15-dev-499-g1f31905
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:
( \
SECPKG_FLAG_INTEGRITY | \
SECPKG_FLAG_PRIVACY | \
SECPKG_FLAG_CONNECTION | \
SECPKG_FLAG_MULTI_REQUIRED | \
SECPKG_FLAG_EXTENDED_ERROR | \
SECPKG_FLAG_IMPERSONATION | \
SECPKG_FLAG_ACCEPT_WIN32_NAME | \
SECPKG_FLAG_NEGOTIABLE | \
SECPKG_FLAG_GSS_COMPATIBLE | \
SECPKG_FLAG_LOGON | \
SECPKG_FLAG_RESTRICTED_TOKENS )

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;
85  SEC_WINNT_AUTH_IDENTITY_W *identityW = 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  {
100  SEC_WINNT_AUTH_IDENTITY_A *identity = pAuthData;
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 );
150 done:
151  HeapFree( GetProcessHeap(), 0, package );
152  HeapFree( GetProcessHeap(), 0, user );
153  HeapFree( GetProcessHeap(), 0, domain );
154  HeapFree( GetProcessHeap(), 0, passwd );
155  HeapFree( GetProcessHeap(), 0, identityW );
156  return ret;
157 }
WCHAR SEC_WCHAR
Definition: sspi.h:29
#define CP_ACP
Definition: compat.h:99
Definition: cookie.c:41
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 SEC_E_INSUFFICIENT_MEMORY
Definition: winerror.h:2909
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
LONG SECURITY_STATUS
Definition: sspi.h:34
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define debugstr_a
Definition: kernel32.h:31
#define SEC_WINNT_AUTH_IDENTITY_UNICODE
Definition: rpcdce.h:310
int ret
#define SEC_WINNT_AUTH_IDENTITY_ANSI
Definition: rpcdce.h:309
#define MultiByteToWideChar
Definition: compat.h:100
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define HeapFree(x, y, z)
Definition: compat.h:403

◆ 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 }
WCHAR SEC_WCHAR
Definition: sspi.h:29
ULONG_PTR dwLower
Definition: sspi.h:53
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR ntlmW[]
LONG SECURITY_STATUS
Definition: sspi.h:34
#define TRACE(s)
Definition: solgame.cpp:4
int ret
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 SEC_E_OK
Definition: winerror.h:2356
int no_cached_credentials
Definition: ntlm.h:65

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_UNSUPPORTED_FUNCTION
Definition: winerror.h:2911
LONG SECURITY_STATUS
Definition: sspi.h:34
#define TRACE(s)
Definition: solgame.cpp:4
#define SEC_E_INVALID_HANDLE
Definition: winerror.h:2910
int ret

◆ 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 }
#define SEC_E_UNSUPPORTED_FUNCTION
Definition: winerror.h:2911
LONG SECURITY_STATUS
Definition: sspi.h:34
#define TRACE(s)
Definition: solgame.cpp:4
#define SEC_E_INVALID_HANDLE
Definition: winerror.h:2910
int ret

◆ 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 }
#define TRACE(s)
Definition: solgame.cpp:4
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 }
#define TRACE(s)
Definition: solgame.cpp:4
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 }
#define TRACE(s)
Definition: solgame.cpp:4
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 }
#define TRACE(s)
Definition: solgame.cpp:4
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 }
#define SEC_E_UNSUPPORTED_FUNCTION
Definition: winerror.h:2911
LONG SECURITY_STATUS
Definition: sspi.h:34
#define TRACE(s)
Definition: solgame.cpp:4
#define SEC_E_INVALID_HANDLE
Definition: winerror.h:2910
int ret

◆ 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 {
189  SEC_WCHAR *target = NULL;
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) );
200  if (!target) return SEC_E_INSUFFICIENT_MEMORY;
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 );
206  HeapFree( GetProcessHeap(), 0, target );
207  return ret;
208 }
WCHAR SEC_WCHAR
Definition: sspi.h:29
#define CP_ACP
Definition: compat.h:99
#define SEC_E_INSUFFICIENT_MEMORY
Definition: winerror.h:2909
smooth NULL
Definition: ftsmooth.c:416
Definition: bcd.h:202
LONG SECURITY_STATUS
Definition: sspi.h:34
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define debugstr_a
Definition: kernel32.h:31
int ret
Definition: bcd.h:201
#define MultiByteToWideChar
Definition: compat.h:100
GLenum target
Definition: glext.h:7315
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
#define HeapFree(x, y, z)
Definition: compat.h:403

◆ 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 }
#define debugstr_w
Definition: kernel32.h:32
Definition: bcd.h:202
#define TRACE(s)
Definition: solgame.cpp:4
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
Definition: bcd.h:201

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
#define TRACE(s)
Definition: solgame.cpp:4

◆ 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  {
318  case SECPKG_ATTR_SIZES:
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 }
static const struct @530 sizes[]
#define SECPKG_NEGOTIATION_COMPLETE
Definition: sspi.h:701
SecPkgInfoA * ntlm_package_infoA
Definition: ntlm.c:2023
#define SECPKG_ATTR_SIZES
Definition: sspi.h:521
SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
Definition: ntlm.c:1482
PVOID pBuffer
#define SECPKG_ATTR_NEGOTIATION_INFO
Definition: sspi.h:533
#define TRACE(s)
Definition: solgame.cpp:4
#define SEC_E_OK
Definition: winerror.h:2356

◆ 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  {
287  case SECPKG_ATTR_SIZES:
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 }
static const struct @530 sizes[]
SecPkgInfoW * ntlm_package_infoW
Definition: ntlm.c:2024
#define SECPKG_NEGOTIATION_COMPLETE
Definition: sspi.h:701
SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
Definition: ntlm.c:1427
#define SECPKG_ATTR_SIZES
Definition: sspi.h:521
PVOID pBuffer
#define SECPKG_ATTR_NEGOTIATION_INFO
Definition: sspi.h:533
#define TRACE(s)
Definition: solgame.cpp:4
#define SEC_E_OK
Definition: winerror.h:2356

◆ 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 }
#define SEC_E_UNSUPPORTED_FUNCTION
Definition: winerror.h:2911
#define FIXME(fmt,...)
Definition: debug.h:111
PVOID pBuffer

◆ 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 }
#define SEC_E_UNSUPPORTED_FUNCTION
Definition: winerror.h:2911
#define FIXME(fmt,...)
Definition: debug.h:111
PVOID pBuffer

◆ 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 }
#define SEC_E_UNSUPPORTED_FUNCTION
Definition: winerror.h:2911
LONG SECURITY_STATUS
Definition: sspi.h:34
#define TRACE(s)
Definition: solgame.cpp:4
#define SEC_E_INVALID_HANDLE
Definition: winerror.h:2910
int ret

◆ 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 }
#define TRACE(s)
Definition: solgame.cpp:4
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 }
void SECUR32_addPackages(SecureProvider *provider, ULONG toAdd, const SecPkgInfoA *infoA, const SecPkgInfoW *infoW) DECLSPEC_HIDDEN
Definition: secur32_wine.c:362
static WCHAR nego_name_W[]
Definition: negotiate.c:495
static CHAR negotiate_comment_A[]
Definition: negotiate.c:501
static const SecurityFunctionTableW negoTableW
Definition: negotiate.c:462
static const SecPkgInfoA infoA
Definition: kerberos.c:302
SecureProvider * SECUR32_addProvider(const SecurityFunctionTableA *fnTableA, const SecurityFunctionTableW *fnTableW, PCWSTR moduleName) DECLSPEC_HIDDEN
Definition: secur32_wine.c:314
static char nego_name_A[]
Definition: negotiate.c:496
static const SecurityFunctionTableA negoTableA
Definition: negotiate.c:431
smooth NULL
Definition: ftsmooth.c:416
#define RPC_C_AUTHN_GSS_NEGOTIATE
Definition: rpcdce.h:157
static const SecPkgInfoW infoW
Definition: kerberos.c:293
static const WCHAR L[]
Definition: oid.c:1250
static WCHAR negotiate_comment_W[]
Definition: negotiate.c:498
#define NEGO_MAX_TOKEN
Definition: negotiate.c:493
#define CAPS
Definition: negotiate.c:503

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
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
Definition: sspi.c:699
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_MakeSignature(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
Definition: negotiate.c:380
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_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
smooth NULL
Definition: ftsmooth.c:416
static SECURITY_STATUS SEC_ENTRY nego_ImpersonateSecurityContext(PCtxtHandle phContext)
Definition: negotiate.c:342
static SECURITY_STATUS SEC_ENTRY nego_CompleteAuthToken(PCtxtHandle phContext, PSecBufferDesc pToken)
Definition: negotiate.c:230
static SECURITY_STATUS SEC_ENTRY nego_RevertSecurityContext(PCtxtHandle phContext)
Definition: negotiate.c:361
static SECURITY_STATUS SEC_ENTRY nego_DeleteSecurityContext(PCtxtHandle phContext)
Definition: negotiate.c:250
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_QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
Definition: negotiate.c:311
static SECURITY_STATUS SEC_ENTRY nego_FreeCredentialsHandle(PCredHandle phCredential)
Definition: negotiate.c:402
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_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_ApplyControlToken(PCtxtHandle phContext, PSecBufferDesc pInput)
Definition: negotiate.c:260

Definition at line 431 of file negotiate.c.

Referenced by SECUR32_initNegotiateSP().

◆ negoTableW

const SecurityFunctionTableW negoTableW
static
Initial value:
= {
1,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
Definition: sspi.c:699
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_MakeSignature(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
Definition: negotiate.c:380
static SECURITY_STATUS SEC_ENTRY nego_QueryContextAttributesW(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
Definition: negotiate.c:280
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
static SECURITY_STATUS SEC_ENTRY nego_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
Definition: negotiate.c:412
smooth NULL
Definition: ftsmooth.c:416
static SECURITY_STATUS SEC_ENTRY nego_ImpersonateSecurityContext(PCtxtHandle phContext)
Definition: negotiate.c:342
static SECURITY_STATUS SEC_ENTRY nego_CompleteAuthToken(PCtxtHandle phContext, PSecBufferDesc pToken)
Definition: negotiate.c:230
static SECURITY_STATUS SEC_ENTRY nego_QueryCredentialsAttributesW(PCredHandle phCredential, ULONG ulAttribute, PVOID pBuffer)
Definition: negotiate.c:41
static SECURITY_STATUS SEC_ENTRY nego_RevertSecurityContext(PCtxtHandle phContext)
Definition: negotiate.c:361
static SECURITY_STATUS SEC_ENTRY nego_DeleteSecurityContext(PCtxtHandle phContext)
Definition: negotiate.c:250
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_FreeCredentialsHandle(PCredHandle phCredential)
Definition: negotiate.c:402
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_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

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().