#include "squid.h"
#include "base64.h"
#include "ntlmauth/ntlmauth.h"
#include "sspwin32.h"
#include "util.h"

Go to the source code of this file.
Classes | |
struct | _AUTH_SEQ |
Typedefs | |
typedef struct _AUTH_SEQ | AUTH_SEQ |
typedef struct _AUTH_SEQ * | PAUTH_SEQ |
Functions | |
BOOL | GenClientContext (PAUTH_SEQ, PSEC_WINNT_AUTH_IDENTITY, PVOID, DWORD, PVOID, PDWORD, PBOOL) |
BOOL | GenServerContext (PAUTH_SEQ, PVOID, DWORD, PVOID, PDWORD, PBOOL, char *) |
void | UnloadSecurityDll (void) |
HMODULE | LoadSecurityDll (int mode, const char *SSP_Package) |
BOOL WINAPI | SSP_LogonUser (PTSTR szUser, PTSTR szPassword, PTSTR szDomain) |
const char *WINAPI | SSP_MakeChallenge (PVOID PNegotiateBuf, int NegotiateLen) |
BOOL WINAPI | SSP_ValidateNTLMCredentials (PVOID PAutenticateBuf, int AutenticateLen, char *credentials) |
const char *WINAPI | SSP_MakeNegotiateBlob (PVOID PNegotiateBuf, int NegotiateLen, PBOOL fDone, int *Status, char *credentials) |
const char *WINAPI | SSP_ValidateNegotiateCredentials (PVOID PAutenticateBuf, int AutenticateLen, PBOOL fDone, int *Status, char *credentials) |
Variables | |
static HMODULE | hModule |
static int | NTLM_mode = SSP_BASIC |
static char * | SSP_Package_InUse |
SECURITY_STATUS | SecurityStatus = SEC_E_OK |
static DWORD | cbMaxToken = 0 |
static uint8_t * | pClientBuf = NULL |
static uint8_t * | pServerBuf = NULL |
static AUTH_SEQ | NTLM_asServer = {0} |
BOOL | Use_Unicode = FALSE |
BOOL | NTLM_LocalCall = FALSE |
ACCEPT_SECURITY_CONTEXT_FN | _AcceptSecurityContext = NULL |
ACQUIRE_CREDENTIALS_HANDLE_FN | _AcquireCredentialsHandle = NULL |
COMPLETE_AUTH_TOKEN_FN | _CompleteAuthToken = NULL |
DELETE_SECURITY_CONTEXT_FN | _DeleteSecurityContext = NULL |
FREE_CONTEXT_BUFFER_FN | _FreeContextBuffer = NULL |
FREE_CREDENTIALS_HANDLE_FN | _FreeCredentialsHandle = NULL |
INITIALIZE_SECURITY_CONTEXT_FN | _InitializeSecurityContext = NULL |
QUERY_SECURITY_PACKAGE_INFO_FN | _QuerySecurityPackageInfo = NULL |
QUERY_CONTEXT_ATTRIBUTES_FN_A | _QueryContextAttributes = NULL |
Typedef Documentation
◆ AUTH_SEQ
◆ PAUTH_SEQ
Function Documentation
◆ GenClientContext()
BOOL GenClientContext | ( | PAUTH_SEQ | pAS, |
PSEC_WINNT_AUTH_IDENTITY | pAuthIdentity, | ||
PVOID | pIn, | ||
DWORD | cbIn, | ||
PVOID | pOut, | ||
PDWORD | pcbOut, | ||
PBOOL | pfDone | ||
) |
Definition at line 210 of file sspwin32.cc.
References _AcquireCredentialsHandle, _CompleteAuthToken, _InitializeSecurityContext, FALSE, _AUTH_SEQ::fHaveCredHandle, _AUTH_SEQ::fHaveCtxtHandle, _AUTH_SEQ::fInitialized, _AUTH_SEQ::hcred, _AUTH_SEQ::hctxt, NTLM_mode, NULL, SecurityStatus, SSP_Package_InUse, and TRUE.
Referenced by SSP_LogonUser().
◆ GenServerContext()
BOOL GenServerContext | ( | PAUTH_SEQ | pAS, |
PVOID | pIn, | ||
DWORD | cbIn, | ||
PVOID | pOut, | ||
PDWORD | pcbOut, | ||
PBOOL | pfDone, | ||
char * | credentials | ||
) |
Definition at line 278 of file sspwin32.cc.
References _AcceptSecurityContext, _AcquireCredentialsHandle, _CompleteAuthToken, _QueryContextAttributes, credentials, FALSE, _AUTH_SEQ::fHaveCredHandle, _AUTH_SEQ::fHaveCtxtHandle, _AUTH_SEQ::fInitialized, _AUTH_SEQ::hcred, _AUTH_SEQ::hcredLifeTime, _AUTH_SEQ::hctxt, _AUTH_SEQ::hctxtLifeTime, NTLM_mode, NULL, SecurityStatus, SSP_Package_InUse, and TRUE.
Referenced by SSP_LogonUser(), SSP_MakeChallenge(), SSP_MakeNegotiateBlob(), SSP_ValidateNegotiateCredentials(), and SSP_ValidateNTLMCredentials().
◆ LoadSecurityDll()
HMODULE LoadSecurityDll | ( | int | mode, |
const char * | SSP_Package | ||
) |
Definition at line 84 of file sspwin32.cc.
References _AcceptSecurityContext, _AcquireCredentialsHandle, _CompleteAuthToken, _DeleteSecurityContext, _FreeContextBuffer, _FreeCredentialsHandle, _InitializeSecurityContext, _QueryContextAttributes, _QuerySecurityPackageInfo, cbMaxToken, hModule, NTLM_mode, NULL, pClientBuf, pServerBuf, SSP_Package_InUse, UnloadSecurityDll(), xcalloc(), and xstrdup.
Referenced by main().
◆ SSP_LogonUser()
BOOL WINAPI SSP_LogonUser | ( | PTSTR | szUser, |
PTSTR | szPassword, | ||
PTSTR | szDomain | ||
) |
Definition at line 383 of file sspwin32.cc.
References _DeleteSecurityContext, _FreeCredentialsHandle, BOOL, cbMaxToken, FALSE, _AUTH_SEQ::fHaveCredHandle, _AUTH_SEQ::fHaveCtxtHandle, GenClientContext(), GenServerContext(), _AUTH_SEQ::hcred, _AUTH_SEQ::hctxt, hModule, NULL, pClientBuf, pServerBuf, and TRUE.
Referenced by Valid_User().
◆ SSP_MakeChallenge()
const char *WINAPI SSP_MakeChallenge | ( | PVOID | PNegotiateBuf, |
int | NegotiateLen | ||
) |
Definition at line 458 of file sspwin32.cc.
References _DeleteSecurityContext, _FreeCredentialsHandle, assert, base64_encode_final(), base64_encode_init(), base64_encode_update(), BOOL, cbMaxToken, challenge, FALSE, _AUTH_SEQ::fHaveCredHandle, _AUTH_SEQ::fHaveCtxtHandle, GenServerContext(), _AUTH_SEQ::hcred, _AUTH_SEQ::hctxt, hModule, NTLM_asServer, NTLM_LocalCall, NTLM_NEGOTIATE_THIS_IS_LOCAL_CALL, NTLM_NEGOTIATE_UNICODE, NULL, pClientBuf, pServerBuf, and Use_Unicode.
Referenced by manage_request().
◆ SSP_MakeNegotiateBlob()
const char *WINAPI SSP_MakeNegotiateBlob | ( | PVOID | PNegotiateBuf, |
int | NegotiateLen, | ||
PBOOL | fDone, | ||
int * | Status, | ||
char * | credentials | ||
) |
Definition at line 530 of file sspwin32.cc.
References _DeleteSecurityContext, _FreeCredentialsHandle, assert, base64_encode_final(), base64_encode_init(), base64_encode_update(), cbMaxToken, credentials, _AUTH_SEQ::fHaveCredHandle, _AUTH_SEQ::fHaveCtxtHandle, GenServerContext(), _AUTH_SEQ::hcred, _AUTH_SEQ::hctxt, hModule, NTLM_asServer, NULL, pClientBuf, and pServerBuf.
Referenced by manage_request().
◆ SSP_ValidateNegotiateCredentials()
const char *WINAPI SSP_ValidateNegotiateCredentials | ( | PVOID | PAutenticateBuf, |
int | AutenticateLen, | ||
PBOOL | fDone, | ||
int * | Status, | ||
char * | credentials | ||
) |
Definition at line 571 of file sspwin32.cc.
References assert, base64_encode_final(), base64_encode_init(), base64_encode_update(), cbMaxToken, credentials, GenServerContext(), hModule, NTLM_asServer, NULL, pClientBuf, and pServerBuf.
Referenced by manage_request().
◆ SSP_ValidateNTLMCredentials()
BOOL WINAPI SSP_ValidateNTLMCredentials | ( | PVOID | PAutenticateBuf, |
int | AutenticateLen, | ||
char * | credentials | ||
) |
Definition at line 505 of file sspwin32.cc.
References BOOL, cbMaxToken, credentials, FALSE, GenServerContext(), hModule, NTLM_asServer, pClientBuf, pServerBuf, and TRUE.
Referenced by ntlm_check_auth().
◆ UnloadSecurityDll()
void UnloadSecurityDll | ( | void | ) |
Definition at line 57 of file sspwin32.cc.
References _AcceptSecurityContext, _AcquireCredentialsHandle, _CompleteAuthToken, _DeleteSecurityContext, _FreeContextBuffer, _FreeCredentialsHandle, _InitializeSecurityContext, _QueryContextAttributes, _QuerySecurityPackageInfo, _AUTH_SEQ::fHaveCredHandle, _AUTH_SEQ::fHaveCtxtHandle, _AUTH_SEQ::hcred, _AUTH_SEQ::hctxt, hModule, NTLM_asServer, NULL, pClientBuf, pServerBuf, SSP_Package_InUse, and xfree.
Referenced by LoadSecurityDll(), and main().
Variable Documentation
◆ _AcceptSecurityContext
ACCEPT_SECURITY_CONTEXT_FN _AcceptSecurityContext = NULL |
Definition at line 43 of file sspwin32.cc.
Referenced by GenServerContext(), LoadSecurityDll(), and UnloadSecurityDll().
◆ _AcquireCredentialsHandle
ACQUIRE_CREDENTIALS_HANDLE_FN _AcquireCredentialsHandle = NULL |
Definition at line 44 of file sspwin32.cc.
Referenced by GenClientContext(), GenServerContext(), LoadSecurityDll(), and UnloadSecurityDll().
◆ _CompleteAuthToken
COMPLETE_AUTH_TOKEN_FN _CompleteAuthToken = NULL |
Definition at line 45 of file sspwin32.cc.
Referenced by GenClientContext(), GenServerContext(), LoadSecurityDll(), and UnloadSecurityDll().
◆ _DeleteSecurityContext
DELETE_SECURITY_CONTEXT_FN _DeleteSecurityContext = NULL |
Definition at line 46 of file sspwin32.cc.
Referenced by LoadSecurityDll(), SSP_LogonUser(), SSP_MakeChallenge(), SSP_MakeNegotiateBlob(), and UnloadSecurityDll().
◆ _FreeContextBuffer
FREE_CONTEXT_BUFFER_FN _FreeContextBuffer = NULL |
Definition at line 47 of file sspwin32.cc.
Referenced by LoadSecurityDll(), and UnloadSecurityDll().
◆ _FreeCredentialsHandle
FREE_CREDENTIALS_HANDLE_FN _FreeCredentialsHandle = NULL |
Definition at line 48 of file sspwin32.cc.
Referenced by LoadSecurityDll(), SSP_LogonUser(), SSP_MakeChallenge(), SSP_MakeNegotiateBlob(), and UnloadSecurityDll().
◆ _InitializeSecurityContext
INITIALIZE_SECURITY_CONTEXT_FN _InitializeSecurityContext = NULL |
Definition at line 49 of file sspwin32.cc.
Referenced by GenClientContext(), LoadSecurityDll(), and UnloadSecurityDll().
◆ _QueryContextAttributes
QUERY_CONTEXT_ATTRIBUTES_FN_A _QueryContextAttributes = NULL |
Definition at line 54 of file sspwin32.cc.
Referenced by GenServerContext(), LoadSecurityDll(), and UnloadSecurityDll().
◆ _QuerySecurityPackageInfo
QUERY_SECURITY_PACKAGE_INFO_FN _QuerySecurityPackageInfo = NULL |
Definition at line 50 of file sspwin32.cc.
Referenced by LoadSecurityDll(), and UnloadSecurityDll().
◆ cbMaxToken
|
static |
Definition at line 33 of file sspwin32.cc.
Referenced by LoadSecurityDll(), SSP_LogonUser(), SSP_MakeChallenge(), SSP_MakeNegotiateBlob(), SSP_ValidateNegotiateCredentials(), and SSP_ValidateNTLMCredentials().
◆ hModule
|
static |
Definition at line 28 of file sspwin32.cc.
Referenced by LoadSecurityDll(), SSP_LogonUser(), SSP_MakeChallenge(), SSP_MakeNegotiateBlob(), SSP_ValidateNegotiateCredentials(), SSP_ValidateNTLMCredentials(), and UnloadSecurityDll().
◆ NTLM_asServer
|
static |
Definition at line 37 of file sspwin32.cc.
Referenced by SSP_MakeChallenge(), SSP_MakeNegotiateBlob(), SSP_ValidateNegotiateCredentials(), SSP_ValidateNTLMCredentials(), and UnloadSecurityDll().
◆ NTLM_LocalCall
Definition at line 40 of file sspwin32.cc.
Referenced by manage_request(), ntlm_check_auth(), and SSP_MakeChallenge().
◆ NTLM_mode
|
static |
Definition at line 29 of file sspwin32.cc.
Referenced by GenClientContext(), GenServerContext(), and LoadSecurityDll().
◆ pClientBuf
|
static |
Definition at line 34 of file sspwin32.cc.
Referenced by LoadSecurityDll(), SSP_LogonUser(), SSP_MakeChallenge(), SSP_MakeNegotiateBlob(), SSP_ValidateNegotiateCredentials(), SSP_ValidateNTLMCredentials(), and UnloadSecurityDll().
◆ pServerBuf
|
static |
Definition at line 35 of file sspwin32.cc.
Referenced by LoadSecurityDll(), SSP_LogonUser(), SSP_MakeChallenge(), SSP_MakeNegotiateBlob(), SSP_ValidateNegotiateCredentials(), SSP_ValidateNTLMCredentials(), and UnloadSecurityDll().
◆ SecurityStatus
SECURITY_STATUS SecurityStatus = SEC_E_OK |
Definition at line 31 of file sspwin32.cc.
Referenced by GenClientContext(), and GenServerContext().
◆ SSP_Package_InUse
|
static |
Definition at line 30 of file sspwin32.cc.
Referenced by GenClientContext(), GenServerContext(), LoadSecurityDll(), and UnloadSecurityDll().
◆ Use_Unicode
Definition at line 39 of file sspwin32.cc.
Referenced by SSP_MakeChallenge().