[Adium-devl] 1.2b4 breaks Jabber

Evan Schoenberg evan.s at dreskin.net
Mon Dec 24 17:43:51 UTC 2007


On Dec 24, 2007, at 11:11 AM, Peter Saint-Andre wrote:

> What exactly is the error? This sounds like a problem with SASL
> authentication, perhaps with the DIGEST-MD5 mechanism (though I think
> that Google Talk doesn't use that mechanism).

It was from specification of the User name when determining the string  
to send over the PLAIN mechanism in SASL.  It looks like one should be  
able to pass SASL a user name ("client user identity to login as" per  
documentation) in addition to the 'auth name' ("client authentication  
name").  However, doing so produces an invalid authentication string  
for PLAIN.

Here's the code which works. Note that USER is set to "".

static int jabber_sasl_cb_simple(void *ctx, int id, const char **res,  
unsigned *len)
{
	JabberStream *js = (JabberStream *)ctx;

	switch(id) {
		case SASL_CB_AUTHNAME:
			*res = js->user->node;
			break;
		case SASL_CB_USER:
			*res = "";
			break;
		default:
			return SASL_BADPARAM;
	}
	if (len) *len = strlen((char *)*res);
	return SASL_OK;
}

And here's what was in 1.2b4, a change I'd made while testing locally  
and which turns out to fail. Note that USER is set to the same as  
AUTHNAME.

static int jabber_sasl_cb_simple(void *ctx, int id, const char **res,  
unsigned *len)
{
	JabberStream *js = (JabberStream *)ctx;

	switch(id) {
		case SASL_CB_USER:
		case SASL_CB_AUTHNAME:
			*res = js->user->node;
			break;
		default:
			return SASL_BADPARAM;
	}
	if (len) *len = strlen((char *)*res);
	return SASL_OK;
}

I've reverted the change for 1.2b5 with a befuddled shrug.

-Evan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20071224/388c5ae6/attachment-0001.html>


More information about the devel mailing list