--------------------- PatchSet 65 Date: 2000/02/13 20:58:24 Author: asd Branch: ntlm Tag: (none) Log: Move ntlm.h into "include" subdir. Members: src/ntlm.h:1.1.2.1->1.1.2.2(DEAD) --- squid/src/ntlm.h Wed Feb 14 00:43:13 2007 +++ /dev/null Wed Feb 14 00:42:24 2007 @@ -1,72 +0,0 @@ -#ifndef _NTLM_H_ -#define _NTLM_H_ 1 - -/* All of this cruft is little endian */ -#ifdef WORDS_BIGENDIAN -#define SSWAP(x) (bswap16((x))) -#define WSWAP(x) (bswap32((x))) -#else -#define SSWAP(x) (x) -#define WSWAP(x) (x) -#endif - -/* NTLM request types that we know about */ -#define NTLM_NEGOTIATE 1 -#define NTLM_CHALLENGE 2 -#define NTLM_AUTHENTICATE 3 - -/* Header proceeding each request */ -typedef struct ntlmhdr { - char signature[8]; /* NTLMSSP */ - int32_t type; /* One of NTLM_* from above */ -} ntlmhdr; - -/* String header. String data resides at the end of the request */ -typedef struct strhdr { - int16_t len; /* Length in bytes */ - int16_t maxlen; /* Allocated space in bytes */ - int32_t offset; /* Offset from start of request */ -} strhdr; - -/* Negotiation request sent by client */ -struct ntlm_negotiate { - ntlmhdr hdr; /* NTLM header */ - int32_t flags; /* Request flags */ - strhdr domain; /* Domain we wish to authenticate in */ - strhdr workstation; /* Client workstation name */ - char pad[256]; /* String data */ -}; - -/* Challenge request sent by server. */ -struct ntlm_challenge { - ntlmhdr hdr; /* NTLM header */ - strhdr target; /* Authentication target (domain/server ...) */ - int32_t flags; /* Request flags */ - u_char challenge[8]; /* Challenge string */ - int16_t unknown[8]; /* Some sort of context data */ - char pad[256]; /* String data */ -}; - -/* Authentication request sent by client in response to challenge */ -struct ntlm_authenticate { - ntlmhdr hdr; /* NTLM header */ - strhdr lmresponse; /* LANMAN challenge response */ - strhdr ntresponse; /* NT challenge response */ - strhdr domain; /* Domain to authenticate against */ - strhdr user; /* Username */ - strhdr workstation; /* Workstation name */ - strhdr sessionkey; /* Session key for server's use */ - int32_t flags; /* Request flags */ - char pad[256*6]; /* String data */ -}; - -char *ntlmGetString(ntlmhdr *hdr, strhdr *str, int flags); -void ntlmMakeChallenge(struct ntlm_challenge *chal); -int ntlmCheckHeader(struct ntlmhdr *hdr, int type); -int ntlmCheckNegotiation(struct ntlm_negotiate *neg); -int ntlmAuthenticate(struct ntlm_authenticate *neg); -void ntlmDumpChallenge(struct ntlm_challenge *chal); -int ntlmDecodeAuth(struct ntlm_authenticate *neg, char *buf, size_t size, - char **user, char **pass); - -#endif /* !defined _NTLM_H_ */