NCBI C++ ToolKit
Classes | Macros | Typedefs | Functions | Variables
challenge.c File Reference
#include <config.h>
#include <ctype.h>
#include <freetds/time.h>
#include <freetds/tds.h>
#include <freetds/bytes.h>
#include <freetds/string.h>
#include <freetds/iconv.h>
#include "md4.h"
#include "md5.h"
#include "hmac_md5.h"
#include "des.h"
#include "replacements.h"
#include <assert.h>
+ Include dependency graph for challenge.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  tds_answer
 
struct  names_blob_prefix_t
 
struct  tds_ntlm_auth
 

Macros

#define MAX_PW_SZ   14
 
#define TIME_FIXUP_CONSTANT   (((TDS_UINT8) 134774U) * 86400U)
 

Typedefs

typedef struct tds_answer TDSANSWER
 
typedef struct tds_ntlm_auth TDSNTLMAUTH
 

Functions

static TDSRET tds_answer_challenge (TDSSOCKET *tds, TDSLOGIN *login, const unsigned char *challenge, TDS_UINT *flags, const unsigned char *names_blob, TDS_INT names_blob_len, TDSANSWER *answer, unsigned char **ntlm_v2_response)
 Crypt a given password using schema required for NTLMv1 or NTLM2 authentication. More...
 
static void tds_encrypt_answer (const unsigned char *hash, const unsigned char *challenge, unsigned char *answer)
 
static void tds_convert_key (const unsigned char *key_56, DES_KEY *ks)
 
static void convert_to_upper (char *buf, size_t len)
 
static size_t convert_to_usc2le_string (TDSSOCKET *tds, const char *s, size_t len, char *out)
 
static TDSRET make_ntlm_hash (TDSSOCKET *tds, const char *passwd, unsigned char ntlm_hash[16])
 
static TDSRET make_ntlm_v2_hash (TDSSOCKET *tds, const char *passwd, unsigned char ntlm_v2_hash[16])
 
static unsigned char * make_lm_v2_response (const unsigned char ntlm_v2_hash[16], const unsigned char *client_data, TDS_INT client_data_len, const unsigned char challenge[8])
 
static TDSRET tds_answer_challenge_ntlmv2 (TDSSOCKET *tds, TDSLOGIN *login, const unsigned char *challenge, TDS_UINT *flags, const unsigned char *names_blob, TDS_INT names_blob_len, TDSANSWER *answer, unsigned char **ntlm_v2_response)
 
static TDSRET tds7_send_auth (TDSSOCKET *tds, const unsigned char *challenge, TDS_UINT flags, const unsigned char *names_blob, TDS_INT names_blob_len)
 
static TDSRET tds_ntlm_free (TDSCONNECTION *conn, TDSAUTHENTICATION *tds_auth)
 
static void unix_to_nt_time (TDS_UINT8 *nt, struct timeval *tv)
 put a 8 byte filetime from a time_t This takes GMT as input More...
 
static void fill_names_blob_prefix (names_blob_prefix_t *prefix)
 
static TDSRET tds_ntlm_handle_next (TDSSOCKET *tds, struct tds_authentication *auth, size_t len)
 
TDSAUTHENTICATIONtds_ntlm_get_auth (TDSSOCKET *tds)
 Build a NTLMSPP packet to send to server. More...
 

Variables

static const unsigned char ntlm_id [] = "NTLMSSP"
 

Macro Definition Documentation

◆ MAX_PW_SZ

#define MAX_PW_SZ   14

◆ TIME_FIXUP_CONSTANT

#define TIME_FIXUP_CONSTANT   (((TDS_UINT8) 134774U) * 86400U)
Modified on Tue Feb 27 05:54:35 2024 by modify_doxy.py rev. 669887