#include "squid.h"
#include "base64.h"
#include "helper/protocol_defines.h"
#include "ntlmauth/ntlmauth.h"
#include "ntlmauth/support_bits.cci"
#include "sspi/sspwin32.h"
#include "util.h"
#include <cctype>
#include <lm.h>
Go to the source code of this file.
Macros | |
#define | FAIL_DEBUG 0 |
Functions | |
int | Valid_Group (char *UserName, char *Group) |
char * | AllocStrFromLSAStr (LSA_UNICODE_STRING LsaStr) |
char * | GetDomainName (void) |
int | ntlm_check_auth (ntlm_authenticate *auth, char *user, char *domain, int auth_length) |
void | helperfail (const char *reason) |
void | usage () |
void | process_options (int argc, char *argv[]) |
static bool | token_decode (size_t *decodedLen, uint8_t decoded[], const char *buf) |
int | manage_request () |
int | main (int argc, char *argv[]) |
Variables | |
int | NTLM_packet_debug_enabled = 0 |
static int | have_challenge |
char * | NTAllowedGroup |
char * | NTDisAllowedGroup |
int | UseDisallowedGroup = 0 |
int | UseAllowedGroup = 0 |
char * | my_program_name = nullptr |
Macro Definition Documentation
◆ FAIL_DEBUG
#define FAIL_DEBUG 0 |
Definition at line 68 of file ntlm_sspi_auth.cc.
Function Documentation
◆ AllocStrFromLSAStr()
char * AllocStrFromLSAStr | ( | LSA_UNICODE_STRING | LsaStr | ) |
Definition at line 167 of file ntlm_sspi_auth.cc.
References NULL, safe_free, and xmalloc.
Referenced by GetDomainName().
◆ GetDomainName()
char * GetDomainName | ( | void | ) |
Definition at line 188 of file ntlm_sspi_auth.cc.
References AllocStrFromLSAStr(), and debug().
◆ helperfail()
void helperfail | ( | const char * | reason | ) |
Definition at line 339 of file ntlm_sspi_auth.cc.
References SEND_BH.
Referenced by manage_request().
◆ main()
Definition at line 628 of file ntlm_sspi_auth.cc.
References debug(), LoadSecurityDll(), manage_request(), my_program_name, NTLM_PACKAGE_NAME, NULL, process_options(), SSP_NTLM, UnloadSecurityDll(), and VERSION.
◆ manage_request()
int manage_request | ( | void | ) |
Definition at line 425 of file ntlm_sspi_auth.cc.
References debug(), _ntlm_negotiate::flags, have_challenge, _ntlm_negotiate::hdr, HELPER_INPUT_BUFFER, helperfail(), hex_dump(), lc(), le32toh, NTLM_ANY, NTLM_AUTHENTICATE, NTLM_BAD_NTGROUP, NTLM_BAD_REQUEST, NTLM_CHALLENGE, ntlm_check_auth(), NTLM_ERR_NONE, NTLM_NEGOTIATE, NTLM_NEGOTIATE_ALWAYS_SIGN, NTLM_NEGOTIATE_ASCII, NTLM_NEGOTIATE_USE_LM, NTLM_NEGOTIATE_USE_NTLM, NTLM_packet_debug_enabled, NTLM_SSPI_ERROR, ntlm_validate_packet(), NULL, SEND_ERR, SEND_TT, _ntlmhdr::signature, token_decode(), and _ntlmhdr::type.
Referenced by main().
◆ ntlm_check_auth()
int ntlm_check_auth | ( | ntlm_authenticate * | auth, |
char * | user, | ||
char * | domain, | ||
int | auth_length | ||
) |
Definition at line 283 of file ntlm_sspi_auth.cc.
References credentials, debug(), NTAllowedGroup, NTDisAllowedGroup, NTLM_BAD_NTGROUP, NTLM_BAD_REQUEST, NTLM_ERR_NONE, NTLM_SSPI_ERROR, ntlm_unpack_auth(), UseAllowedGroup, UseDisallowedGroup, and Valid_Group().
Referenced by manage_request().
◆ process_options()
void process_options | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 370 of file ntlm_sspi_auth.cc.
References debug_enabled, getopt(), NTAllowedGroup, NTDisAllowedGroup, NTLM_packet_debug_enabled, optarg, opterr, optopt, safe_free, usage(), UseAllowedGroup, UseDisallowedGroup, and xstrdup.
Referenced by main().
◆ token_decode()
|
static |
Definition at line 411 of file ntlm_sspi_auth.cc.
References base64_decode_final(), base64_decode_init(), base64_decode_update(), and SEND_BH.
Referenced by manage_request().
◆ usage()
void usage | ( | void | ) |
Definition at line 357 of file ntlm_sspi_auth.cc.
References my_program_name.
Referenced by process_options().
◆ Valid_Group()
int Valid_Group | ( | char * | UserName, |
char * | Group | ||
) |
Definition at line 101 of file ntlm_sspi_auth.cc.
References FALSE, NULL, and TRUE.
Referenced by ntlm_check_auth().
Variable Documentation
◆ have_challenge
|
static |
Definition at line 89 of file ntlm_sspi_auth.cc.
Referenced by manage_request().
◆ my_program_name
char* my_program_name = nullptr |
Definition at line 354 of file ntlm_sspi_auth.cc.
◆ NTAllowedGroup
char* NTAllowedGroup |
Definition at line 90 of file ntlm_sspi_auth.cc.
Referenced by ntlm_check_auth(), and process_options().
◆ NTDisAllowedGroup
char* NTDisAllowedGroup |
Definition at line 91 of file ntlm_sspi_auth.cc.
Referenced by ntlm_check_auth(), and process_options().
◆ NTLM_packet_debug_enabled
int NTLM_packet_debug_enabled = 0 |
Definition at line 88 of file ntlm_sspi_auth.cc.
Referenced by manage_request(), and process_options().
◆ UseAllowedGroup
int UseAllowedGroup = 0 |
Definition at line 93 of file ntlm_sspi_auth.cc.
Referenced by ntlm_check_auth(), and process_options().
◆ UseDisallowedGroup
int UseDisallowedGroup = 0 |
Definition at line 92 of file ntlm_sspi_auth.cc.
Referenced by ntlm_check_auth(), and process_options().