30 #include <wine/unicode.h> 35 #define NTLM_MAX_BUF 1904 36 #define MIN_NTLM_AUTH_MAJOR_VERSION 3 37 #define MIN_NTLM_AUTH_MINOR_VERSION 0 39 #define MIN_NTLM_AUTH_MICRO_VERSION 25 41 #define MIN_NTLM_AUTH_MICRO_VERSION 23 54 TRACE(
"(%p, %d, %p)\n", phCredential, ulAttribute,
pBuffer);
58 FIXME(
"SECPKG_CRED_ATTR_NAMES: stub\n");
75 TRACE(
"(%p, %d, %p)\n", phCredential, ulAttribute,
pBuffer);
79 FIXME(
"SECPKG_CRED_ATTR_NAMES: stub\n");
90 static const char username_arg[] =
"--username=";
95 userW, userW_length,
NULL, 0,
NULL,
NULL) +
sizeof(username_arg);
98 memcpy(
user, username_arg,
sizeof(username_arg) - 1);
100 user +
sizeof(username_arg) - 1,
101 unixcp_size -
sizeof(username_arg) + 1,
NULL,
NULL);
102 user[unixcp_size - 1] =
'\0';
108 static const char domain_arg[] =
"--domain=";
113 domainW, domainW_length,
NULL, 0,
NULL,
NULL) +
sizeof(domain_arg);
118 domainW_length,
domain +
sizeof(domain_arg) - 1,
120 domain[unixcp_size - 1] =
'\0';
137 TRACE(
"(%s, %s, 0x%08x, %p, %p, %p, %p, %p, %p)\n",
139 pLogonID, pAuthData, pGetKeyFn, pGetKeyArgument, phCredential, ptsExpiry);
141 switch(fCredentialUse)
153 ntlm_cred->
pwlen = 0;
156 phCredential->
dwUpper = fCredentialUse;
163 auth_data = pAuthData;
174 ntlm_cred->
pwlen = 0;
177 if(pAuthData !=
NULL)
179 int domain_len = 0, user_len = 0, password_len = 0;
243 if(password_len != 0)
261 phCredential->
dwUpper = fCredentialUse;
263 TRACE(
"ACH phCredential->dwUpper: 0x%08lx, dwLower: 0x%08lx\n",
269 FIXME(
"AcquireCredentialsHandle: SECPKG_CRED_BOTH stub\n");
296 int user_sizeW, domain_sizeW, passwd_sizeW;
303 TRACE(
"(%s, %s, 0x%08x, %p, %p, %p, %p, %p, %p)\n",
305 pLogonID, pAuthData, pGetKeyFn, pGetKeyArgument, phCredential, ptsExpiry);
307 if(pszPackage !=
NULL)
312 package = HeapAlloc(GetProcessHeap(), 0, package_sizeW *
318 if(pAuthData !=
NULL)
363 identity->PasswordLength, passwd, passwd_sizeW);
371 pAuthDataW->User =
user;
372 pAuthDataW->UserLength = user_sizeW;
373 pAuthDataW->Domain =
domain;
374 pAuthDataW->DomainLength = domain_sizeW;
375 pAuthDataW->Password = passwd;
376 pAuthDataW->PasswordLength = passwd_sizeW;
385 pLogonID, pAuthDataW, pGetKeyFn, pGetKeyArgument, phCredential,
407 TRACE(
"%p\n", pMessage);
427 TRACE(
"%p\n", pMessage);
449 pszHost =
strchrW(pszTargetName,
'/');
464 pszHost = pszTargetName;
472 memcpy(pszHostOnly, pszHost, (
p - pszHost) *
sizeof(
WCHAR));
473 pszHostOnly[
p - pszHost] =
'\0';
502 TRACE(
"%p %p %s 0x%08x %d %d %p %d %p %p %p %p\n", phCredential, phContext,
504 Reserved1, phNewContext, pOutput, pfContextAttr, ptsExpiry);
521 TRACE(
"Setting SECURITY_NETWORK_DREP\n");
527 if((phContext ==
NULL) && (pInput ==
NULL))
529 static char helper_protocol[] =
"--helper-protocol=ntlmssp-client-1";
530 static CHAR credentials_argv[] =
"--use-cached-creds";
534 TRACE(
"First time in ISC()\n");
548 TRACE(
"Cred mode = %d\n", ntlm_cred->
mode);
554 client_argv[1] = helper_protocol;
597 client_argv[4] =
NULL;
610 TRACE(
"using cached credentials\n");
613 client_argv[3] = credentials_argv;
614 client_argv[4] =
NULL;
621 client_argv[4] =
NULL;
642 TRACE(
"Converting password to unicode.\n");
650 password ? pwlen : ntlm_cred->
pwlen, unicode_password, passwd_lenW);
665 if(want_flags ==
NULL)
674 if(
strstr(want_flags,
"NTLMSSP_FEATURE_SEAL") ==
NULL)
675 lstrcatA(want_flags,
" NTLMSSP_FEATURE_SEAL");
683 if(
strstr(want_flags,
"NTLMSSP_FEATURE_SIGN") ==
NULL)
684 lstrcatA(want_flags,
" NTLMSSP_FEATURE_SIGN");
690 if(
strstr(want_flags,
"NTLMSSP_FEATURE_SIGN") ==
NULL)
691 lstrcatA(want_flags,
" NTLMSSP_FEATURE_SIGN");
695 if(
strstr(want_flags,
"NTLMSSP_FEATURE_SIGN") ==
NULL)
696 lstrcatA(want_flags,
" NTLMSSP_FEATURE_SIGN");
699 FIXME(
"ISC_REQ_STREAM\n");
718 TRACE(
"Using cached credentials failed.\n");
729 max_len-3, &buffer_len)) !=
SEC_E_OK)
757 ERR(
"Helper doesn't understand new command set. Expect more things to fail.\n");
787 phNewContext->
dwUpper = ctxt_attr;
816 TRACE(
"Helper mode = %d\n", helper->
mode);
821 if (!pInput->pBuffers[input_token_idx].pvBuffer)
827 if(pInput->pBuffers[input_token_idx].cbBuffer > max_len)
829 TRACE(
"pInput->pBuffers[%d].cbBuffer is: %d\n",
831 pInput->pBuffers[input_token_idx].cbBuffer);
836 bin_len = pInput->pBuffers[input_token_idx].cbBuffer;
838 memcpy(
bin, pInput->pBuffers[input_token_idx].pvBuffer, bin_len);
843 max_len-3, &buffer_len)) !=
SEC_E_OK)
869 phNewContext->
dwUpper = ctxt_attr;
879 TRACE(
"no SECBUFFER_TOKEN buffer could be found\n");
881 if ((phContext ==
NULL) && (pInput ==
NULL))
893 pOutput->pBuffers[token_idx].cbBuffer = bin_len;
895 else if (pOutput->pBuffers[token_idx].cbBuffer < bin_len)
897 TRACE(
"out buffer is NULL or has not enough space\n");
899 if ((phContext ==
NULL) && (pInput ==
NULL))
908 if (!pOutput->pBuffers[token_idx].pvBuffer)
910 TRACE(
"out buffer is NULL\n");
912 if ((phContext ==
NULL) && (pInput ==
NULL))
921 pOutput->pBuffers[token_idx].cbBuffer = bin_len;
922 memcpy(pOutput->pBuffers[token_idx].pvBuffer,
bin, bin_len);
926 TRACE(
"Getting negotiated flags\n");
933 TRACE(
"No flags negotiated.\n");
943 TRACE(
"Getting session key\n");
949 TRACE(
"No key negotiated.\n");
955 TRACE(
"Failed to decode session key\n");
970 helper->
crypt.ntlm.seq_num = 0
l;
975 helper->
crypt.ntlm2.send_seal_key, 16);
977 helper->
crypt.ntlm2.recv_seal_key, 16);
978 helper->
crypt.ntlm2.send_seq_no = 0
l;
979 helper->
crypt.ntlm2.recv_seq_no = 0
l;
1004 TRACE(
"%p %p %s %d %d %d %p %d %p %p %p %p\n", phCredential, phContext,
1006 Reserved1, phNewContext, pOutput, pfContextAttr, ptsExpiry);
1008 if(pszTargetName !=
NULL)
1020 phNewContext, pOutput, pfContextAttr, ptsExpiry);
1038 ULONG ctxt_attr = 0;
1042 TRACE(
"%p %p %p %d %d %p %p %p %p\n", phCredential, phContext, pInput,
1043 fContextReq, TargetDataRep, phNewContext, pOutput, pfContextAttr,
1050 TRACE(
"Using SECURITY_NETWORK_DREP\n");
1053 if(phContext ==
NULL)
1055 static CHAR server_helper_protocol[] =
"--helper-protocol=squid-2.5-ntlmssp";
1057 server_helper_protocol,
1087 if(pInput->pBuffers[0].cbBuffer > max_len)
1093 bin_len = pInput->pBuffers[0].cbBuffer;
1105 if(want_flags ==
NULL)
1107 TRACE(
"Failed to allocate memory for the want_flags!\n");
1115 FIXME(
"ASC_REQ_ALLOCATE_MEMORY stub\n");
1119 lstrcatA(want_flags,
" NTLMSSP_FEATURE_SEAL");
1124 lstrcatA(want_flags,
" NTLMSSP_FEATURE_SESSION_KEY");
1129 FIXME(
"ASC_REQ_EXTENDED_ERROR stub\n");
1133 lstrcatA(want_flags,
" NTLMSSP_FEATURE_SIGN");
1137 FIXME(
"ASC_REQ_MUTUAL_AUTH stub\n");
1141 FIXME(
"ASC_REQ_REPLAY_DETECT stub\n");
1145 FIXME(
"ASC_REQ_SEQUENCE_DETECT stub\n");
1149 FIXME(
"ASC_REQ_STREAM stub\n");
1164 TRACE(
"Helper doesn't understand new command set\n");
1169 memcpy(
bin, pInput->pBuffers[0].pvBuffer, bin_len);
1221 pOutput->pBuffers[0].cbBuffer = bin_len;
1223 memcpy(pOutput->pBuffers[0].pvBuffer,
bin, bin_len);
1250 if(pInput->pBuffers[0].cbBuffer > max_len)
1256 bin_len = pInput->pBuffers[0].cbBuffer;
1258 memcpy(
bin, pInput->pBuffers[0].pvBuffer, bin_len);
1291 size_t ntlm_pipe_err_v3_len =
strlen(
"BH NT_STATUS_ACCESS_DENIED");
1292 size_t ntlm_pipe_err_v4_len =
strlen(
"BH NT_STATUS_UNSUCCESSFUL");
1294 if( (buffer_len >= ntlm_pipe_err_v3_len &&
1295 strncmp(
buffer,
"BH NT_STATUS_ACCESS_DENIED", ntlm_pipe_err_v3_len) == 0) ||
1296 (buffer_len >= ntlm_pipe_err_v4_len &&
1297 strncmp(
buffer,
"BH NT_STATUS_UNSUCCESSFUL", ntlm_pipe_err_v4_len) == 0) )
1299 TRACE(
"Connection to winbindd failed\n");
1308 pOutput->pBuffers[0].cbBuffer = 0;
1310 TRACE(
"Getting negotiated flags\n");
1317 TRACE(
"No flags negotiated, or helper does not support GF command\n");
1326 TRACE(
"Getting session key\n");
1332 TRACE(
"Helper does not support GK command\n");
1353 TRACE(
"Failed to decode session key\n");
1368 helper->
crypt.ntlm.seq_num = 0
l;
1371 phNewContext->
dwUpper = ctxt_attr;
1388 TRACE(
"%p %p\n", phContext, pToken);
1402 TRACE(
"%p\n", phContext);
1436 #define _x(x) case (x) : FIXME(#x" stub\n"); break 1473 TRACE(
"Unknown value %d passed for ulAttribute\n", ulAttribute);
1495 TRACE(
"%p\n", phContext);
1514 TRACE(
"%p\n", phContext);
1539 ULONG sign_version = 1;
1542 TRACE(
"%p, %p, %d, %d, %d\n", helper, pMessage, token_idx, direction,
1545 sig = pMessage->pBuffers[token_idx].pvBuffer;
1554 TRACE(
"Signing NTLM2 style\n");
1558 seq_no[0] = (helper->
crypt.ntlm2.send_seq_no >> 0) & 0xff;
1559 seq_no[1] = (helper->
crypt.ntlm2.send_seq_no >> 8) & 0xff;
1560 seq_no[2] = (helper->
crypt.ntlm2.send_seq_no >> 16) & 0xff;
1561 seq_no[3] = (helper->
crypt.ntlm2.send_seq_no >> 24) & 0xff;
1563 ++(helper->
crypt.ntlm2.send_seq_no);
1569 seq_no[0] = (helper->
crypt.ntlm2.recv_seq_no >> 0) & 0xff;
1570 seq_no[1] = (helper->
crypt.ntlm2.recv_seq_no >> 8) & 0xff;
1571 seq_no[2] = (helper->
crypt.ntlm2.recv_seq_no >> 16) & 0xff;
1572 seq_no[3] = (helper->
crypt.ntlm2.recv_seq_no >> 24) & 0xff;
1574 ++(helper->
crypt.ntlm2.recv_seq_no);
1584 pMessage->pBuffers[
i].cbBuffer);
1598 sig[ 0] = (sign_version >> 0) & 0xff;
1599 sig[ 1] = (sign_version >> 8) & 0xff;
1600 sig[ 2] = (sign_version >> 16) & 0xff;
1601 sig[ 3] = (sign_version >> 24) & 0xff;
1603 memcpy(sig+4, digest, 8);
1605 memcpy(sig+12, seq_no, 4);
1607 pMessage->pBuffers[token_idx].cbBuffer = 16;
1614 TRACE(
"Signing NTLM1 style\n");
1621 pMessage->pBuffers[
i].cbBuffer, crc);
1625 sig[ 0] = (sign_version >> 0) & 0xff;
1626 sig[ 1] = (sign_version >> 8) & 0xff;
1627 sig[ 2] = (sign_version >> 16) & 0xff;
1628 sig[ 3] = (sign_version >> 24) & 0xff;
1630 sig[ 8] = (crc >> 0) & 0xff;
1631 sig[ 9] = (crc >> 8) & 0xff;
1632 sig[10] = (crc >> 16) & 0xff;
1633 sig[11] = (crc >> 24) & 0xff;
1634 sig[12] = (helper->
crypt.ntlm.seq_num >> 0) & 0xff;
1635 sig[13] = (helper->
crypt.ntlm.seq_num >> 8) & 0xff;
1636 sig[14] = (helper->
crypt.ntlm.seq_num >> 16) & 0xff;
1637 sig[15] = (helper->
crypt.ntlm.seq_num >> 24) & 0xff;
1639 ++(helper->
crypt.ntlm.seq_num);
1648 TRACE(
"Creating a dummy signature.\n");
1650 memset(pMessage->pBuffers[token_idx].pvBuffer, 0, 16);
1651 memset(pMessage->pBuffers[token_idx].pvBuffer, 0x01, 1);
1652 pMessage->pBuffers[token_idx].cbBuffer = 16;
1668 TRACE(
"%p %d %p %d\n", phContext, fQOP, pMessage, MessageSeqNo);
1673 FIXME(
"Ignoring fQOP 0x%08x\n", fQOP);
1676 FIXME(
"Ignoring MessageSeqNo\n");
1678 if(!pMessage || !pMessage->pBuffers || pMessage->
cBuffers < 2)
1685 if(pMessage->pBuffers[token_idx].cbBuffer < 16)
1708 TRACE(
"%p %p %d %p\n", phContext, pMessage, MessageSeqNo, pfQOP);
1712 if(!pMessage || !pMessage->pBuffers || pMessage->
cBuffers < 2)
1718 if(pMessage->pBuffers[token_idx].cbBuffer < 16)
1722 FIXME(
"Ignoring MessageSeqNo\n");
1731 local_desc.pBuffers = local_buff;
1738 local_buff[
i].cbBuffer = 16;
1739 local_buff[
i].pvBuffer = local_sig;
1743 local_buff[
i].BufferType = pMessage->pBuffers[
i].BufferType;
1744 local_buff[
i].cbBuffer = pMessage->pBuffers[
i].cbBuffer;
1745 local_buff[
i].pvBuffer = pMessage->pBuffers[
i].pvBuffer;
1752 if(
memcmp(((
PBYTE)local_buff[token_idx].pvBuffer) + 8,
1753 ((
PBYTE)pMessage->pBuffers[token_idx].pvBuffer) + 8, 8))
1796 int token_idx, data_idx;
1798 TRACE(
"(%p %d %p %d)\n", phContext, fQOP, pMessage, MessageSeqNo);
1804 FIXME(
"Ignoring fQOP\n");
1807 FIXME(
"Ignoring MessageSeqNo\n");
1809 if(!pMessage || !pMessage->pBuffers || pMessage->
cBuffers < 2)
1818 if(pMessage->pBuffers[token_idx].cbBuffer < 16)
1828 pMessage->pBuffers[data_idx].pvBuffer,
1829 pMessage->pBuffers[data_idx].cbBuffer);
1833 ((
BYTE *)pMessage->pBuffers[token_idx].pvBuffer)+4, 8);
1847 sig = pMessage->pBuffers[token_idx].pvBuffer;
1850 pMessage->pBuffers[data_idx].pvBuffer,
1851 pMessage->pBuffers[data_idx].cbBuffer);
1867 ULONG ntlmssp_flags_save;
1869 int token_idx, data_idx;
1870 TRACE(
"(%p %p %d %p)\n", phContext, pMessage, MessageSeqNo, pfQOP);
1876 FIXME(
"Ignoring MessageSeqNo\n");
1878 if(!pMessage || !pMessage->pBuffers || pMessage->
cBuffers < 2)
1887 if(pMessage->pBuffers[token_idx].cbBuffer < 16)
1895 pMessage->pBuffers[data_idx].pvBuffer,
1896 pMessage->pBuffers[data_idx].cbBuffer);
1901 pMessage->pBuffers[data_idx].pvBuffer,
1902 pMessage->pBuffers[data_idx].cbBuffer);
1979 #define NTLM_COMMENT \ 1980 { 'N', 'T', 'L', 'M', ' ', \ 1981 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ', \ 1982 'P', 'a', 'c', 'k', 'a', 'g', 'e', 0} 1987 #define NTLM_NAME {'N', 'T', 'L', 'M', 0} 1994 SECPKG_FLAG_INTEGRITY | \ 1995 SECPKG_FLAG_PRIVACY | \ 1996 SECPKG_FLAG_TOKEN_ONLY | \ 1997 SECPKG_FLAG_CONNECTION | \ 1998 SECPKG_FLAG_MULTI_REQUIRED | \ 1999 SECPKG_FLAG_IMPERSONATION | \ 2000 SECPKG_FLAG_ACCEPT_WIN32_NAME | \ 2001 SECPKG_FLAG_NEGOTIABLE | \ 2002 SECPKG_FLAG_LOGON | \ 2003 SECPKG_FLAG_RESTRICTED_TOKENS ) 2054 ERR_(winediag)(
"%s was not found or is outdated. " 2055 "Make sure that ntlm_auth >= %d.%d.%d is in your path. " 2056 "Usually, you can find it in the winbind package of your distribution.\n",
#define ISC_REQ_SEQUENCE_DETECT
#define SEC_E_INTERNAL_ERROR
#define SECPKG_ATTR_NATIVE_NAMES
#define ASC_REQ_REPLAY_DETECT
#define RPC_C_AUTHN_WINNT
#define ASC_RET_CONNECTION
#define SECPKG_ATTR_KEY_INFO
void SECUR32_addPackages(SecureProvider *provider, ULONG toAdd, const SecPkgInfoA *infoA, const SecPkgInfoW *infoW) DECLSPEC_HIDDEN
#define SECPKG_ATTR_DCE_INFO
#define SECPKG_ATTR_PACKAGE_INFO
static SECURITY_STATUS SEC_ENTRY ntlm_ImpersonateSecurityContext(PCtxtHandle phContext)
#define SECPKG_CRED_OUTBOUND
arc4_info * SECUR32_arc4Alloc(void)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
void SECUR32_initNTLMSP(void)
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
#define SECPKG_ATTR_PASSWORD_EXPIRY
#define WideCharToMultiByte
struct _NegoHelper * PNegoHelper
static SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleA(SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialUse, PLUID pLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
SecPkgInfoW * ntlm_package_infoW
struct _NegoHelper::@534 crypt
#define ISC_REQ_EXTENDED_ERROR
SecPkgInfoA * ntlm_package_infoA
ACPI_SIZE strlen(const char *String)
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
#define ISC_RET_CONFIDENTIALITY
unsigned short * Password
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
char * strstr(char *String1, char *String2)
static BOOL check_version(LPCWSTR gre_path, const char *version_string)
static int ntlm_GetTokenBufferIndex(PSecBufferDesc pMessage)
void HMACMD5Init(HMAC_MD5_CTX *ctx, const unsigned char *key, unsigned int key_len)
static SECURITY_STATUS SEC_ENTRY ntlm_QueryCredentialsAttributesW(PCredHandle phCredential, ULONG ulAttribute, PVOID pBuffer)
SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
SECURITY_STATUS encodeBase64(PBYTE in_buf, int in_len, char *out_buf, int max_len, int *out_len)
#define ASC_REQ_CONNECTION
static WCHAR ntlm_comment_W[]
#define SEC_E_MESSAGE_ALTERED
SECURITY_STATUS SEC_ENTRY ntlm_AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry)
static PSecPkgInfoA *static SEC_CHAR SEC_GET_KEY_FN
void cleanup_helper(PNegoHelper helper)
#define ASC_REQ_ALLOCATE_MEMORY
WINE_DECLARE_DEBUG_CHANNEL(winediag)
ULONG ComputeCrc32(const BYTE *pData, INT iLen, ULONG initial_crc)
#define SEC_E_UNSUPPORTED_FUNCTION
#define SECPKG_ATTR_ACCESS_TOKEN
SecureProvider * SECUR32_addProvider(const SecurityFunctionTableA *fnTableA, const SecurityFunctionTableW *fnTableW, PCWSTR moduleName) DECLSPEC_HIDDEN
SECURITY_STATUS SEC_ENTRY ntlm_MakeSignature(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
static const SecPkgInfoA infoA
WINE_DEFAULT_DEBUG_CHANNEL(ntlm)
struct _SecPkgContext_Sizes * PSecPkgContext_Sizes
#define SEC_E_LOGON_DENIED
SECURITY_STATUS SECUR32_CreateNTLM2SubKeys(PNegoHelper helper) DECLSPEC_HIDDEN
static int ntlm_GetDataBufferIndex(PSecBufferDesc pMessage)
#define ISC_RET_CONNECTION
#define SECPKG_ATTR_SIZES
#define SEC_E_INSUFFICIENT_MEMORY
SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
static WCHAR ntlm_name_W[]
#define SECPKG_CRED_INBOUND
static char * ntlm_GetUsernameArg(LPCWSTR userW, INT userW_length)
static char * ntlm_GetDomainArg(LPCWSTR domainW, INT domainW_length)
struct _NtlmCredentials * PNtlmCredentials
static const WCHAR version[]
#define SECPKG_ATTR_NEGOTIATION_INFO
static char ntlm_name_A[]
SECURITY_STATUS decodeBase64(char *in_buf, int in_len, PBYTE out_buf, int max_len, int *out_len)
#define SEC_I_CONTINUE_NEEDED
#define NTLMSSP_NEGOTIATE_SEAL
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
static BOOL ntlm_GetCachedCredential(const SEC_WCHAR *pszTargetName, PCREDENTIALW *cred)
#define MIN_NTLM_AUTH_MICRO_VERSION
#define MIN_NTLM_AUTH_MAJOR_VERSION
#define CRED_TYPE_DOMAIN_PASSWORD
#define ISC_REQ_INTEGRITY
#define ASC_REQ_EXTENDED_ERROR
NET_API_STATUS WINAPI NetWkstaUserGetInfo(LMSTR reserved, DWORD level, PBYTE *bufptr)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
static SECURITY_STATUS SEC_ENTRY ntlm_QueryCredentialsAttributesA(PCredHandle phCredential, ULONG ulAttribute, PVOID pBuffer)
#define SECPKG_ATTR_LIFESPAN
#define SECPKG_ATTR_AUTHORITY
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
VOID WINAPI CredFree(PVOID Buffer)
PVOID *typedef PSecBuffer
#define ISC_RET_EXTENDED_ERROR
#define ASC_REQ_CONFIDENTIALITY
#define SEC_WINNT_AUTH_IDENTITY_UNICODE
SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN
void SECUR32_arc4Process(arc4_info *a4i, BYTE *inoutString, unsigned int length)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
#define WC_NO_BEST_FIT_CHARS
#define SECPKG_ATTR_STREAM_SIZES
#define ISC_RET_MUTUAL_AUTH
void HMACMD5Final(HMAC_MD5_CTX *ctx, unsigned char *digest)
#define SEC_E_INVALID_HANDLE
SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
static CHAR ntlm_comment_A[]
#define ISC_REQ_ALLOCATE_MEMORY
#define MIN_NTLM_AUTH_MINOR_VERSION
T1_FIELD_DICT_PRIVATE password
struct _SecPkgContext_Flags * PSecPkgContext_Flags
#define SEC_E_INVALID_TOKEN
SECURITY_STATUS SEC_ENTRY ntlm_DeleteSecurityContext(PCtxtHandle phContext)
#define memcpy(s1, s2, n)
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)
#define ASC_REQ_INTEGRITY
#define ISC_REQ_USE_DCE_STYLE
#define SECURITY_NETWORK_DREP
SECURITY_STATUS SEC_ENTRY ntlm_VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
struct _SEC_WINNT_AUTH_IDENTITY_W * PSEC_WINNT_AUTH_IDENTITY_W
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)
#define SEC_WINNT_AUTH_IDENTITY_ANSI
#define ISC_REQ_CONNECTION
#define SECPKG_ATTR_NAMES
int WINAPI lstrlenA(LPCSTR lpString)
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
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
static const SecPkgInfoW infoW
#define SECBUFFER_VERSION
BOOL WINAPI CredReadW(LPCWSTR TargetName, DWORD Type, DWORD Flags, PCREDENTIALW *Credential)
static SECURITY_STATUS SEC_ENTRY ntlm_CompleteAuthToken(PCtxtHandle phContext, PSecBufferDesc pToken)
#define SECPKG_ATTR_FLAGS
SECURITY_STATUS SECUR32_CreateNTLM1SessionKey(PBYTE password, int len, PBYTE session_key) DECLSPEC_HIDDEN
#define ASC_REQ_MUTUAL_AUTH
void SECUR32_arc4Cleanup(arc4_info *a4i)
SECURITY_STATUS run_helper(PNegoHelper helper, char *buffer, unsigned int max_buflen, int *buflen)
#define ISC_RET_USED_DCE_STYLE
#define NTLMSSP_NEGOTIATE_KEY_EXCHANGE
#define NTLMSSP_NEGOTIATE_NTLM2
static SECURITY_STATUS SEC_ENTRY ntlm_RevertSecurityContext(PCtxtHandle phContext)
#define ISC_REQ_MUTUAL_AUTH
static const SecurityFunctionTableA ntlmTableA
#define SEC_E_BUFFER_TOO_SMALL
#define MultiByteToWideChar
static SECURITY_STATUS ntlm_CreateSignature(PNegoHelper helper, PSecBufferDesc pMessage, int token_idx, SignDirection direction, BOOL encrypt_sig)
static struct _PeImage bin
int no_cached_credentials
#define SECPKG_ATTR_TARGET_INFORMATION
#define NTLMSSP_NEGOTIATE_SIGN
enum _sign_direction SignDirection
void HMACMD5Update(HMAC_MD5_CTX *ctx, const unsigned char *data, unsigned int data_len)
#define ISC_REQ_CONFIDENTIALITY
#define SEC_E_NO_CREDENTIALS
#define SEC_E_UNKNOWN_CREDENTIALS
static SECURITY_STATUS SEC_ENTRY ntlm_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)
#define ISC_REQ_REPLAY_DETECT
SECURITY_STATUS SEC_ENTRY ntlm_FreeCredentialsHandle(PCredHandle phCredential)
void SECUR32_arc4Init(arc4_info *a4i, const BYTE *key, unsigned int keyLen)
#define ISC_RET_INTEGRITY
static SERVICE_STATUS status
SECURITY_STATUS fork_helper(PNegoHelper *new_helper, const char *prog, char *const argv[])
#define SECPKG_ATTR_SESSION_KEY
static const SecurityFunctionTableW ntlmTableW
void user(int argc, const char *argv[])
#define HeapFree(x, y, z)
#define SEC_E_INCOMPLETE_MESSAGE