diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-09-30 15:19:23 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-09-30 15:19:23 +0000 |
commit | 0e1430e643fc68bb60072210aeac24f7e9808312 (patch) | |
tree | 604234c7c62485b8dc652a5042dc47524100ff0d | |
parent | dae251e948964d71b54a0352202fc10961931dae (diff) | |
download | fetchmail-0e1430e643fc68bb60072210aeac24f7e9808312.tar.gz fetchmail-0e1430e643fc68bb60072210aeac24f7e9808312.tar.bz2 fetchmail-0e1430e643fc68bb60072210aeac24f7e9808312.zip |
Initial revision
svn path=/trunk/; revision=3510
-rw-r--r-- | ntlm.h | 68 |
1 files changed, 68 insertions, 0 deletions
@@ -0,0 +1,68 @@ +typedef unsigned short uint16; +typedef unsigned int uint32; +typedef unsigned char uint8; + + +/* + * These structures are byte-order dependant, and should not + * be manipulated except by the use of the routines provided + */ + +typedef struct +{ +uint16 len; +uint16 maxlen; +uint32 offset; +}tSmbStrHeader; + +typedef struct +{ +char ident[8]; +uint32 msgType; +uint32 flags; +tSmbStrHeader user; +tSmbStrHeader domain; +uint8 buffer[1024]; +uint32 bufIndex; +}tSmbNtlmAuthRequest; + +typedef struct +{ +char ident[8]; +uint32 msgType; +tSmbStrHeader uDomain; +uint32 flags; +uint8 challengeData[8]; +uint8 reserved[8]; +tSmbStrHeader emptyString; +uint8 buffer[1024]; +uint32 bufIndex; +}tSmbNtlmAuthChallenge; + + +typedef struct +{ +char ident[8]; +uint32 msgType; +tSmbStrHeader lmResponse; +tSmbStrHeader ntResponse; +tSmbStrHeader uDomain; +tSmbStrHeader uUser; +tSmbStrHeader uWks; +tSmbStrHeader sessionKey; +uint32 flags; +uint8 buffer[1024]; +uint32 bufIndex; +}tSmbNtlmAuthResponse; + +/* public: */ + +#define SmbLength(ptr) (((ptr)->buffer - (uint8*)(ptr)) + (ptr)->bufIndex) + +extern void dumpSmbNtlmAuthRequest(FILE *fp, tSmbNtlmAuthRequest *request); +extern void dumpSmbNtlmAuthChallenge(FILE *fp, tSmbNtlmAuthChallenge *challenge); +extern void dumpSmbNtlmAuthResponse(FILE *fp, tSmbNtlmAuthResponse *response); + +extern void buildSmbNtlmAuthRequest(tSmbNtlmAuthRequest *request, char *user, char *domain); +extern void buildSmbNtlmAuthResponse(tSmbNtlmAuthChallenge *challenge, tSmbNtlmAuthResponse *response, char *user, char *password); + |