comparison libpurple/ntlm.c @ 19781:6dcab2412c22

This is parts 1 and 2 of patch #2910 from Vladimir (thecrux) to improve NTLM proxy handling. Specifically, it specifies that we're using Unicode strings and uses the hostname of the local machine instead of incorrectly using the proxy server's hostname for authentication. References #2910.
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 13 Sep 2007 01:25:22 +0000
parents 44b4e8bd759b
children 6bf32c9e15a7
comparison
equal deleted inserted replaced
19780:3023e0ba2fa6 19781:6dcab2412c22
129 tmsg->protocol[4] = 'S'; 129 tmsg->protocol[4] = 'S';
130 tmsg->protocol[5] = 'S'; 130 tmsg->protocol[5] = 'S';
131 tmsg->protocol[6] = 'P'; 131 tmsg->protocol[6] = 'P';
132 tmsg->protocol[7] = '\0'; 132 tmsg->protocol[7] = '\0';
133 tmsg->type = 0x00000001; 133 tmsg->type = 0x00000001;
134 tmsg->flags = 0x0000b202; 134 tmsg->flags = 0x0000b203;
135 tmsg->dom_len1 = tmsg->dom_len2 = domainlen; 135 tmsg->dom_len1 = tmsg->dom_len2 = domainlen;
136 tmsg->dom_off = sizeof(struct type1_message) + hostnamelen; 136 tmsg->dom_off = sizeof(struct type1_message) + hostnamelen;
137 tmsg->host_len1 = tmsg->host_len2 = hostnamelen; 137 tmsg->host_len1 = tmsg->host_len2 = hostnamelen;
138 tmsg->host_off = sizeof(struct type1_message); 138 tmsg->host_off = sizeof(struct type1_message);
139 memcpy(msg + tmsg->host_off, hostname, hostnamelen); 139 memcpy(msg + tmsg->host_off, hostname, hostnamelen);
284 if(flags) { 284 if(flags) {
285 tmsg->sess_off = sizeof(struct type3_message) + domainlen + usernamelen + hostnamelen + 0x18 + 0x18; 285 tmsg->sess_off = sizeof(struct type3_message) + domainlen + usernamelen + hostnamelen + 0x18 + 0x18;
286 tmsg->sess_len1 = tmsg->sess_len2 = 0x0010; 286 tmsg->sess_len1 = tmsg->sess_len2 = 0x0010;
287 } 287 }
288 288
289 tmsg->flags = 0x00008200; 289 tmsg->flags = 0x00008201;
290 290
291 tmp = (char *)tmsg + sizeof(struct type3_message); 291 tmp = (char *)tmsg + sizeof(struct type3_message);
292 292
293 ucs2le = g_convert(domain, -1, "UCS-2LE", "UTF-8", NULL, NULL, NULL); 293 ucs2le = g_convert(domain, -1, "UCS-2LE", "UTF-8", NULL, NULL, NULL);
294 memcpy(tmp, ucs2le, domainlen); 294 memcpy(tmp, ucs2le, domainlen);