ntlm_smb_lm_auth.cc File Reference
#include "squid.h"
#include "base64.h"
#include "compat/debug.h"
#include "helper/protocol_defines.h"
#include "ntlmauth/ntlmauth.h"
#include "ntlmauth/support_bits.cci"
#include "rfcnb/rfcnb.h"
#include "smblib/smblib.h"
#include <cassert>
#include <cctype>
#include <cerrno>
#include <csignal>
#include <cstdlib>
#include <cstring>
#include <ctime>
Include dependency graph for ntlm_smb_lm_auth.cc:

Go to the source code of this file.

Classes

struct  _dc
 

Macros

#define DEAD_DC_RETRY_INTERVAL   30
 
#define SEND(X)   debug("sending '%s' to squid\n",X); printf(X "\n");
 
#define SEND2   printf
 
#define SEND3   printf
 
#define ENCODED_PASS_LEN   24
 
#define MAX_USERNAME_LEN   255
 
#define MAX_DOMAIN_LEN   255
 
#define MAX_PASSWD_LEN   31
 

Typedefs

typedef struct _dc dc
 

Functions

const char * make_challenge (char *domain, char *controller)
 
char * ntlm_check_auth (ntlm_authenticate *auth, int auth_length)
 
void dc_disconnect (void)
 
int connectedp (void)
 
int is_dc_ok (char *domain, char *domain_controller)
 
void usage (void)
 
void process_options (int argc, char *argv[])
 
const char * obtain_challenge (void)
 
void manage_request (void)
 
static int init_challenge (char *domain, char *domain_controller)
 
void timeout_during_auth (int signum)
 
int main (int argc, char *argv[])
 

Variables

static unsigned char challenge [NTLM_NONCE_LEN]
 
static unsigned char lmencoded_empty_pass [ENCODED_PASS_LEN]
 
static unsigned char ntencoded_empty_pass [ENCODED_PASS_LEN]
 
SMB_Handle_Type handle = NULL
 
int ntlm_errno
 
static char credentials [MAX_USERNAME_LEN+MAX_DOMAIN_LEN+2]
 
static char my_domain [100]
 
static char my_domain_controller [100]
 
static char errstr [1001]
 
char load_balance = 0
 
char protocol_pedantic = 0
 
dccontrollers = NULL
 
int numcontrollers = 0
 
dccurrent_dc
 
char smb_error_buffer [1000]
 
static char got_timeout = 0
 
char * my_program_name = NULL
 

Macro Definition Documentation

#define DEAD_DC_RETRY_INTERVAL   30

Definition at line 52 of file ntlm_smb_lm_auth.cc.

Referenced by obtain_challenge().

#define ENCODED_PASS_LEN   24

Definition at line 87 of file ntlm_smb_lm_auth.cc.

Referenced by ntlm_check_auth().

#define MAX_DOMAIN_LEN   255

Definition at line 89 of file ntlm_smb_lm_auth.cc.

Referenced by ntlm_check_auth().

#define MAX_PASSWD_LEN   31

Definition at line 90 of file ntlm_smb_lm_auth.cc.

Referenced by ntlm_check_auth().

#define MAX_USERNAME_LEN   255

Definition at line 88 of file ntlm_smb_lm_auth.cc.

Referenced by ntlm_check_auth().

#define SEND (   X)    debug("sending '%s' to squid\n",X); printf(X "\n");

Definition at line 57 of file ntlm_smb_lm_auth.cc.

Referenced by manage_request().

#define SEND2   printf

Definition at line 63 of file ntlm_smb_lm_auth.cc.

Referenced by manage_request().

#define SEND3   printf

Definition at line 64 of file ntlm_smb_lm_auth.cc.

Typedef Documentation

typedef struct _dc dc

Definition at line 73 of file ntlm_smb_lm_auth.cc.

Function Documentation

int connectedp ( void  )

Definition at line 120 of file ntlm_smb_lm_auth.cc.

References NULL.

void dc_disconnect ( void  )

Definition at line 112 of file ntlm_smb_lm_auth.cc.

References NULL, and SMB_Discon().

Referenced by manage_request(), and timeout_during_auth().

int is_dc_ok ( char *  domain,
char *  domain_controller 
)

Definition at line 127 of file ntlm_smb_lm_auth.cc.

References NULL, SMB_Connect_Server(), and SMB_Discon().

int main ( int  argc,
char *  argv[] 
)
const char * obtain_challenge ( )

tries connecting to the domain controllers in the "controllers" ring, with failover if the adequate option is specified.

Definition at line 459 of file ntlm_smb_lm_auth.cc.

References _dc::controller, _dc::dead, DEAD_DC_RETRY_INTERVAL, debug, _dc::domain, make_challenge(), _dc::next, NULL, and numcontrollers.

Referenced by manage_request().

void process_options ( int  argc,
char *  argv[] 
)
void timeout_during_auth ( int  )

signal handler to be invoked when the authentication operation times out

Definition at line 347 of file ntlm_smb_lm_auth.cc.

References dc_disconnect().

Referenced by manage_request().

void usage ( void  )

Definition at line 363 of file ntlm_smb_lm_auth.cc.

References my_program_name.

Referenced by process_options().

Variable Documentation

unsigned char challenge[NTLM_NONCE_LEN]
static

Definition at line 92 of file ntlm_smb_lm_auth.cc.

Referenced by init_challenge(), make_challenge(), and SSP_MakeChallenge().

dc* controllers = NULL

Definition at line 104 of file ntlm_smb_lm_auth.cc.

Referenced by main(), and process_options().

char credentials[MAX_USERNAME_LEN+MAX_DOMAIN_LEN+2]
static

Definition at line 97 of file ntlm_smb_lm_auth.cc.

Referenced by ntlm_check_auth().

dc* current_dc

Definition at line 106 of file ntlm_smb_lm_auth.cc.

char errstr[1001]
static

Definition at line 99 of file ntlm_smb_lm_auth.cc.

Referenced by checkForPortOnly(), init_challenge(), and main().

char got_timeout = 0
static

Definition at line 343 of file ntlm_smb_lm_auth.cc.

Referenced by manage_request().

Definition at line 95 of file ntlm_smb_lm_auth.cc.

Referenced by file_write().

unsigned char lmencoded_empty_pass[ENCODED_PASS_LEN]
static

Definition at line 93 of file ntlm_smb_lm_auth.cc.

Referenced by init_challenge(), and ntlm_check_auth().

char load_balance = 0

Definition at line 103 of file ntlm_smb_lm_auth.cc.

Referenced by main(), and process_options().

char my_domain[100]
static

Definition at line 98 of file ntlm_smb_lm_auth.cc.

Referenced by make_challenge().

char my_domain_controller[100]
static

Definition at line 98 of file ntlm_smb_lm_auth.cc.

Referenced by make_challenge().

char* my_program_name = NULL

Definition at line 360 of file ntlm_smb_lm_auth.cc.

Referenced by main(), and usage().

unsigned char ntencoded_empty_pass[ENCODED_PASS_LEN]
static

Definition at line 93 of file ntlm_smb_lm_auth.cc.

Referenced by init_challenge(), and ntlm_check_auth().

int ntlm_errno

Definition at line 96 of file ntlm_smb_lm_auth.cc.

Referenced by manage_request(), and ntlm_check_auth().

int numcontrollers = 0

Definition at line 105 of file ntlm_smb_lm_auth.cc.

Referenced by main(), obtain_challenge(), and process_options().

char protocol_pedantic = 0

Definition at line 103 of file ntlm_smb_lm_auth.cc.

char smb_error_buffer[1000]

Definition at line 107 of file ntlm_smb_lm_auth.cc.

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors