ReactOS  0.4.13-dev-100-gc8611ae
secur32.c
Go to the documentation of this file.
1 /*
2  * tests
3  *
4  * Copyright 2006 Robert Reif
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 #include <stdio.h>
21 #include <stdarg.h>
22 #include <windef.h>
23 #include <winbase.h>
24 #include <winnls.h>
25 #include <rpc.h>
26 #include <rpcdce.h>
27 #define SECURITY_WIN32
28 #include <security.h>
29 #include <schannel.h>
30 #include <wincred.h>
31 #include <winsock2.h>
32 
33 #include "wine/test.h"
34 
35 static HMODULE secdll;
36 
37 static SECURITY_STATUS (SEC_ENTRY *pSspiEncodeAuthIdentityAsStrings)
39 static SECURITY_STATUS (SEC_ENTRY *pSspiEncodeStringsAsAuthIdentity)
41 static void (SEC_ENTRY *pSspiFreeAuthIdentity)
43 static void (SEC_ENTRY *pSspiLocalFree)
44  (void *);
45 static SECURITY_STATUS (SEC_ENTRY *pSspiPrepareForCredWrite)
47 static void (SEC_ENTRY *pSspiZeroAuthIdentity)
49 
50 static BOOLEAN (WINAPI * pGetComputerObjectNameA)(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG lpnSize);
51 static BOOLEAN (WINAPI * pGetComputerObjectNameW)(EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG lpnSize);
52 static BOOLEAN (WINAPI * pGetUserNameExA)(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG lpnSize);
53 static BOOLEAN (WINAPI * pGetUserNameExW)(EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG lpnSize);
54 static PSecurityFunctionTableA (SEC_ENTRY * pInitSecurityInterfaceA)(void);
55 static PSecurityFunctionTableW (SEC_ENTRY * pInitSecurityInterfaceW)(void);
56 
57 static EXTENDED_NAME_FORMAT formats[] = {
58  NameUnknown, NameFullyQualifiedDN, NameSamCompatible, NameDisplay,
59  NameUniqueId, NameCanonical, NameUserPrincipal, NameCanonicalEx,
60  NameServicePrincipal, NameDnsDomain
61 };
62 
63 static void testGetComputerObjectNameA(void)
64 {
65  char name[256];
66  ULONG size;
67  BOOLEAN rc;
68  UINT i;
69 
70  for (i = 0; i < ARRAY_SIZE(formats); i++) {
71  size = 0;
72  SetLastError(0xdeadbeef);
73  rc = pGetComputerObjectNameA(formats[i], NULL, &size);
74  ok(!rc, "GetComputerObjectName(%u) should fail\n", formats[i]);
75  switch (formats[i])
76  {
77  case NameUnknown:
78  ok(GetLastError() == ERROR_INVALID_PARAMETER, "%u: got %u\n", formats[i], GetLastError());
79  break;
80  default:
85  "%u: got %u\n", formats[i], GetLastError());
86  break;
87  }
88 
89  if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) continue;
90 
91  size = sizeof(name);
92  SetLastError(0xdeadbeef);
93  rc = pGetComputerObjectNameA(formats[i], name, &size);
94  switch (formats[i])
95  {
96  case NameUnknown:
97  ok(!rc, "GetComputerObjectName(%u) should fail\n", formats[i]);
98  ok(GetLastError() == ERROR_INVALID_PARAMETER, "%u: got %u\n", formats[i], GetLastError());
99  break;
100  default:
101  ok(rc, "GetComputerObjectName(%u) error %u\n", formats[i], GetLastError());
102  trace("GetComputerObjectName(%u) returned %s\n", formats[i], name);
103  break;
104  }
105  }
106 }
107 
108 static void testGetComputerObjectNameW(void)
109 {
110  WCHAR nameW[256];
111  ULONG size;
112  BOOLEAN rc;
113  UINT i;
114 
115  for (i = 0; i < ARRAY_SIZE(formats); i++) {
116  size = 0;
117  SetLastError(0xdeadbeef);
118  rc = pGetComputerObjectNameW(formats[i], NULL, &size);
119  ok(!rc || broken(rc) /* win10 */, "GetComputerObjectName(%u) should fail\n", formats[i]);
120  switch (formats[i])
121  {
122  case NameUnknown:
123  ok(GetLastError() == ERROR_INVALID_PARAMETER, "%u: got %u\n", formats[i], GetLastError());
124  break;
125  default:
131  "%u: got %u\n", formats[i], GetLastError());
132  break;
133  }
134 
135  if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) continue;
136 
137  size = ARRAY_SIZE(nameW);
138  SetLastError(0xdeadbeef);
139  rc = pGetComputerObjectNameW(formats[i], nameW, &size);
140  switch (formats[i])
141  {
142  case NameUnknown:
143  ok(!rc, "GetComputerObjectName(%u) should fail\n", formats[i]);
144  ok(GetLastError() == ERROR_INVALID_PARAMETER, "%u: got %u\n", formats[i], GetLastError());
145  break;
146  default:
147  ok(rc, "GetComputerObjectName(%u) error %u\n", formats[i], GetLastError());
148  trace("GetComputerObjectName(%u) returned %s\n", formats[i], wine_dbgstr_w(nameW));
149  break;
150  }
151  }
152 }
153 
154 static void testGetUserNameExA(void)
155 {
156  char name[256];
157  ULONG size;
158  BOOLEAN rc;
159  UINT i;
160 
161  for (i = 0; i < ARRAY_SIZE(formats); i++) {
162  size = sizeof(name);
163  ZeroMemory(name, sizeof(name));
164  rc = pGetUserNameExA(formats[i], name, &size);
165  ok(rc ||
166  (formats[i] == NameUnknown &&
169  broken(formats[i] == NameDnsDomain &&
171  "GetUserNameExW(%d) failed: %d\n",
172  formats[i], GetLastError());
173  }
174 
175  if (0) /* Crashes on Windows */
176  pGetUserNameExA(NameSamCompatible, NULL, NULL);
177 
178  size = 0;
179  rc = pGetUserNameExA(NameSamCompatible, NULL, &size);
180  ok(! rc && GetLastError() == ERROR_MORE_DATA, "Expected fail with ERROR_MORE_DATA, got %d with %u\n", rc, GetLastError());
181  ok(size != 0, "Expected size to be set to required size\n");
182 
183  if (0) /* Crashes on Windows with big enough size */
184  {
185  /* Returned size is already big enough */
186  pGetUserNameExA(NameSamCompatible, NULL, &size);
187  }
188 
189  size = 0;
190  rc = pGetUserNameExA(NameSamCompatible, name, &size);
191  ok(! rc && GetLastError() == ERROR_MORE_DATA, "Expected fail with ERROR_MORE_DATA, got %d with %u\n", rc, GetLastError());
192  ok(size != 0, "Expected size to be set to required size\n");
193  size = 1;
194  name[0] = 0xff;
195  rc = pGetUserNameExA(NameSamCompatible, name, &size);
196  ok(! rc && GetLastError() == ERROR_MORE_DATA, "Expected fail with ERROR_MORE_DATA, got %d with %u\n", rc, GetLastError());
197  ok(1 < size, "Expected size to be set to required size\n");
198  ok(name[0] == (char) 0xff, "Expected unchanged buffer\n");
199 }
200 
201 static void testGetUserNameExW(void)
202 {
203  WCHAR nameW[256];
204  ULONG size;
205  BOOLEAN rc;
206  UINT i;
207 
208  for (i = 0; i < ARRAY_SIZE(formats); i++) {
209  size = sizeof(nameW);
210  ZeroMemory(nameW, sizeof(nameW));
211  rc = pGetUserNameExW(formats[i], nameW, &size);
212  ok(rc ||
213  (formats[i] == NameUnknown &&
216  broken(formats[i] == NameDnsDomain &&
218  "GetUserNameExW(%d) failed: %d\n",
219  formats[i], GetLastError());
220  }
221 
222  if (0) /* Crashes on Windows */
223  pGetUserNameExW(NameSamCompatible, NULL, NULL);
224 
225  size = 0;
226  rc = pGetUserNameExW(NameSamCompatible, NULL, &size);
227  ok(! rc && GetLastError() == ERROR_MORE_DATA, "Expected fail with ERROR_MORE_DATA, got %d with %u\n", rc, GetLastError());
228  ok(size != 0, "Expected size to be set to required size\n");
229 
230  if (0) /* Crashes on Windows with big enough size */
231  {
232  /* Returned size is already big enough */
233  pGetUserNameExW(NameSamCompatible, NULL, &size);
234  }
235 
236  size = 0;
237  rc = pGetUserNameExW(NameSamCompatible, nameW, &size);
238  ok(! rc && GetLastError() == ERROR_MORE_DATA, "Expected fail with ERROR_MORE_DATA, got %d with %u\n", rc, GetLastError());
239  ok(size != 0, "Expected size to be set to required size\n");
240  size = 1;
241  nameW[0] = 0xff;
242  rc = pGetUserNameExW(NameSamCompatible, nameW, &size);
243  ok(! rc && GetLastError() == ERROR_MORE_DATA, "Expected fail with ERROR_MORE_DATA, got %d with %u\n", rc, GetLastError());
244  ok(1 < size, "Expected size to be set to required size\n");
245  ok(nameW[0] == (WCHAR) 0xff, "Expected unchanged buffer\n");
246 }
247 
248 static void test_InitSecurityInterface(void)
249 {
252 
253  sftA = pInitSecurityInterfaceA();
254  ok(sftA != NULL, "pInitSecurityInterfaceA failed\n");
255  ok(sftA->dwVersion == SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION, "wrong dwVersion %d in security function table\n", sftA->dwVersion);
256  ok(!sftA->Reserved2,
257  "Reserved2 should be NULL instead of %p in security function table\n",
258  sftA->Reserved2);
259  ok(sftA->Reserved3 == sftA->EncryptMessage,
260  "Reserved3 should be equal to EncryptMessage in the security function table\n");
261  ok(sftA->Reserved4 == sftA->DecryptMessage,
262  "Reserved4 should be equal to DecryptMessage in the security function table\n");
263 
264  if (!pInitSecurityInterfaceW)
265  {
266  win_skip("InitSecurityInterfaceW not exported by secur32.dll\n");
267  return;
268  }
269 
270  sftW = pInitSecurityInterfaceW();
271  ok(sftW != NULL, "pInitSecurityInterfaceW failed\n");
272  ok(sftW->dwVersion == SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION, "wrong dwVersion %d in security function table\n", sftW->dwVersion);
273  ok(!sftW->Reserved2, "Reserved2 should be NULL instead of %p in security function table\n", sftW->Reserved2);
274  ok(sftW->Reserved3 == sftW->EncryptMessage, "Reserved3 should be equal to EncryptMessage in the security function table\n");
275  ok(sftW->Reserved4 == sftW->DecryptMessage, "Reserved4 should be equal to DecryptMessage in the security function table\n");
276 }
277 
279 {
280  static const WCHAR username[] = {'u','s','e','r','n','a','m','e',0};
281  static const WCHAR domainname[] = {'d','o','m','a','i','n','n','a','m','e',0};
282  static const WCHAR password[] = {'p','a','s','s','w','o','r','d',0};
283  const WCHAR *username_ptr, *domainname_ptr, *password_ptr;
286 
287  if (!pSspiEncodeStringsAsAuthIdentity)
288  {
289  win_skip( "SspiEncodeAuthIdentityAsStrings not exported by secur32.dll\n" );
290  return;
291  }
292 
293  status = pSspiEncodeStringsAsAuthIdentity( NULL, NULL, NULL, NULL );
294  ok( status == SEC_E_INVALID_TOKEN, "got %08x\n", status );
295 
296  id = (PSEC_WINNT_AUTH_IDENTITY_OPAQUE)0xdeadbeef;
297  status = pSspiEncodeStringsAsAuthIdentity( NULL, NULL, NULL, &id );
298  ok( status == SEC_E_INVALID_TOKEN, "got %08x\n", status );
299  ok( id == (PSEC_WINNT_AUTH_IDENTITY_OPAQUE)0xdeadbeef, "id set\n" );
300 
301  id = NULL;
302  status = pSspiEncodeStringsAsAuthIdentity( NULL, NULL, password, &id );
303  ok( status == SEC_E_OK, "got %08x\n", status );
304  ok( id != NULL, "id not set\n" );
305  pSspiFreeAuthIdentity( id );
306 
307  id = NULL;
308  status = pSspiEncodeStringsAsAuthIdentity( NULL, domainname, password, &id );
309  ok( status == SEC_E_OK, "got %08x\n", status );
310  ok( id != NULL, "id not set\n" );
311  pSspiFreeAuthIdentity( id );
312 
313  id = NULL;
314  status = pSspiEncodeStringsAsAuthIdentity( username, NULL, password, &id );
315  ok( status == SEC_E_OK, "got %08x\n", status );
316  ok( id != NULL, "id not set\n" );
317  pSspiFreeAuthIdentity( id );
318 
319  id = NULL;
320  status = pSspiEncodeStringsAsAuthIdentity( username, NULL, NULL, &id );
321  ok( status == SEC_E_OK, "got %08x\n", status );
322  ok( id != NULL, "id not set\n" );
323  pSspiFreeAuthIdentity( id );
324 
325  id = NULL;
326  status = pSspiEncodeStringsAsAuthIdentity( username, domainname, password, &id );
327  ok( status == SEC_E_OK, "got %08x\n", status );
328  ok( id != NULL, "id not set\n" );
329 
330  username_ptr = domainname_ptr = password_ptr = NULL;
331  status = pSspiEncodeAuthIdentityAsStrings( id, &username_ptr, &domainname_ptr, &password_ptr );
332  ok( status == SEC_E_OK, "got %08x\n", status );
333  ok( !lstrcmpW( username, username_ptr ), "wrong username\n" );
334  ok( !lstrcmpW( domainname, domainname_ptr ), "wrong domainname\n" );
335  ok( !lstrcmpW( password, password_ptr ), "wrong password\n" );
336 
337  pSspiZeroAuthIdentity( id );
338 
339  pSspiLocalFree( (void *)username_ptr );
340  pSspiLocalFree( (void *)domainname_ptr );
341  pSspiLocalFree( (void *)password_ptr );
342  pSspiFreeAuthIdentity( id );
343 
344  id = NULL;
345  status = pSspiEncodeStringsAsAuthIdentity( username, NULL, password, &id );
346  ok( status == SEC_E_OK, "got %08x\n", status );
347  ok( id != NULL, "id not set\n" );
348 
349  username_ptr = password_ptr = NULL;
350  domainname_ptr = (const WCHAR *)0xdeadbeef;
351  status = pSspiEncodeAuthIdentityAsStrings( id, &username_ptr, &domainname_ptr, &password_ptr );
352  ok( status == SEC_E_OK, "got %08x\n", status );
353  ok( !lstrcmpW( username, username_ptr ), "wrong username\n" );
354  ok( domainname_ptr == NULL, "domainname_ptr not cleared\n" );
355  ok( !lstrcmpW( password, password_ptr ), "wrong password\n" );
356 
357  pSspiLocalFree( (void *)username_ptr );
358  pSspiLocalFree( (void *)password_ptr );
359  pSspiFreeAuthIdentity( id );
360 }
361 
363 {
364  static const WCHAR usernameW[] =
365  {'u','s','e','r','n','a','m','e',0};
366  static const WCHAR domainnameW[] =
367  {'d','o','m','a','i','n','n','a','m','e',0};
368  static const WCHAR passwordW[] =
369  {'p','a','s','s','w','o','r','d',0};
370  static const WCHAR targetW[] =
371  {'d','o','m','a','i','n','n','a','m','e','\\','u','s','e','r','n','a','m','e',0};
372  static const WCHAR target2W[] =
373  {'d','o','m','a','i','n','n','a','m','e','2','\\','u','s','e','r','n','a','m','e','2',0};
374  const WCHAR *target, *username;
377  ULONG type, size;
378  UCHAR *blob;
379 
380  if (!pSspiPrepareForCredWrite)
381  {
382  win_skip( "SspiPrepareForCredWrite not exported by secur32.dll\n" );
383  return;
384  }
385 
386  status = pSspiEncodeStringsAsAuthIdentity( usernameW, domainnameW, passwordW, &id );
387  ok( status == SEC_E_OK, "got %08x\n", status );
388 
389  type = size = 0;
390  status = pSspiPrepareForCredWrite( id, NULL, &type, &target, &username, &blob, &size );
391  ok( status == SEC_E_OK, "got %08x\n", status );
392  ok( type == CRED_TYPE_DOMAIN_PASSWORD, "got %u\n", type );
393  ok( !lstrcmpW( target, targetW ), "got %s\n", wine_dbgstr_w(target) );
394  ok( !lstrcmpW( username, targetW ), "got %s\n", wine_dbgstr_w(username) );
395  ok( !memcmp( blob, passwordW, sizeof(passwordW) - sizeof(WCHAR) ), "wrong data\n" );
396  ok( size == sizeof(passwordW) - sizeof(WCHAR), "got %u\n", size );
397  pSspiLocalFree( (void *)target );
398  pSspiLocalFree( (void *)username );
399  pSspiLocalFree( blob );
400 
401  type = size = 0;
402  status = pSspiPrepareForCredWrite( id, target2W, &type, &target, &username, &blob, &size );
403  ok( status == SEC_E_OK, "got %08x\n", status );
404  ok( type == CRED_TYPE_DOMAIN_PASSWORD, "got %u\n", type );
405  ok( !lstrcmpW( target, target2W ), "got %s\n", wine_dbgstr_w(target) );
406  ok( !lstrcmpW( username, targetW ), "got %s\n", wine_dbgstr_w(username) );
407  ok( !memcmp( blob, passwordW, sizeof(passwordW) - sizeof(WCHAR) ), "wrong data\n" );
408  ok( size == sizeof(passwordW) - sizeof(WCHAR), "got %u\n", size );
409  pSspiLocalFree( (void *)target );
410  pSspiLocalFree( (void *)username );
411  pSspiLocalFree( blob );
412 
413  pSspiFreeAuthIdentity( id );
414 }
415 
416 static void test_kerberos(void)
417 {
418  SecPkgInfoA *info;
419  TimeStamp ttl;
420  CredHandle cred;
422 
423  SEC_CHAR provider[] = {'K','e','r','b','e','r','o','s',0};
424 
425  static const ULONG expected_flags =
441  static const ULONG optional_mask =
444 
445  status = QuerySecurityPackageInfoA(provider, &info);
446  ok(status == SEC_E_OK, "Kerberos package not installed, skipping test\n");
447  if(status != SEC_E_OK)
448  return;
449 
450  ok( (info->fCapabilities & ~optional_mask) == expected_flags, "got %08x, expected %08x\n", info->fCapabilities, expected_flags );
451  ok( info->wVersion == 1, "got %u\n", info->wVersion );
452  ok( info->wRPCID == RPC_C_AUTHN_GSS_KERBEROS, "got %u\n", info->wRPCID );
453  ok( info->cbMaxToken >= 12000, "got %u\n", info->cbMaxToken );
454  ok( !lstrcmpA( info->Name, "Kerberos" ), "got %s\n", info->Name );
455  ok( !lstrcmpA( info->Comment, "Microsoft Kerberos V1.0" ), "got %s\n", info->Comment );
457 
459  NULL, NULL, NULL, &cred, &ttl );
460  todo_wine ok( status == SEC_E_OK, "AcquireCredentialsHandleA returned %08x\n", status );
461  if(status == SEC_E_OK)
462  FreeCredentialHandle( &cred );
463 }
464 
465 START_TEST(secur32)
466 {
467  secdll = LoadLibraryA("secur32.dll");
468 
469  if (!secdll)
470  secdll = LoadLibraryA("security.dll");
471 
472  if (secdll)
473  {
474  pSspiEncodeAuthIdentityAsStrings = (void *)GetProcAddress(secdll, "SspiEncodeAuthIdentityAsStrings");
475  pSspiEncodeStringsAsAuthIdentity = (void *)GetProcAddress(secdll, "SspiEncodeStringsAsAuthIdentity");
476  pSspiFreeAuthIdentity = (void *)GetProcAddress(secdll, "SspiFreeAuthIdentity");
477  pSspiLocalFree = (void *)GetProcAddress(secdll, "SspiLocalFree");
478  pSspiPrepareForCredWrite = (void *)GetProcAddress(secdll, "SspiPrepareForCredWrite");
479  pSspiZeroAuthIdentity = (void *)GetProcAddress(secdll, "SspiZeroAuthIdentity");
480  pGetComputerObjectNameA = (PVOID)GetProcAddress(secdll, "GetComputerObjectNameA");
481  pGetComputerObjectNameW = (PVOID)GetProcAddress(secdll, "GetComputerObjectNameW");
482  pGetUserNameExA = (PVOID)GetProcAddress(secdll, "GetUserNameExA");
483  pGetUserNameExW = (PVOID)GetProcAddress(secdll, "GetUserNameExW");
484  pInitSecurityInterfaceA = (PVOID)GetProcAddress(secdll, "InitSecurityInterfaceA");
485  pInitSecurityInterfaceW = (PVOID)GetProcAddress(secdll, "InitSecurityInterfaceW");
486 
487  if (pGetComputerObjectNameA)
489  else
490  win_skip("GetComputerObjectNameA not exported by secur32.dll\n");
491 
492  if (pGetComputerObjectNameW)
494  else
495  win_skip("GetComputerObjectNameW not exported by secur32.dll\n");
496 
497  if (pGetUserNameExA)
499  else
500  win_skip("GetUserNameExA not exported by secur32.dll\n");
501 
502  if (pGetUserNameExW)
504  else
505  win_skip("GetUserNameExW not exported by secur32.dll\n");
506 
510 
512  }
513 
514  test_kerberos();
515 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
DECRYPT_MESSAGE_FN DecryptMessage
Definition: sspi.h:967
#define ERROR_NO_SUCH_USER
Definition: winerror.h:799
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define trace(...)
Definition: kmt_test.h:217
#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION
Definition: sspi.h:1009
#define WSAHOST_NOT_FOUND
Definition: winerror.h:2000
#define SECPKG_CRED_OUTBOUND
Definition: sspi.h:277
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define ERROR_CANT_ACCESS_DOMAIN_INFO
Definition: winerror.h:832
Definition: image.c:133
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
Definition: sspi.c:699
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
unsigned char * PUCHAR
Definition: retypes.h:3
#define ERROR_NONE_MAPPED
Definition: winerror.h:814
#define SECPKG_FLAG_RESTRICTED_TOKENS
Definition: sspi.h:132
DECRYPT_MESSAGE_FN DecryptMessage
Definition: sspi.h:1002
#define wine_dbgstr_w
Definition: kernel32.h:34
static PCWSTR PCWSTR PCWSTR *static PCWSTR
Definition: secur32.c:40
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1635
void * PSEC_WINNT_AUTH_IDENTITY_OPAQUE
Definition: sspi.h:83
static EXTENDED_NAME_FORMAT formats[]
Definition: secur32.c:57
#define SECPKG_FLAG_IMPERSONATION
Definition: sspi.h:121
char * LPSTR
Definition: xmlstorage.h:182
static BOOLEAN(WINAPI *pGetComputerObjectNameA)(EXTENDED_NAME_FORMAT NameFormat
ENCRYPT_MESSAGE_FN EncryptMessage
Definition: sspi.h:1001
static PCWSTR PCWSTR PCWSTR *static PSEC_WINNT_AUTH_IDENTITY_OPAQUE *static void(SEC_ENTRY *pSspiFreeAuthIdentity)(PSEC_WINNT_AUTH_IDENTITY_OPAQUE)
#define SECPKG_FLAG_INTEGRITY
Definition: sspi.h:113
START_TEST(secur32)
Definition: secur32.c:465
#define SECPKG_FLAG_READONLY_WITH_CHECKSUM
Definition: sspi.h:131
struct _test_info info[]
Definition: SetCursorPos.c:19
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static void test_SspiPrepareForCredWrite(void)
Definition: secur32.c:362
static void testGetUserNameExA(void)
Definition: secur32.c:154
static LPSTR PULONG lpnSize
Definition: secur32.c:50
static void testGetComputerObjectNameA(void)
Definition: secur32.c:63
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define ok(value,...)
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
void * PVOID
Definition: retypes.h:9
ENCRYPT_MESSAGE_FN EncryptMessage
Definition: sspi.h:966
static void testGetComputerObjectNameW(void)
Definition: secur32.c:108
LONG SECURITY_STATUS
Definition: sspi.h:34
#define CRED_TYPE_DOMAIN_PASSWORD
Definition: wincred.h:205
#define SEC_ENTRY
Definition: stubs.c:6
static const WCHAR nameW[]
Definition: main.c:46
static WCHAR username[]
Definition: url.c:32
static LPSTR lpNameBuffer
Definition: secur32.c:50
static void test_SspiEncodeStringsAsAuthIdentity(void)
Definition: secur32.c:278
#define SECPKG_FLAG_MULTI_REQUIRED
Definition: sspi.h:118
#define FreeLibrary(x)
Definition: compat.h:405
GLsizeiptr size
Definition: glext.h:5919
#define FreeCredentialHandle
Definition: sspi.h:299
#define RPC_C_AUTHN_GSS_KERBEROS
Definition: rpcdce.h:160
__wchar_t WCHAR
Definition: xmlstorage.h:180
SECURITY_STATUS WINAPI AcquireCredentialsHandleA(SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
Definition: wrapper.c:59
#define SECPKG_FLAG_DATAGRAM
Definition: sspi.h:116
#define WINAPI
Definition: msvc.h:8
#define SECPKG_FLAG_NEGOTIABLE
Definition: sspi.h:124
#define SetLastError(x)
Definition: compat.h:409
unsigned char UCHAR
Definition: xmlstorage.h:181
#define todo_wine
Definition: test.h:154
T1_FIELD_DICT_PRIVATE password
Definition: t1tokens.h:64
#define SECPKG_FLAG_LOGON
Definition: sspi.h:126
#define SEC_E_INVALID_TOKEN
Definition: winerror.h:2917
static PSecurityFunctionTableW(SEC_ENTRY *pInitSecurityInterfaceW)(void)
#define SECPKG_FLAG_DELEGATION
Definition: sspi.h:130
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define SEC_E_OK
Definition: winerror.h:2356
#define broken(x)
Definition: _sntprintf.h:21
#define SECPKG_FLAG_ACCEPT_WIN32_NAME
Definition: sspi.h:122
static void test_InitSecurityInterface(void)
Definition: secur32.c:248
static PULONG
Definition: secur32.c:46
#define SECPKG_FLAG_PRIVACY
Definition: sspi.h:114
#define SECPKG_FLAG_TOKEN_ONLY
Definition: sspi.h:115
SECURITY_STATUS WINAPI QuerySecurityPackageInfoA(SEC_CHAR *pszPackageName, PSecPkgInfoA *ppPackageInfo)
Definition: wrapper.c:683
#define SECPKG_FLAG_EXTENDED_ERROR
Definition: sspi.h:120
#define ARRAY_SIZE(a)
Definition: main.h:24
static PSecurityFunctionTableA(SEC_ENTRY *pInitSecurityInterfaceA)(void)
static void testGetUserNameExW(void)
Definition: secur32.c:201
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
CHAR SEC_CHAR
Definition: sspi.h:30
#define SECPKG_FLAG_APPCONTAINER_CHECKS
Definition: sspi.h:136
static SECURITY_STATUS(SEC_ENTRY *pSspiEncodeAuthIdentityAsStrings)(PSEC_WINNT_AUTH_IDENTITY_OPAQUE
Definition: name.c:36
static void test_kerberos(void)
Definition: secur32.c:416
unsigned int ULONG
Definition: retypes.h:1
GLenum GLuint id
Definition: glext.h:5579
GLenum target
Definition: glext.h:7315
static HMODULE secdll
Definition: secur32.c:35
#define GetProcAddress(x, y)
Definition: compat.h:410
#define SECPKG_FLAG_CONNECTION
Definition: sspi.h:117
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define SECPKG_FLAG_MUTUAL_AUTH
Definition: sspi.h:129
static SERVICE_STATUS status
Definition: service.c:31
#define win_skip
Definition: test.h:141
#define SECPKG_FLAG_GSS_COMPATIBLE
Definition: sspi.h:125
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
Definition: ps.c:97
GLuint const GLchar * name
Definition: glext.h:6031