]> Pileus Git - ~andy/fetchmail/blob - ntlm.h
Fix for OPIE operation.
[~andy/fetchmail] / ntlm.h
1 /* ntlm.h  -- interface declarations for SMB authentication code */
2
3 typedef unsigned short uint16;
4 typedef unsigned int   uint32;
5 typedef unsigned char  uint8;
6
7
8 /* 
9  * These structures are byte-order dependant, and should not
10  * be manipulated except by the use of the routines provided
11  */
12
13 typedef struct
14 {
15 uint16  len;
16 uint16  maxlen;
17 uint32  offset;
18 }tSmbStrHeader;
19
20 typedef struct
21 {
22 char          ident[8];
23 uint32        msgType;
24 uint32        flags;
25 tSmbStrHeader    user;
26 tSmbStrHeader    domain;
27 uint8         buffer[1024];
28 uint32        bufIndex;
29 }tSmbNtlmAuthRequest;
30
31 typedef struct
32 {
33 char          ident[8];
34 uint32        msgType;
35 tSmbStrHeader    uDomain;
36 uint32        flags;
37 uint8         challengeData[8];
38 uint8         reserved[8];
39 tSmbStrHeader    emptyString;
40 uint8         buffer[1024];
41 uint32        bufIndex;
42 }tSmbNtlmAuthChallenge;
43
44
45 typedef struct
46 {
47 char          ident[8];
48 uint32        msgType;
49 tSmbStrHeader    lmResponse;
50 tSmbStrHeader    ntResponse;
51 tSmbStrHeader    uDomain;
52 tSmbStrHeader    uUser;
53 tSmbStrHeader    uWks;
54 tSmbStrHeader    sessionKey;
55 uint32        flags;
56 uint8         buffer[1024];
57 uint32        bufIndex;
58 }tSmbNtlmAuthResponse;
59
60 /* public: */
61
62 #define SmbLength(ptr) (((ptr)->buffer - (uint8*)(ptr)) + (ptr)->bufIndex)
63
64 extern void dumpSmbNtlmAuthRequest(FILE *fp, tSmbNtlmAuthRequest *request);
65 extern void dumpSmbNtlmAuthChallenge(FILE *fp, tSmbNtlmAuthChallenge *challenge);
66 extern void dumpSmbNtlmAuthResponse(FILE *fp, tSmbNtlmAuthResponse *response);
67
68 extern void buildSmbNtlmAuthRequest(tSmbNtlmAuthRequest *request, char *user, char *domain);
69 extern void buildSmbNtlmAuthResponse(tSmbNtlmAuthChallenge *challenge, tSmbNtlmAuthResponse *response, char *user, char *password);
70
71 /* ntlm.h ends here */