Go to the documentation of this file.
9 #ifndef SQUID_NTLMAUTH_H
10 #define SQUID_NTLMAUTH_H
22 #define NTLM_MAX_FIELD_LENGTH 300
25 #define NTLM_BLOB_BUFFER_SIZE 10240
30 #define NTLM_REQUEST_INIT_RESPONSE 0x100000
31 #define NTLM_REQUEST_ACCEPT_RESPONSE 0x200000
32 #define NTLM_REQUEST_NON_NT_SESSION_KEY 0x400000
35 #define NTLM_ERR_INTERNAL -3
36 #define NTLM_ERR_BLOB -2
37 #define NTLM_ERR_BAD_PROTOCOL -1
38 #define NTLM_ERR_NONE 0
40 #define NTLM_ERR_SERVER 1
41 #define NTLM_ERR_PROTOCOL 2
42 #define NTLM_ERR_LOGON 3
43 #define NTLM_ERR_UNTRUSTED_DOMAIN 4
44 #define NTLM_ERR_NOT_CONNECTED 10
46 #define NTLM_SSPI_ERROR 1
47 #define NTLM_BAD_NTGROUP 2
48 #define NTLM_BAD_REQUEST 3
73 #define NTLM_NEGOTIATE 1
74 #define NTLM_CHALLENGE 2
75 #define NTLM_AUTHENTICATE 3
90 const int32_t packet_length,
92 const uint32_t flags);
100 const uint16_t toadd_length);
107 #define NTLM_NEGOTIATE_UNICODE 0x0001
108 #define NTLM_NEGOTIATE_ASCII 0x0002
109 #define NTLM_NEGOTIATE_REQUEST_TARGET 0x0004
110 #define NTLM_NEGOTIATE_REQUEST_SIGN 0x0010
111 #define NTLM_NEGOTIATE_REQUEST_SEAL 0x0020
112 #define NTLM_NEGOTIATE_DATAGRAM_STYLE 0x0040
113 #define NTLM_NEGOTIATE_USE_LM 0x0080
114 #define NTLM_NEGOTIATE_USE_NETWARE 0x0100
115 #define NTLM_NEGOTIATE_USE_NTLM 0x0200
116 #define NTLM_NEGOTIATE_DOMAIN_SUPPLIED 0x1000
117 #define NTLM_NEGOTIATE_WORKSTATION_SUPPLIED 0x2000
118 #define NTLM_NEGOTIATE_THIS_IS_LOCAL_CALL 0x4000
119 #define NTLM_NEGOTIATE_ALWAYS_SIGN 0x8000
134 #define NTLM_NONCE_LEN 8
137 #define NTLM_CHALLENGE_TARGET_IS_DOMAIN 0x10000
138 #define NTLM_CHALLENGE_TARGET_IS_SERVER 0x20000
139 #define NTLM_CHALLENGE_TARGET_IS_SHARE 0x40000
153 #define NTLM_CHALLENGE_HEADER_OFFSET (sizeof(ntlm_challenge)-256)
163 const char *domain_controller,
164 const char *challenge_nonce,
165 const int challenge_nonce_len,
166 const uint32_t flags);
int ntlm_unpack_auth(const ntlm_authenticate *auth, char *user, char *domain, const int32_t size)
lstring ntlm_fetch_string(const ntlmhdr *packet, const int32_t packet_length, const strhdr *str, const uint32_t flags)
void ntlm_make_challenge(ntlm_challenge *ch, const char *domain, const char *domain_controller, const char *challenge_nonce, const int challenge_nonce_len, const uint32_t flags)
void ntlm_add_to_payload(const ntlmhdr *packet_hdr, char *payload, int *payload_length, strhdr *hdr, const char *toadd, const uint16_t toadd_length)
u_char challenge[NTLM_NONCE_LEN]
void ntlm_dump_ntlmssp_flags(const uint32_t flags)
struct _ntlm_negotiate ntlm_negotiate
int ntlm_validate_packet(const ntlmhdr *packet, const int32_t type)
struct _ntlm_challenge ntlm_challenge
struct _ntlm_authenticate ntlm_authenticate
void ntlm_make_nonce(char *nonce)