comparison src/protocols/simple/simple.c @ 13698:6bee2e80e42c

[gaim-migrate @ 16101] Additional constification, add some comments, remove some superfluous whitespace, and changed gchar to guint8 in a few places. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 28 Apr 2006 03:52:09 +0000
parents 299536c4caf1
children e4a4983752a9
comparison
equal deleted inserted replaced
13697:89ceef5203ac 13698:6bee2e80e42c
276 ret = g_strdup_printf("Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", nc=\"%s\", response=\"%s\"\r\n", authuser, auth->realm, auth->nonce, target, noncecount, response); 276 ret = g_strdup_printf("Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", nc=\"%s\", response=\"%s\"\r\n", authuser, auth->realm, auth->nonce, target, noncecount, response);
277 g_free(response); 277 g_free(response);
278 return ret; 278 return ret;
279 } else if(auth->type == 2) { /* NTLM */ 279 } else if(auth->type == 2) { /* NTLM */
280 if(auth->nc == 3 && auth->nonce) { 280 if(auth->nc == 3 && auth->nonce) {
281 ret = gaim_ntlm_gen_type3(authuser, sip->password, "gaim", authdomain, auth->nonce, &auth->flags); 281 /* TODO: Don't hardcode "gaim" as the hostname */
282 ret = gaim_ntlm_gen_type3(authuser, sip->password, "gaim", authdomain, (const guint8 *)auth->nonce, &auth->flags);
282 tmp = g_strdup_printf("NTLM qop=\"auth\", opaque=\"%s\", realm=\"%s\", targetname=\"%s\", gssapi-data=\"%s\"\r\n", auth->opaque, auth->realm, auth->target, ret); 283 tmp = g_strdup_printf("NTLM qop=\"auth\", opaque=\"%s\", realm=\"%s\", targetname=\"%s\", gssapi-data=\"%s\"\r\n", auth->opaque, auth->realm, auth->target, ret);
283 g_free(ret); 284 g_free(ret);
284 return tmp; 285 return tmp;
285 } 286 }
286 tmp = g_strdup_printf("NTLM qop=\"auth\", realm=\"%s\", targetname=\"%s\", gssapi-data=\"\"\r\n", auth->realm, auth->target); 287 tmp = g_strdup_printf("NTLM qop=\"auth\", realm=\"%s\", targetname=\"%s\", gssapi-data=\"\"\r\n", auth->realm, auth->target);
337 parts = g_strsplit(hdr+5, "\", ", 0); 338 parts = g_strsplit(hdr+5, "\", ", 0);
338 i = 0; 339 i = 0;
339 while(parts[i]) { 340 while(parts[i]) {
340 gaim_debug_info("simple", "parts[i] %s\n", parts[i]); 341 gaim_debug_info("simple", "parts[i] %s\n", parts[i]);
341 if((tmp = parse_attribute("gssapi-data=\"", parts[i]))) { 342 if((tmp = parse_attribute("gssapi-data=\"", parts[i]))) {
342 auth->nonce = g_strdup(gaim_ntlm_parse_type2(tmp, &auth->flags)); 343 auth->nonce = g_memdup(gaim_ntlm_parse_type2(tmp, &auth->flags), 8);
343 g_free(tmp); 344 g_free(tmp);
344 } 345 }
345 if((tmp = parse_attribute("targetname=\"", 346 if((tmp = parse_attribute("targetname=\"",
346 parts[i]))) { 347 parts[i]))) {
347 auth->target = tmp; 348 auth->target = tmp;