comparison libpurple/protocols/jabber/auth.c @ 15766:51dd9ae01585

pass the correct domain to cyrus sasl (sf patch 1663064)
author Nathan Walp <nwalp@pidgin.im>
date Sat, 03 Mar 2007 19:18:38 +0000
parents 5fe8042783c1
children 32c366eeeb99
comparison
equal deleted inserted replaced
15738:20225df32b7e 15766:51dd9ae01585
205 secprops.property_names = 0; 205 secprops.property_names = 0;
206 secprops.property_values = 0; 206 secprops.property_values = 0;
207 207
208 do { 208 do {
209 again = FALSE; 209 again = FALSE;
210 /* Use the user's domain for compatibility with the old 210
211 * DIGESTMD5 code. Note that this may cause problems where 211 js->sasl_state = sasl_client_new("xmpp", js->serverFQDN, NULL, NULL, js->sasl_cb, 0, &js->sasl);
212 * the user's domain doesn't match the FQDN of the jabber
213 * service
214 */
215
216 js->sasl_state = sasl_client_new("xmpp", js->user->domain, NULL, NULL, js->sasl_cb, 0, &js->sasl);
217 if (js->sasl_state==SASL_OK) { 212 if (js->sasl_state==SASL_OK) {
218 sasl_setprop(js->sasl, SASL_SEC_PROPS, &secprops); 213 sasl_setprop(js->sasl, SASL_SEC_PROPS, &secprops);
219 gaim_debug_info("sasl", "Mechs found: %s\n", js->sasl_mechs->str); 214 gaim_debug_info("sasl", "Mechs found: %s\n", js->sasl_mechs->str);
220 js->sasl_state = sasl_client_start(js->sasl, js->sasl_mechs->str, NULL, &clientout, &coutlen, &mech); 215 js->sasl_state = sasl_client_start(js->sasl, js->sasl_mechs->str, NULL, &clientout, &coutlen, &mech);
221 } 216 }
258 /* 253 /*
259 * DAA: is this right? 254 * DAA: is this right?
260 * The manpage says that "mech" will contain the chosen mechanism on success. 255 * The manpage says that "mech" will contain the chosen mechanism on success.
261 * Presumably, if we get here that isn't the case and we shouldn't try again? 256 * Presumably, if we get here that isn't the case and we shouldn't try again?
262 * I suspect that this never happens. 257 * I suspect that this never happens.
258 */
259 /*
260 * SXW: Yes, this is right. What this handles is the situation where a
261 * mechanism, say GSSAPI, is tried. If that mechanism fails, it may be
262 * due to mechanism specific issues, so we want to try one of the other
263 * supported mechanisms. This code handles that case
263 */ 264 */
264 if (mech && strlen(mech) > 0) { 265 if (mech && strlen(mech) > 0) {
265 char *pos; 266 char *pos;
266 if ((pos = strstr(js->sasl_mechs->str, mech))) { 267 if ((pos = strstr(js->sasl_mechs->str, mech))) {
267 g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(mech)); 268 g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(mech));