comparison src/protocols/simple/simple.c @ 13085:3382d7aa9ca3

[gaim-migrate @ 15447] correctly parse NTLM realm committer: Tailor Script <tailor@pidgin.im>
author Thomas Butter <tbutter>
date Tue, 31 Jan 2006 21:35:43 +0000
parents 31a3a9af1494
children a91a8a28f61f
comparison
equal deleted inserted replaced
13084:31a3a9af1494 13085:3382d7aa9ca3
43 #include "sipmsg.h" 43 #include "sipmsg.h"
44 #include "dnssrv.h" 44 #include "dnssrv.h"
45 #include "ntlm.h" 45 #include "ntlm.h"
46 46
47 static char *gentag() { 47 static char *gentag() {
48 // return g_strdup("0e3f151");
49 return g_strdup_printf("%04d%04d", rand() & 0xFFFF, rand() & 0xFFFF); 48 return g_strdup_printf("%04d%04d", rand() & 0xFFFF, rand() & 0xFFFF);
50 } 49 }
51 50
52 static char *genbranch() { 51 static char *genbranch() {
53 return g_strdup_printf("z9hG4bK%04X%04X%04X%04X%04X", 52 return g_strdup_printf("z9hG4bK%04X%04X%04X%04X%04X",
311 if(!strncmp(source, attrname, len)) { 310 if(!strncmp(source, attrname, len)) {
312 tmp = source + len; 311 tmp = source + len;
313 tmp2 = g_strstr_len(tmp, strlen(tmp), "\""); 312 tmp2 = g_strstr_len(tmp, strlen(tmp), "\"");
314 if(tmp2) 313 if(tmp2)
315 retval = g_strndup(tmp, tmp2 - tmp); 314 retval = g_strndup(tmp, tmp2 - tmp);
315 else
316 retval = g_strdup(tmp);
316 } 317 }
317 318
318 return retval; 319 return retval;
319 } 320 }
320 321
336 if(!g_strncasecmp(hdr, "NTLM", 4)) { 337 if(!g_strncasecmp(hdr, "NTLM", 4)) {
337 gaim_debug_info("simple", "found NTLM\n"); 338 gaim_debug_info("simple", "found NTLM\n");
338 auth->type = 2; 339 auth->type = 2;
339 if(!strstr(hdr, "gssapi-data")) { 340 if(!strstr(hdr, "gssapi-data")) {
340 gaim_debug_info("simple","here"); 341 gaim_debug_info("simple","here");
341 parts = g_strsplit(hdr, " ", 0); 342 parts = g_strsplit(hdr+5, "\", ", 0);
342 i = 0; 343 i = 0;
343 auth->realm = "SIP Communications Service";
344 while(parts[i]) { 344 while(parts[i]) {
345 gaim_debug_info("simple","parts[i] %s\n",parts[i]); 345 gaim_debug_info("simple","parts[i] %s\n",parts[i]);
346 if((tmp = parse_attribute("targetname=\"", 346 if((tmp = parse_attribute("targetname=\"",
347 parts[i]))) { 347 parts[i]))) {
348 auth->target = tmp; 348 auth->target = tmp;